From 18e871ba58697e651f8036cae4d41f631cf218d8 Mon Sep 17 00:00:00 2001 From: Vu Tran Date: Wed, 14 May 2014 16:11:41 -0400 Subject: heat: add example hot templates Add 2 hot templates which can be used to create heat stack for demonstrating heat stack lifecycle management and autoscaling Signed-off-by: Vu Tran --- .../python/python-heat/two_vms_example.template | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-heat/two_vms_example.template (limited to 'meta-openstack/recipes-devtools/python/python-heat/two_vms_example.template') 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 @@ +heat_template_version: 2014-05-06 +description: Template to deploy two VMs +parameters: + vm_type: + type: string + description: Type of the instance to be created. + default: m1.tiny + constraints: + - allowed_values: [m1.tiny, m1.small, m1.medium, m1.large] + description: + Value must be one of 'm1.tiny', 'm1.small', 'm1.medium' or 'm1.large'. + image_id: + type: string + description: ID of the image to use for 2 VMs to be created. + default: myfirstimage + vol_1_size: + type: number + description: Size of the volume to be created. + default: 1 + constraints: + - range: { min: 1, max: 1024 } + description: must be between 1 and 1024 Gb. + vol_1_type: + type: string + description: Cinder backend type + default: lvm_iscsi + constraints: + - allowed_values: [lvm_iscsi, nfs, glusterfs, cephrbd] + description: + Value must be one of 'lvm_iscsi', 'nfs', 'glusterfs' or 'cephrbd'. + vol_2_id: + type: string + description: Cinder existing volume id +resources: + vm_1: + type: OS::Nova::Server + properties: + image: { get_param: image_id } + flavor: { get_param: vm_type } + vm_2: + type: OS::Nova::Server + properties: + image: { get_param: image_id } + flavor: { get_param: vm_type } + vol_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vol_1_size } + volume_type: { get_param: vol_1_type } + vol_1_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_resource: vol_1 } + instance_uuid: { get_resource: vm_1 } + mountpoint: /dev/vdb + vol_2_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_param: vol_2_id } + instance_uuid: { get_resource: vm_1 } + mountpoint: /dev/vdc +outputs: + vm_1_instance_ip: + description: Public IP address of VM 1. + value: { get_attr: [vm_1, first_address] } + vm_1_show: + description: Show details of VM 1. + value: { get_attr: [vm_1, show] } + vm_2_instance_ip: + description: Public IP address of VM 2. + value: { get_attr: [vm_2, first_address] } + vm_2_show: + description: Show details of VM 2. + value: { get_attr: [vm_2, show] } -- cgit v1.2.3-54-g00ecf