aboutsummaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-heat/two_vms_example.template
blob: 2f2e2b50d7b0765ef64fa276c3253ba3ef313737 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
heat_template_version: 2013-05-23
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] }