summaryrefslogtreecommitdiff
path: root/vendor/github.com/mitchellh/packer/builder/googlecompute/driver_gce.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/mitchellh/packer/builder/googlecompute/driver_gce.go')
-rw-r--r--vendor/github.com/mitchellh/packer/builder/googlecompute/driver_gce.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/vendor/github.com/mitchellh/packer/builder/googlecompute/driver_gce.go b/vendor/github.com/mitchellh/packer/builder/googlecompute/driver_gce.go
index fe3987a1..0df21eba 100644
--- a/vendor/github.com/mitchellh/packer/builder/googlecompute/driver_gce.go
+++ b/vendor/github.com/mitchellh/packer/builder/googlecompute/driver_gce.go
@@ -380,6 +380,15 @@ func (d *driverGCE) RunInstance(c *InstanceConfig) (<-chan error, error) {
})
}
+ var guestAccelerators []*compute.AcceleratorConfig
+ if c.AcceleratorCount > 0 {
+ ac := &compute.AcceleratorConfig{
+ AcceleratorCount: c.AcceleratorCount,
+ AcceleratorType: c.AcceleratorType,
+ }
+ guestAccelerators = append(guestAccelerators, ac)
+ }
+
// Create the instance information
instance := compute.Instance{
Description: c.Description,
@@ -397,7 +406,9 @@ func (d *driverGCE) RunInstance(c *InstanceConfig) (<-chan error, error) {
},
},
},
- MachineType: machineType.SelfLink,
+ GuestAccelerators: guestAccelerators,
+ Labels: c.Labels,
+ MachineType: machineType.SelfLink,
Metadata: &compute.Metadata{
Items: metadata,
},