The new flow:
1) Provision the instance
2) Tear down the instance, but keep the boot disk
3) Create an image from the disk
4) Tear down the disk
The step to update gcloud is no longer needed, since gceimagebundle isn't used anymore.
Fixes#1507 and addresses https://github.com/mitchellh/packer/issues/1447#issuecomment-61610235.
Previously, any per instance metadata supplied via the GCE builder
was ignored.
Test plan:
- make test
- Manual testing via:
-- Created a packer config that contained a GCE builder with custom
metadata set.
-- Ran `packer build`.
-- Verified the instance had the correct metadata in the GCE console.
Within GCE, images may be shared across projects. Prior to this
commit, there was no way to inform the GCE builder that a source
image belonged to a specific project. This adds an optional
'source_image_project_id' key to the GCE builder config.
Retain the current default of an instance name generated by UUID, but allow
users to choose a specific one. Useful for provisioning with Puppet when a
node name is used to select the right manifest.