Merge pull request #1001 from zshenker/update-gce-builder-to-v1-api

Updates googlecompute build to v1 API & uses boot persistent disk
This commit is contained in:
Ross Smith II 2014-04-21 08:04:35 -07:00
commit e9c84ef449
1 changed files with 13 additions and 2 deletions

View File

@ -8,7 +8,7 @@ import (
"code.google.com/p/goauth2/oauth"
"code.google.com/p/goauth2/oauth/jwt"
"code.google.com/p/google-api-go-client/compute/v1beta16"
"code.google.com/p/google-api-go-client/compute/v1"
"github.com/mitchellh/packer/packer"
)
@ -168,7 +168,18 @@ func (d *driverGCE) RunInstance(c *InstanceConfig) (<-chan error, error) {
// Create the instance information
instance := compute.Instance{
Description: c.Description,
Image: image.SelfLink,
Disks: []*compute.AttachedDisk{
&compute.AttachedDisk{
Type: "PERSISTENT",
Mode: "READ_WRITE",
Kind: "compute#attachedDisk",
Boot: true,
AutoDelete: true,
InitializeParams: &compute.AttachedDiskInitializeParams{
SourceImage: image.SelfLink,
},
},
},
MachineType: machineType.SelfLink,
Metadata: &compute.Metadata{
Items: metadata,