summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-heat/two_vms_example.template
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-heat/two_vms_example.template')
-rw-r--r--meta-openstack/recipes-devtools/python/python-heat/two_vms_example.template74
1 files changed, 74 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-heat/two_vms_example.template b/meta-openstack/recipes-devtools/python/python-heat/two_vms_example.template
new file mode 100644
index 0000000..9690e5a
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-heat/two_vms_example.template
@@ -0,0 +1,74 @@
1heat_template_version: 2014-05-06
2description: Template to deploy two VMs
3parameters:
4 vm_type:
5 type: string
6 description: Type of the instance to be created.
7 default: m1.tiny
8 constraints:
9 - allowed_values: [m1.tiny, m1.small, m1.medium, m1.large]
10 description:
11 Value must be one of 'm1.tiny', 'm1.small', 'm1.medium' or 'm1.large'.
12 image_id:
13 type: string
14 description: ID of the image to use for 2 VMs to be created.
15 default: myfirstimage
16 vol_1_size:
17 type: number
18 description: Size of the volume to be created.
19 default: 1
20 constraints:
21 - range: { min: 1, max: 1024 }
22 description: must be between 1 and 1024 Gb.
23 vol_1_type:
24 type: string
25 description: Cinder backend type
26 default: lvm_iscsi
27 constraints:
28 - allowed_values: [lvm_iscsi, nfs, glusterfs, cephrbd]
29 description:
30 Value must be one of 'lvm_iscsi', 'nfs', 'glusterfs' or 'cephrbd'.
31 vol_2_id:
32 type: string
33 description: Cinder existing volume id
34resources:
35 vm_1:
36 type: OS::Nova::Server
37 properties:
38 image: { get_param: image_id }
39 flavor: { get_param: vm_type }
40 vm_2:
41 type: OS::Nova::Server
42 properties:
43 image: { get_param: image_id }
44 flavor: { get_param: vm_type }
45 vol_1:
46 type: OS::Cinder::Volume
47 properties:
48 size: { get_param: vol_1_size }
49 volume_type: { get_param: vol_1_type }
50 vol_1_attachment:
51 type: OS::Cinder::VolumeAttachment
52 properties:
53 volume_id: { get_resource: vol_1 }
54 instance_uuid: { get_resource: vm_1 }
55 mountpoint: /dev/vdb
56 vol_2_attachment:
57 type: OS::Cinder::VolumeAttachment
58 properties:
59 volume_id: { get_param: vol_2_id }
60 instance_uuid: { get_resource: vm_1 }
61 mountpoint: /dev/vdc
62outputs:
63 vm_1_instance_ip:
64 description: Public IP address of VM 1.
65 value: { get_attr: [vm_1, first_address] }
66 vm_1_show:
67 description: Show details of VM 1.
68 value: { get_attr: [vm_1, show] }
69 vm_2_instance_ip:
70 description: Public IP address of VM 2.
71 value: { get_attr: [vm_2, first_address] }
72 vm_2_show:
73 description: Show details of VM 2.
74 value: { get_attr: [vm_2, show] }