Enable java thread dumps for netvirt csit
[releng/builder.git] / openstack-hot / generic-server.yaml
index 1c75c81a01c3547735d6fc26162c5b6efb7e8e30..39c38563c7edb4464970c36e7b9693e4aced993b 100644 (file)
@@ -1,9 +1,21 @@
+---
 heat_template_version: 2016-04-08
 
 parameters:
     job_name:
         type: string
         description: Name of job running this template
+    silo:
+        type: string
+        default: vm
+        description: |
+            String to identify a Jenkins Master
+
+            Useful in scenarios where multiple Jenkins Masters might be
+            creating VMs in the same cloud to uniquely distinguish them.
+
+            TODO we should move to using tags once OpenStack Ocata which is
+            available to us with support for server tags properties.
     ssh_key:
         type: string
         description: SSH Key name to use (Public key must exist in OpenStack)
@@ -21,28 +33,33 @@ resources:
     instance:
         type: "OS::Nova::Server"
         properties:
-            flavor: { get_param: vm_flavor }
-            image: { get_param: vm_image }
+            flavor: {get_param: vm_flavor}
+            image: {get_param: vm_image}
             name:
                 str_replace:
-                    template: JOB_NAME-VM_TYPE-INDEX
+                    template: SILO-JOB_NAME-VM_TYPE-INDEX
                     params:
-                        "JOB_NAME": { get_param: job_name }
+                        "SILO": {get_param: silo}
+                        "JOB_NAME": {get_param: job_name}
                         "VM_TYPE":
                             str_split:
                                 - ' - '
-                                - { get_param: vm_image }
+                                - {get_param: vm_image}
                                 - 1
-                        "INDEX": { get_param: index }
+                        "INDEX": {get_param: index}
             networks:
                 - network: RC-ODL
-            key_name: { get_param: ssh_key }
+            key_name: {get_param: ssh_key}
             user_data: |
                 #!/bin/bash
+                until ping -c1 git.opendaylight.org &>/dev/null
+                do
+                    echo "Waiting until git.opendaylight.org is resolvable..."
+                done
                 git clone https://git.opendaylight.org/gerrit/releng/builder /builder
                 /builder/jenkins-scripts/jenkins-init-script.sh
 
 outputs:
     ip:
         description: IP address of the instance
-        value: { get_attr: [instance, networks, RC-ODL, 0] }
+        value: {get_attr: [instance, networks, RC-ODL, 0]}