-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1-deploy-vm-attachvol.yaml
62 lines (57 loc) · 1.81 KB
/
1-deploy-vm-attachvol.yaml
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
heat_template_version: 2014-10-16
description: a template to deploy two compute instances (CentOS7) \
- one for web frontend \
- another for db backend with an attached volume
parameters:
key_name:
type: string
label: Key Name
description: Name of key-pair to be used for compute instance
default: son-key
image_id:
type: string
label: Image ID
description: Image to be used for compute instance
default: cirros
instance_type:
type: string
label: Instance Type
description: Type of instance (flavor) to be used
default: fl.default
constraints:
- allowed_values: [ fl.default, fl.large, fl.xlarge, fl.huge ]
description: Value must be one of m1.medium, m1.large or m1.xlarge
myDbVolume:
type: string
label: myDbVolume
description: a Volume to attach to an instance (get unique Volume ID from Horizon or Cinder CLI)
default: d98aceb0-eb39-4b39-bf5a-b8e54d3a54c5
resources:
my_web_instance:
type: OS::Nova::Server
properties:
networks:
- network: net-ptin
key_name: { get_param: key_name }
image: { get_param: image_id }
flavor: { get_param: instance_type }
my_db_instance:
type: OS::Nova::Server
properties:
networks:
- network: net-ptin
key_name: { get_param: key_name }
image: { get_param: image_id }
flavor: { get_param: instance_type }
db_vol_attach:
type: OS::Cinder::VolumeAttachment
properties:
instance_uuid: { get_resource: my_db_instance }
volume_id: { get_param: myDbVolume }
outputs:
www_instance_ip:
description: the IP address of the instance
value: { get_attr: [my_web_instance, first_address] }
db_instance_ip:
description: the IP address of the instance
value: { get_attr: [my_db_instance, first_address] }