Skip to content

Commit

Permalink
add guest os features to compute image (#2339)
Browse files Browse the repository at this point in the history
Merged PR #2339.
  • Loading branch information
megan07 authored and modular-magician committed Sep 18, 2019
1 parent 44ee2cb commit 48b0aeb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
25 changes: 7 additions & 18 deletions products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3773,31 +3773,20 @@ objects:
- !ruby/object:Api::Type::Array
name: 'guestOsFeatures'
description: |
A list of features to enable on the guest OS. Applicable for
bootable images only. Currently, only one feature can be enabled,
VIRTIO_SCSI_MULTIQUEUE, which allows each virtual CPU to have its
own queue. For Windows images, you can only enable
VIRTIO_SCSI_MULTIQUEUE on images with driver version 1.2.0.1621 or
higher. Linux images with kernel versions 3.17 and higher will
support VIRTIO_SCSI_MULTIQUEUE.
For new Windows images, the server might also populate this field
with the value WINDOWS, to indicate that this is a Windows image.
This value is purely informational and does not enable or disable
any features.
A list of features to enable on the guest operating system.
Applicable only for bootable images.
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::Enum
name: 'type'
description: |
The type of supported feature. Currently only
VIRTIO_SCSI_MULTIQUEUE is supported. For newer Windows images,
the server might also populate this property with the value
WINDOWS to indicate that this is a Windows image. This value is
purely informational and does not enable or disable any
features.
The type of supported feature. Read [Enabling guest operating system features](https://cloud.google.com/compute/docs/images/create-delete-deprecate-private-images#guest-os-features) to see a list of available options.
values:
- :MULTI_IP_SUBNET
- :SECURE_BOOT
- :UEFI_COMPATIBLE
- :VIRTIO_SCSI_MULTIQUEUE
- :WINDOWS
- !ruby/object:Api::Type::Integer
name: 'id'
description: |
Expand Down
7 changes: 5 additions & 2 deletions products/compute/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -787,15 +787,18 @@ overrides: !ruby/object:Overrides::ResourceOverrides
primary_resource_id: "example"
vars:
image_name: "example-image"
- !ruby/object:Provider::Terraform::Examples
name: "image_guest_os"
primary_resource_id: "example"
vars:
image_name: "example-image"
properties:
id: !ruby/object:Overrides::Terraform::PropertyOverride
exclude: true
diskSizeGb: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
deprecated: !ruby/object:Overrides::Terraform::PropertyOverride
exclude: true
guestOsFeatures: !ruby/object:Overrides::Terraform::PropertyOverride
exclude: true
imageEncryptionKey: !ruby/object:Overrides::Terraform::PropertyOverride
exclude: true
licenses: !ruby/object:Overrides::Terraform::PropertyOverride
Expand Down
15 changes: 15 additions & 0 deletions templates/terraform/examples/image_guest_os.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resource "google_compute_image" "example" {
name = "<%= ctx[:vars]['image_name'] %>"

raw_disk {
source = "https://storage.googleapis.com/bosh-cpi-artifacts/bosh-stemcell-3262.4-google-kvm-ubuntu-trusty-go_agent-raw.tar.gz"
}

guest_os_features {
type = "SECURE_BOOT"
}

guest_os_features {
type = "MULTI_IP_SUBNET"
}
}

0 comments on commit 48b0aeb

Please sign in to comment.