From: Andrew Grimberg Date: Fri, 19 Apr 2019 04:41:02 +0000 (-0700) Subject: Fix volume options X-Git-Tag: v0.3.0~1^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=c5d9455ee1ab96fec03cb2551687064b1dfdc6d7;p=releng%2Fcommon-packer.git Fix volume options Change I358c414adb49bba9349f30a1190c2f8b90f13d14 had a few issues. Of note, packer variables can only be strings, even if they get interpolated to booleans where needed. Additionally the volume format can only be specified if use_block_storage is true and we default to false. This means that if volume storage is being set then the volume format must be set and it needs to be set to raw! Finally, the windows builder did not contain all the extra variables being defined. Change-Id: Icb2de795f0ba185a2d758123ec5dd705c86d8980 Signed-off-by: Andrew Grimberg --- diff --git a/templates/builder.json b/templates/builder.json index 2fce543..f30c54c 100644 --- a/templates/builder.json +++ b/templates/builder.json @@ -7,8 +7,9 @@ "cloud_user_data": null, "cloud_region": "ca-ymq-1", "cloud_availability_zone": "ca-ymq-2", - "vm_use_block_storage": false, + "vm_use_block_storage": "false", "vm_volume_size": "10", + "vm_image_disk_format": "", "distro": null, "flavor": "v1-standard-1", "ssh_user": null, @@ -35,7 +36,7 @@ }, "use_blockstorage_volume": "{{user `vm_use_block_storage`}}", "volume_size": "{{user `vm_volume_size`}}", - "image_disk_format": "raw" + "image_disk_format": "{{user `vm_image_disk_format`}}" } ], "provisioners": [ diff --git a/templates/docker.json b/templates/docker.json index 4be948c..b02ccfb 100644 --- a/templates/docker.json +++ b/templates/docker.json @@ -7,8 +7,9 @@ "cloud_user_data": null, "cloud_region": "ca-ymq-1", "cloud_availability_zone": "ca-ymq-2", - "vm_use_block_storage": false, + "vm_use_block_storage": "false", "vm_volume_size": "10", + "vm_image_disk_format": "", "distro": null, "flavor": "v1-standard-1", "ssh_user": null, @@ -32,10 +33,10 @@ "flavor": "{{user `flavor`}}", "metadata": { "ci_managed": "yes" - } + }, "use_blockstorage_volume": "{{user `vm_use_block_storage`}}", "volume_size": "{{user `vm_volume_size`}}", - "image_disk_format": "raw" + "image_disk_format": "{{user `vm_image_disk_format`}}" } ], "provisioners": [ diff --git a/templates/windows-builder.json b/templates/windows-builder.json index 7fff46d..ff74e9b 100644 --- a/templates/windows-builder.json +++ b/templates/windows-builder.json @@ -7,8 +7,9 @@ "cloud_user_data": null, "cloud_region": "ca-ymq-1", "cloud_availability_zone": "ca-ymq-2", - "vm_use_block_storage": false, + "vm_use_block_storage": "false", "vm_volume_size": "10", + "vm_image_disk_format": "", "distro": null, "flavor": "v1-standard-4" }, @@ -26,6 +27,12 @@ ], "user_data_file": "{{user `cloud_user_data`}}", "flavor": "{{user `flavor`}}", + "metadata": { + "ci_managed": "yes" + }, + "use_blockstorage_volume": "{{user `vm_use_block_storage`}}", + "volume_size": "{{user `vm_volume_size`}}", + "image_disk_format": "{{user `vm_image_disk_format`}}", "communicator": "winrm", "winrm_insecure": true, "winrm_use_ssl": true,