From be595efd99d31ae67ffd389fc1033b47b2e30e6d Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Sun, 17 Apr 2016 12:09:59 -0400 Subject: [PATCH] GCE: Rename image in tar file to disk.raw To register with GCE, the image must be named disk.raw, or else the gcloud create images command fails. --- bootstrapvz/providers/gce/tasks/image.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bootstrapvz/providers/gce/tasks/image.py b/bootstrapvz/providers/gce/tasks/image.py index 8a30a7e..1fa6818 100644 --- a/bootstrapvz/providers/gce/tasks/image.py +++ b/bootstrapvz/providers/gce/tasks/image.py @@ -30,8 +30,11 @@ class CreateTarball(Task): tarball_path = os.path.join(info.manifest.bootstrapper['workspace'], tarball_name) info._gce['tarball_name'] = tarball_name info._gce['tarball_path'] = tarball_path + # GCE requires that the file in the tar be named disk.raw, hence the transform log_check_call(['tar', '--sparse', '-C', info.manifest.bootstrapper['workspace'], - '-caf', tarball_path, filename]) + '-caf', tarball_path, + '--transform=s|.*|disk.raw|', + filename]) class UploadImage(Task):