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
26 type: comma_delimited_list
27 label: oam servers names
28 description: the names of the OAM1,OAM2 VM instances
31 label: internal network name
32 description: the name of the internal network
35 label: internal network name
36 description: the name of the internal network
39 label: internal network name
40 description: the name of the internal network
43 label: internal network name
44 description: the name of the internal network
47 label: internal network name
48 description: the name of the internal network
50 type: comma_delimited_list
51 label: oam servers names
52 description: the names of the OAM1,OAM2 VM instances
54 type: comma_delimited_list
55 label: oam servers names
56 description: the names of the OAM1,OAM2 VM instances
58 type: comma_delimited_list
59 label: arbiter server names
60 description: the names of the arbiter VM instances
64 description: the OAM image name
68 description: OAM flavor name
72 description: arbiter flavor name
75 label: availabilityzone name
76 description: availabilityzone name
79 label: oam network name
80 description: the name of the oam network
83 label: internal network name
84 description: the name of the internal network
86 type: comma_delimited_list
87 label: oam network ips
88 description: the ips of oam networks for eca VM
90 type: comma_delimited_list
91 label: eca_mgmt network ips for eca VM
92 description: internal eca_mgmt network ips for eca VM
94 type: comma_delimited_list
95 label: oam network ips for arb VM
96 description: oam network ips for eca VM
98 type: comma_delimited_list
99 label: eca_mgmt network ips
100 description: internal eca_mgmt network ips for arb VM
103 label: oam network gateway
104 description: oam network gateway
107 label: security group name
108 description: the name of security group
112 description: the size of the OAM volume
116 description: the size of the ARB volume
120 description: Base URL for eca swift object store
123 label: eca oam vm volume type
124 description: the name of the target volume backend
127 label: arb vm volume type
128 description: the name of the target volume backend
132 type: eca_oam_nested.yaml
134 cmaui_name: { get_param: [cmaui_names, 0]}
135 cmaui_image: { get_param: cmaui_image }
136 availability_zone_0: { get_param: availability_zone_0 }
137 flavor: { get_param: cmaui_flavor }
139 - port: { get_resource: cmaui_port_0 }
141 vnf_id: { get_param: vnf_id }
145 cmaui.mgmt.ip=${cmaui.mgmt.ip}
146 cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
147 cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
148 cmaui.external.dns=${cmaui.external.dns}
149 cmaui.external.ntp=${cmaui.external.ntp}
150 cmaui.node=${cmaui.node}
151 cmaui.timezone=${cmaui.timezone}
153 ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]}
154 ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
155 ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
156 ${cmaui.external.dns}: {get_param: external_dns}
157 ${cmaui.external.ntp}: {get_param: external_ntp}
158 ${cmaui.node}: {get_param: [cmaui_names, 0]}
159 ${cmaui.timezone}: {get_param: timezone}
160 user_data_format: RAW
163 type: OS::Nova::Server
165 name: {get_param: [eca_names, 0]}
166 image: {get_param: oam_image_name}
167 flavor: {get_param: oam_flavor}
168 availability_zone: {get_param: availability_zone_0}
170 - port: {get_resource: oam1_int_port}
171 - port: {get_resource: oam1_mgmt_port}
173 vnf_id: { get_param: vnf_id }
178 sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network
179 eth1_ip_address='oam1_mgt_ip'
180 eth1_gateway='oam_gateway'
181 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
182 if [ "$interface" != "lo" ]; then
183 DEVICE_NAME=$interface
184 interface_ip_var="${DEVICE_NAME}_ip_address"
185 gateway_var="${DEVICE_NAME}_gateway"
186 var_name="$interface_ip_var"
187 var_gateway="$gateway_var"
188 if [ ! -z ${!var_name} ]; then
191 GATEWAY=${!var_gateway}
192 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
193 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
194 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
195 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
196 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
197 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
199 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
200 echo "Configuring $DEVICE_NAME to use DHCP"
201 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
202 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
203 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
208 printf "$DEVICE_NAME\n" >> /tmp/network_config
211 mkdir /etc/puppet/files/roles/transcoder
212 mkdir /etc/puppet/files/roles/oam_primary
213 curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp
214 curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp
215 curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml
216 curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml
217 curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf
218 curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf
219 curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf
220 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
221 curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp
222 curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset
223 van-role oam_primary > /root/startup-van-role.out
224 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
225 fdisk /dev/vdb < /root/fdisk-keystrokes
226 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
227 chmod 755 /root/os-conf-cinder-vol
228 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
230 oam1_mgt_ip: {get_param: [eca_oam_ips, 0] }
231 oam_gateway: {get_param: eca_oam_gateway }
232 oam1_hostname: {get_param: [eca_names, 0]}
233 swift_url: {get_param: swift_eca_url}
236 type: OS::Neutron::Port
238 network: {get_param: oam_net_name}
239 fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
240 security_groups: [{get_param: security_group_name}]
241 replacement_policy: AUTO
244 type: OS::Neutron::Port
246 network: {get_param: oam_net_name}
247 fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
248 security_groups: [{get_param: security_group_name}]
249 replacement_policy: AUTO
252 type: OS::Neutron::Port
254 network: {get_param: eca_mgmt_net_name}
255 fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}]
256 security_groups: [{get_param: security_group_name}]
257 replacement_policy: AUTO
260 type: OS::Cinder::Volume
262 size: {get_param: oam_volume_size}
263 volume_type: {get_param: ECA_OAM_volume_type}
265 oam1_volume_attachment:
266 type: OS::Cinder::VolumeAttachment
268 volume_id: {get_resource: oam1_volume}
269 instance_uuid: {get_resource: oam1_instance}
272 type: OS::Nova::Server
274 name: {get_param: [eca_names, 1]}
275 image: {get_param: oam_image_name}
276 flavor: {get_param: oam_flavor}
277 availability_zone: {get_param: availability_zone_0}
279 - port: {get_resource: oam2_int_port}
280 - port: {get_resource: oam2_mgmt_port}
282 vnf_id: { get_param: vnf_id }
287 sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network
288 eth1_ip_address='oam2_mgt_ip'
289 eth1_gateway='oam_gateway'
290 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
291 if [ "$interface" != "lo" ]; then
292 DEVICE_NAME=$interface
293 interface_ip_var="${DEVICE_NAME}_ip_address"
294 gateway_var="${DEVICE_NAME}_gateway"
295 var_name="$interface_ip_var"
296 var_gateway="$gateway_var"
297 if [ ! -z ${!var_name} ]; then
300 GATEWAY=${!var_gateway}
301 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
302 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
303 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
304 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
305 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
306 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
308 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
309 echo "Configuring $DEVICE_NAME to use DHCP"
310 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
311 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
312 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
317 printf "$DEVICE_NAME\n" >> /tmp/network_config
320 curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp
321 curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
322 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
323 van-role oam_secondary > /root/startup-van-role.out
324 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
325 fdisk /dev/vdb < /root/fdisk-keystrokes
326 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
327 chmod 755 /root/os-conf-cinder-vol
328 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
331 oam2_mgt_ip: {get_param: [eca_oam_ips, 1] }
332 oam2_hostname: {get_param: [eca_names, 1]}
333 swift_url: {get_param: swift_eca_url}
334 oam_gateway: {get_param: eca_oam_gateway }
337 type: OS::Neutron::Port
339 network: {get_param: oam_net_name}
340 fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}]
341 security_groups: [{get_param: security_group_name}]
342 replacement_policy: AUTO
345 type: OS::Neutron::Port
347 network: {get_param: eca_mgmt_net_name}
348 fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}]
349 security_groups: [{get_param: security_group_name}]
350 replacement_policy: AUTO
353 type: OS::Cinder::Volume
355 size: {get_param: oam_volume_size}
356 volume_type: {get_param: ECA_OAM_volume_type}
358 oam2_volume_attachment:
359 type: OS::Cinder::VolumeAttachment
361 volume_id: {get_resource: oam2_volume}
362 instance_uuid: {get_resource: oam2_instance}
365 type: OS::Nova::Server
367 name: {get_param: [arb_names, 0]}
368 image: {get_param: oam_image_name}
369 flavor: {get_param: arbiter_flavor}
370 availability_zone: {get_param: availability_zone_0}
372 - port: {get_resource: arb_int_port}
373 - port: {get_resource: arb_mgmt_port}
375 vnf_id: { get_param: vnf_id }
380 sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network
381 eth1_ip_address='arb_mgt_ip'
382 eth1_gateway='oam_gateway'
383 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
384 if [ "$interface" != "lo" ]; then
385 DEVICE_NAME=$interface
386 interface_ip_var="${DEVICE_NAME}_ip_address"
387 gateway_var="${DEVICE_NAME}_gateway"
388 var_name="$interface_ip_var"
389 var_gateway="$gateway_var"
390 if [ ! -z ${!var_name} ]; then
393 GATEWAY=${!var_gateway}
394 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
395 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
396 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
397 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
398 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
399 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
401 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
402 echo "Configuring $DEVICE_NAME to use DHCP"
403 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
404 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
405 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
410 printf "$DEVICE_NAME\n" >> /tmp/network_config
413 curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp
414 curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
415 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
416 van-role oam_arbiter > /root/startup-van-role.out
417 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
418 fdisk /dev/vdb < /root/fdisk-keystrokes
419 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
420 chmod 755 /root/os-conf-cinder-vol
421 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
423 arb_mgt_ip: {get_param: [arb_oam_ips, 0] }
424 arb_hostname: {get_param: [arb_names, 0]}
425 swift_url: {get_param: swift_eca_url}
426 oam_gateway: {get_param: eca_oam_gateway }
429 type: OS::Neutron::Port
431 network: {get_param: oam_net_name}
432 fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}]
433 security_groups: [{get_param: security_group_name}]
434 replacement_policy: AUTO
437 type: OS::Neutron::Port
439 network: {get_param: eca_mgmt_net_name}
440 fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}]
441 security_groups: [{get_param: security_group_name}]
442 replacement_policy: AUTO
445 type: OS::Cinder::Volume
447 size: {get_param: arb_volume_size}
448 volume_type: {get_param: ARB_volume_type}
449 arb_volume_attachment:
450 type: OS::Cinder::VolumeAttachment
452 volume_id: {get_resource: arb_volume}
453 instance_uuid: {get_resource: arb_instance}