Create volume using Cinder 79/66479/1
authorMohammed Naser <mnaser@vexxhost.com>
Thu, 14 Dec 2017 22:13:45 +0000 (17:13 -0500)
committerMohammed Naser <mnaser@vexxhost.com>
Thu, 14 Dec 2017 22:15:26 +0000 (17:15 -0500)
This switches the volume creation to be done using Heat and
attached via Nova instead of letting Nova create it right away.

The reason behind this is that it will probably be much cleaner
for clean-up and Heat is much more 'patient' in order to get
the resource created.

Change-Id: Ifc70acb967a8a2f4007aa3b020232258b4032aec
Signed-off-by: Mohammed Naser <mnaser@vexxhost.com>
openstack-hot/generic-server.yaml

index dab55a34e1fc3a2c6c9fb24dc5ec1b73517c57b9..c3a5b359f6dbd0ae64d63986561047dd4f321193 100644 (file)
@@ -33,14 +33,17 @@ parameters:
         description: VM Image to spin up
 
 resources:
+    volume:
+        type: "OS::Cinder::Volume"
+        properties:
+            image: {get_param: vm_image}
+            size: 40
     instance:
         type: "OS::Nova::Server"
         properties:
             flavor: {get_param: vm_flavor}
             block_device_mapping_v2:
-                - image: {get_param: vm_image}
-                  delete_on_termination: true
-                  volume_size: 40
+                  - volume_id: {get_resource: volume}
             name:
                 str_replace:
                     template: SILO-JOB_NAME-GROUP-VM_TYPE-INDEX