1 heat_template_version: 2013-05-23
3 ##########################################################
6 # - Updated per ECOMP Feedback
9 ##########################################################
11 description: This stack creates two ECA OAM VM and one ARB VM
16 description: Unique ID for this VNF instance
17 default: This_is_ths_MMSC-ECA_id
19 type: comma_delimited_list
20 label: oam servers names
21 description: the names of the OAM1,OAM2 VM instances
23 type: comma_delimited_list
24 label: oam servers names
25 description: the names of the OAM1,OAM2 VM instances
27 type: comma_delimited_list
28 label: oam servers names
29 description: the names of the OAM1,OAM2 VM instances
31 type: comma_delimited_list
32 label: oam servers names
33 description: the names of the OAM1,OAM2 VM instances
35 type: comma_delimited_list
36 label: arbiter server names
37 description: the names of the arbiter VM instances
41 description: the OAM image name
45 description: OAM flavor name
49 description: arbiter flavor name
52 label: availabilityzone name
53 description: availabilityzone name
56 label: oam network name
57 description: the name of the oam network
60 label: internal network name
61 description: the name of the internal network
63 type: comma_delimited_list
64 label: oam network ips
65 description: the ips of oam networks for eca VM
67 type: comma_delimited_list
68 label: eca_mgmt network ips for eca VM
69 description: internal eca_mgmt network ips for eca VM
71 type: comma_delimited_list
72 label: oam network ips for arb VM
73 description: oam network ips for eca VM
75 type: comma_delimited_list
76 label: eca_mgmt network ips
77 description: internal eca_mgmt network ips for arb VM
80 label: oam network gateway
81 description: oam network gateway
84 label: security group name
85 description: the name of security group
89 description: the size of the OAM volume
93 description: the size of the ARB volume
97 description: Base URL for eca swift object store
100 label: eca oam vm volume type
101 description: the name of the target volume backend
104 label: arb vm volume type
105 description: the name of the target volume backend
109 type: eca_oam_nested.yaml
111 cmaui_name: { get_param: [cmaui_names, 0]}
112 cmaui_image: { get_param: cmaui_image }
113 availability_zone_0: { get_param: availability_zone_0 }
114 flavor: { get_param: cmaui_flavor }
116 - port: { get_resource: cmaui_port_0 }
118 vnf_id: { get_param: vnf_id }
122 cmaui.mgmt.ip=${cmaui.mgmt.ip}
123 cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
124 cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
125 cmaui.external.dns=${cmaui.external.dns}
126 cmaui.external.ntp=${cmaui.external.ntp}
127 cmaui.node=${cmaui.node}
128 cmaui.timezone=${cmaui.timezone}
130 ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
131 ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
132 ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
133 ${cmaui.external.dns}: {get_param: external_dns}
134 ${cmaui.external.ntp}: {get_param: external_ntp}
135 ${cmaui.node}: {get_param: [cmaui_names, 0]}
136 ${cmaui.timezone}: {get_param: timezone}
137 user_data_format: RAW
140 type: OS::Nova::Server
142 name: {get_param: [eca_names, 0]}
143 image: {get_param: oam_image_name}
144 flavor: {get_param: oam_flavor}
145 availability_zone: {get_param: availability_zone_0}
147 - port: {get_resource: oam1_int_port}
148 - port: {get_resource: oam1_mgmt_port}
150 vnf_id: { get_param: vnf_id }
155 sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network
156 eth1_ip_address='oam1_mgt_ip'
157 eth1_gateway='oam_gateway'
158 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
159 if [ "$interface" != "lo" ]; then
160 DEVICE_NAME=$interface
161 interface_ip_var="${DEVICE_NAME}_ip_address"
162 gateway_var="${DEVICE_NAME}_gateway"
163 var_name="$interface_ip_var"
164 var_gateway="$gateway_var"
165 if [ ! -z ${!var_name} ]; then
168 GATEWAY=${!var_gateway}
169 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
170 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
171 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
172 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
173 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
174 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
176 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
177 echo "Configuring $DEVICE_NAME to use DHCP"
178 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
179 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
180 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
185 printf "$DEVICE_NAME\n" >> /tmp/network_config
188 mkdir /etc/puppet/files/roles/transcoder
189 mkdir /etc/puppet/files/roles/oam_primary
190 curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp
191 curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp
192 curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml
193 curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml
194 curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf
195 curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf
196 curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf
197 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
198 curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp
199 curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset
200 van-role oam_primary > /root/startup-van-role.out
201 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
202 fdisk /dev/vdb < /root/fdisk-keystrokes
203 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
204 chmod 755 /root/os-conf-cinder-vol
205 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
207 oam1_mgt_ip: {get_param: [eca_oam_ips, 0] }
208 oam_gateway: {get_param: eca_oam_gateway }
209 oam1_hostname: {get_param: [eca_names, 0]}
210 swift_url: {get_param: swift_eca_url}
213 type: OS::Neutron::Port
215 network: {get_param: oam_net_name}
216 fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
217 security_groups: [{get_param: security_group_name}]
218 replacement_policy: AUTO
221 type: OS::Neutron::Port
223 network: {get_param: oam_net_name}
224 fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
225 security_groups: [{get_param: security_group_name}]
226 replacement_policy: AUTO
229 type: OS::Neutron::Port
231 network: {get_param: eca_mgmt_net_name}
232 fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}]
233 security_groups: [{get_param: security_group_name}]
234 replacement_policy: AUTO
237 type: OS::Cinder::Volume
239 size: {get_param: oam_volume_size}
240 volume_type: {get_param: ECA_OAM_volume_type}
242 oam1_volume_attachment:
243 type: OS::Cinder::VolumeAttachment
245 volume_id: {get_resource: oam1_volume}
246 instance_uuid: {get_resource: oam1_instance}
249 type: OS::Nova::Server
251 name: {get_param: [eca_names, 1]}
252 image: {get_param: oam_image_name}
253 flavor: {get_param: oam_flavor}
254 availability_zone: {get_param: availability_zone_0}
256 - port: {get_resource: oam2_int_port}
257 - port: {get_resource: oam2_mgmt_port}
259 vnf_id: { get_param: vnf_id }
264 sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network
265 eth1_ip_address='oam2_mgt_ip'
266 eth1_gateway='oam_gateway'
267 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
268 if [ "$interface" != "lo" ]; then
269 DEVICE_NAME=$interface
270 interface_ip_var="${DEVICE_NAME}_ip_address"
271 gateway_var="${DEVICE_NAME}_gateway"
272 var_name="$interface_ip_var"
273 var_gateway="$gateway_var"
274 if [ ! -z ${!var_name} ]; then
277 GATEWAY=${!var_gateway}
278 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
279 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
280 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
281 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
282 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
283 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
285 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
286 echo "Configuring $DEVICE_NAME to use DHCP"
287 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
288 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
289 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
294 printf "$DEVICE_NAME\n" >> /tmp/network_config
297 curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp
298 curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
299 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
300 van-role oam_secondary > /root/startup-van-role.out
301 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
302 fdisk /dev/vdb < /root/fdisk-keystrokes
303 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
304 chmod 755 /root/os-conf-cinder-vol
305 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
308 oam2_mgt_ip: {get_param: [eca_oam_ips, 1] }
309 oam2_hostname: {get_param: [eca_names, 1]}
310 swift_url: {get_param: swift_eca_url}
311 oam_gateway: {get_param: eca_oam_gateway }
314 type: OS::Neutron::Port
316 network: {get_param: oam_net_name}
317 fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}]
318 security_groups: [{get_param: security_group_name}]
319 replacement_policy: AUTO
322 type: OS::Neutron::Port
324 network: {get_param: eca_mgmt_net_name}
325 fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}]
326 security_groups: [{get_param: security_group_name}]
327 replacement_policy: AUTO
330 type: OS::Cinder::Volume
332 size: {get_param: oam_volume_size}
333 volume_type: {get_param: ECA_OAM_volume_type}
335 oam2_volume_attachment:
336 type: OS::Cinder::VolumeAttachment
338 volume_id: {get_resource: oam2_volume}
339 instance_uuid: {get_resource: oam2_instance}
342 type: OS::Nova::Server
344 name: {get_param: [arb_names, 0]}
345 image: {get_param: oam_image_name}
346 flavor: {get_param: arbiter_flavor}
347 availability_zone: {get_param: availability_zone_0}
349 - port: {get_resource: arb_int_port}
350 - port: {get_resource: arb_mgmt_port}
352 vnf_id: { get_param: vnf_id }
357 sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network
358 eth1_ip_address='arb_mgt_ip'
359 eth1_gateway='oam_gateway'
360 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
361 if [ "$interface" != "lo" ]; then
362 DEVICE_NAME=$interface
363 interface_ip_var="${DEVICE_NAME}_ip_address"
364 gateway_var="${DEVICE_NAME}_gateway"
365 var_name="$interface_ip_var"
366 var_gateway="$gateway_var"
367 if [ ! -z ${!var_name} ]; then
370 GATEWAY=${!var_gateway}
371 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
372 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
373 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
374 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
375 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
376 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
378 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
379 echo "Configuring $DEVICE_NAME to use DHCP"
380 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
381 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
382 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
387 printf "$DEVICE_NAME\n" >> /tmp/network_config
390 curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp
391 curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
392 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
393 van-role oam_arbiter > /root/startup-van-role.out
394 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
395 fdisk /dev/vdb < /root/fdisk-keystrokes
396 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
397 chmod 755 /root/os-conf-cinder-vol
398 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
400 arb_mgt_ip: {get_param: [arb_oam_ips, 0] }
401 arb_hostname: {get_param: [arb_names, 0]}
402 swift_url: {get_param: swift_eca_url}
403 oam_gateway: {get_param: eca_oam_gateway }
406 type: OS::Neutron::Port
408 network: {get_param: oam_net_name}
409 fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}]
410 security_groups: [{get_param: security_group_name}]
411 replacement_policy: AUTO
414 type: OS::Neutron::Port
416 network: {get_param: eca_mgmt_net_name}
417 fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}]
418 security_groups: [{get_param: security_group_name}]
419 replacement_policy: AUTO
422 type: OS::Cinder::Volume
424 size: {get_param: arb_volume_size}
425 volume_type: {get_param: ARB_volume_type}
426 arb_volume_attachment:
427 type: OS::Cinder::VolumeAttachment
429 volume_id: {get_resource: arb_volume}
430 instance_uuid: {get_resource: arb_instance}