Enable selection of instance knobs 33/15333/1
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Thu, 18 Apr 2019 19:56:34 +0000 (12:56 -0700)
committerAndrew Grimberg <agrimberg@linuxfoundation.org>
Thu, 18 Apr 2019 19:56:34 +0000 (12:56 -0700)
We now operate in multiple Openstack clouds (even if from the same
provider) and thus need to properly enable selectability of the region,
availability zone, instance flavor size, and if a volume needs to be
created (and at what size) for builds. We default to our current
standard configuration for Vexxhost Montreal.

If vm_use_block_storage is set true then vm_volume_size will be used
(along with the image_disk_format option which must be "raw"). If it is
false (default) then the volume size and format will be ignored. This is
needed for building on flavors that do not predefine any attached disk
as is the case for all flavors in the SJC cloud for Vexxhost.

Change-Id: I358c414adb49bba9349f30a1190c2f8b90f13d14
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
templates/builder.json
templates/docker.json
templates/windows-builder.json

index 9154d6b..2fce543 100644 (file)
@@ -5,6 +5,10 @@
     "base_image": null,
     "cloud_network": null,
     "cloud_user_data": null,
+    "cloud_region": "ca-ymq-1",
+    "cloud_availability_zone": "ca-ymq-2",
+    "vm_use_block_storage": false,
+    "vm_volume_size": "10",
     "distro": null,
     "flavor": "v1-standard-1",
     "ssh_user": null,
@@ -17,8 +21,8 @@
       "instance_name": "{{user `distro`}}-builder-{{uuid}}",
       "source_image_name": "{{user `base_image`}}",
       "type": "openstack",
-      "region": "ca-ymq-1",
-      "availability_zone": "ca-ymq-2",
+      "region": "{{user `cloud_region`}}",
+      "availability_zone": "{{user `cloud_availability_zone`}}",
       "networks": [
         "{{user `cloud_network`}}"
       ],
       "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"
     }
   ],
   "provisioners": [
index c595162..4be948c 100644 (file)
@@ -5,6 +5,10 @@
     "base_image": null,
     "cloud_network": null,
     "cloud_user_data": null,
+    "cloud_region": "ca-ymq-1",
+    "cloud_availability_zone": "ca-ymq-2",
+    "vm_use_block_storage": false,
+    "vm_volume_size": "10",
     "distro": null,
     "flavor": "v1-standard-1",
     "ssh_user": null,
@@ -17,8 +21,8 @@
       "instance_name": "{{user `distro`}}-docker-{{uuid}}",
       "source_image_name": "{{user `base_image`}}",
       "type": "openstack",
-      "region": "ca-ymq-1",
-      "availability_zone": "ca-ymq-2",
+      "region": "{{user `cloud_region`}}",
+      "availability_zone": "{{user `cloud_availability_zone`}}",
       "networks": [
         "{{user `cloud_network`}}"
       ],
@@ -29,6 +33,9 @@
       "metadata": {
         "ci_managed": "yes"
       }
+      "use_blockstorage_volume": "{{user `vm_use_block_storage`}}",
+      "volume_size": "{{user `vm_volume_size`}}",
+      "image_disk_format": "raw"
     }
   ],
   "provisioners": [
index 49eab6e..7fff46d 100644 (file)
@@ -5,6 +5,10 @@
     "base_image": null,
     "cloud_network": null,
     "cloud_user_data": null,
+    "cloud_region": "ca-ymq-1",
+    "cloud_availability_zone": "ca-ymq-2",
+    "vm_use_block_storage": false,
+    "vm_volume_size": "10",
     "distro": null,
     "flavor": "v1-standard-4"
   },
@@ -15,8 +19,8 @@
       "instance_name": "{{user `distro`}}-win-builder-{{uuid}}",
       "source_image_name": "{{user `base_image`}}",
       "type": "openstack",
-      "region": "ca-ymq-1",
-      "availability_zone": "ca-ymq-2",
+      "region": "{{user `cloud_region`}}",
+      "availability_zone": "{{user `cloud_availability_zone`}}",
       "networks": [
         "{{user `cloud_network`}}"
       ],