Create volume using Cinder
[releng/builder.git] / openstack-hot / generic-server.yaml
index 46614ffde887bb0573be09a92edd87b40742c75c..c3a5b359f6dbd0ae64d63986561047dd4f321193 100644 (file)
@@ -26,18 +26,24 @@ parameters:
         default: "0"
     vm_flavor:
         type: string
-        default: 1 GB General Purpose v1
+        default: v1-standard-1
         description: OpenStack Flavor to use
     vm_image:
         type: string
         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}
-            image: {get_param: vm_image}
+            block_device_mapping_v2:
+                  - volume_id: {get_resource: volume}
             name:
                 str_replace:
                     template: SILO-JOB_NAME-GROUP-VM_TYPE-INDEX
@@ -48,11 +54,11 @@ resources:
                             str_split:
                                 - ' - '
                                 - {get_param: vm_image}
-                                - 1
+                                - 2
                         "GROUP": {get_param: group}
                         "INDEX": {get_param: index}
             networks:
-                - network: RC-ODL
+                - network: odlci
             key_name: {get_param: ssh_key}
             user_data: |
                 #!/bin/bash
@@ -66,4 +72,4 @@ resources:
 outputs:
     ip:
         description: IP address of the instance
-        value: {get_attr: [instance, networks, RC-ODL, 0]}
+        value: {get_attr: [instance, networks, odlci, 0]}