1 heat_template_version: 2013-05-23
3 ##########################################################
6 # - Updated per OPENECOMP 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
222 type: OS::Neutron::Port
224 network: {get_param: oam_net_name}
225 fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
226 security_groups: [{get_param: security_group_name}]
227 replacement_policy: AUTO
230 type: OS::Neutron::Port
232 network: {get_param: eca_mgmt_net_name}
233 fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}]
234 security_groups: [{get_param: security_group_name}]
235 replacement_policy: AUTO
238 type: OS::Cinder::Volume
240 size: {get_param: oam_volume_size}
241 volume_type: {get_param: ECA_OAM_volume_type}
243 oam1_volume_attachment:
244 type: OS::Cinder::VolumeAttachment
246 volume_id: {get_resource: oam1_volume}
247 instance_uuid: {get_resource: oam1_instance}
250 type: OS::Nova::Server
252 name: {get_param: [eca_names, 1]}
253 image: {get_param: oam_image_name}
254 flavor: {get_param: oam_flavor}
255 availability_zone: {get_param: availability_zone_0}
257 - port: {get_resource: oam2_int_port}
258 - port: {get_resource: oam2_mgmt_port}
260 vnf_id: { get_param: vnf_id }
265 sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network
266 eth1_ip_address='oam2_mgt_ip'
267 eth1_gateway='oam_gateway'
268 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
269 if [ "$interface" != "lo" ]; then
270 DEVICE_NAME=$interface
271 interface_ip_var="${DEVICE_NAME}_ip_address"
272 gateway_var="${DEVICE_NAME}_gateway"
273 var_name="$interface_ip_var"
274 var_gateway="$gateway_var"
275 if [ ! -z ${!var_name} ]; then
278 GATEWAY=${!var_gateway}
279 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
280 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
281 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
282 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
283 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
284 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
286 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
287 echo "Configuring $DEVICE_NAME to use DHCP"
288 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
289 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
290 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
295 printf "$DEVICE_NAME\n" >> /tmp/network_config
298 curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp
299 curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
300 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
301 van-role oam_secondary > /root/startup-van-role.out
302 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
303 fdisk /dev/vdb < /root/fdisk-keystrokes
304 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
305 chmod 755 /root/os-conf-cinder-vol
306 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
309 oam2_mgt_ip: {get_param: [eca_oam_ips, 1] }
310 oam2_hostname: {get_param: [eca_names, 1]}
311 swift_url: {get_param: swift_eca_url}
312 oam_gateway: {get_param: eca_oam_gateway }
315 type: OS::Neutron::Port
317 network: {get_param: oam_net_name}
318 fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}]
319 security_groups: [{get_param: security_group_name}]
320 replacement_policy: AUTO
323 type: OS::Neutron::Port
325 network: {get_param: eca_mgmt_net_name}
326 fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}]
327 security_groups: [{get_param: security_group_name}]
328 replacement_policy: AUTO
331 type: OS::Cinder::Volume
333 size: {get_param: oam_volume_size}
334 volume_type: {get_param: ECA_OAM_volume_type}
336 oam2_volume_attachment:
337 type: OS::Cinder::VolumeAttachment
339 volume_id: {get_resource: oam2_volume}
340 instance_uuid: {get_resource: oam2_instance}
343 type: OS::Nova::Server
345 name: {get_param: [arb_names, 0]}
346 image: {get_param: oam_image_name}
347 flavor: {get_param: arbiter_flavor}
348 availability_zone: {get_param: availability_zone_0}
350 - port: {get_resource: arb_int_port}
351 - port: {get_resource: arb_mgmt_port}
353 vnf_id: { get_param: vnf_id }
358 sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network
359 eth1_ip_address='arb_mgt_ip'
360 eth1_gateway='oam_gateway'
361 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
362 if [ "$interface" != "lo" ]; then
363 DEVICE_NAME=$interface
364 interface_ip_var="${DEVICE_NAME}_ip_address"
365 gateway_var="${DEVICE_NAME}_gateway"
366 var_name="$interface_ip_var"
367 var_gateway="$gateway_var"
368 if [ ! -z ${!var_name} ]; then
371 GATEWAY=${!var_gateway}
372 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
373 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
374 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
375 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
376 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
377 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
379 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
380 echo "Configuring $DEVICE_NAME to use DHCP"
381 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
382 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
383 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
388 printf "$DEVICE_NAME\n" >> /tmp/network_config
391 curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp
392 curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
393 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
394 van-role oam_arbiter > /root/startup-van-role.out
395 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
396 fdisk /dev/vdb < /root/fdisk-keystrokes
397 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
398 chmod 755 /root/os-conf-cinder-vol
399 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
401 arb_mgt_ip: {get_param: [arb_oam_ips, 0] }
402 arb_hostname: {get_param: [arb_names, 0]}
403 swift_url: {get_param: swift_eca_url}
404 oam_gateway: {get_param: eca_oam_gateway }
407 type: OS::Neutron::Port
409 network: {get_param: oam_net_name}
410 fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}]
411 security_groups: [{get_param: security_group_name}]
412 replacement_policy: AUTO
415 type: OS::Neutron::Port
417 network: {get_param: eca_mgmt_net_name}
418 fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}]
419 security_groups: [{get_param: security_group_name}]
420 replacement_policy: AUTO
423 type: OS::Cinder::Volume
425 size: {get_param: arb_volume_size}
426 volume_type: {get_param: ARB_volume_type}
427 arb_volume_attachment:
428 type: OS::Cinder::VolumeAttachment
430 volume_id: {get_resource: arb_volume}
431 instance_uuid: {get_resource: arb_instance}