-
Notifications
You must be signed in to change notification settings - Fork 2
/
server_with_volume.yaml
105 lines (99 loc) · 2.88 KB
/
server_with_volume.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
heat_template_version: 2017-09-01
description: Heat template to create a server from a volume
parameters:
key_name:
description: Name of a KeyPair to enable SSH access.
type: string
flavor:
description: Flavor to use.
type: string
default: small
server_name:
description: Server name string.
type: string
volume_size:
description: Size of volume
type: number
default: 25
extra_volume_size:
description: Size of extra volume
type: number
default: 0
extra_volume_type:
type: string
default: ceph-ssd
image_id:
description: Name or ID of the image to use.
type: string
default: ubuntu-focal
net:
description: Name of the private network.
type: string
default: test
share_net:
description: Name of the network for Manila shares.
# if left unset then PLACEHOLDER will get removed later
type: string
default: PLACEHOLDER
external_net:
description: Name of the external network.
type: string
default: external
assign_public_ip:
type: boolean
default: false
server_group:
type: string
conditions:
public_ip: { get_param: assign_public_ip }
extra_volume: { not: { equals: [ { get_param: extra_volume_size }, 0] } }
resources:
vol:
type: OS::Cinder::Volume
properties:
size: { get_param: volume_size }
image: { get_param: image_id }
srv:
type: OS::Nova::Server
properties:
name: { get_param: server_name }
key_name: { get_param: key_name }
flavor: { get_param: flavor }
block_device_mapping_v2:
- device_name: sda
volume_id: { get_resource: vol }
delete_on_termination: true
networks:
# if share_net was left as default then set it to the same as net and remove duplicates to get rid of it
list_concat_unique:
- [ network: { get_param: net } ]
- [ network: { str_replace: { template: { get_param: share_net }, params: { PLACEHOLDER: { get_param: net } } } } ]
scheduler_hints:
group: { get_param: server_group }
pub_ip:
condition: public_ip
type: OS::Neutron::FloatingIP
properties:
floating_network: { get_param: external_net }
pub_ip_association:
condition: public_ip
type: OS::Neutron::FloatingIPAssociation
properties:
floatingip_id: { get_resource: pub_ip }
port_id: {get_attr: [srv, addresses, {get_param: net}, 0, port]}
extra_vol:
condition: extra_volume
type: OS::Cinder::Volume
properties:
size: { get_param: extra_volume_size }
volume_type: { get_param: extra_volume_type }
extra_vol_attachment:
condition: extra_volume
type: OS::Cinder::VolumeAttachment
properties:
instance_uuid: { get_resource: srv }
volume_id: { get_resource: extra_vol }
outputs:
first_address:
description: Private IP
value: { get_attr: [srv, first_address] }