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
21 description: cmaui name
25 description: cmaui image
29 description: cmaui flavor name
33 description: cmaui network name
37 description: cmaui metadata
41 description: cmaui user data
45 description: cmaui user data
47 type: comma_delimited_list
48 label: oam servers names
49 description: the names of the OAM1,OAM2 VM instances
51 type: comma_delimited_list
52 label: arbiter server names
53 description: the names of the arbiter VM instances
57 description: the OAM image name
61 description: OAM flavor name
65 description: arbiter flavor name
68 label: availabilityzone name
69 description: availabilityzone name
72 label: oam network name
73 description: the name of the oam network
76 label: internal network name
77 description: the name of the internal network
79 type: comma_delimited_list
80 label: oam network ips
81 description: the ips of oam networks for eca VM
84 label: oam1 oam gateway
85 description: the ip of oam gateway
87 type: comma_delimited_list
88 label: eca_mgmt network ips for eca VM
89 description: internal eca_mgmt network ips for eca VM
91 type: comma_delimited_list
92 label: oam network ips for arb VM
93 description: oam network ips for eca VM
95 type: comma_delimited_list
96 label: eca_mgmt network ips
97 description: internal eca_mgmt network ips for arb VM
100 label: security group name
101 description: the name of security group
105 description: the size of the OAM volume
109 description: the size of the ARB volume
113 description: Base URL for eca swift object store
116 label: eca oam vm volume type
117 description: the name of the target volume backend
120 label: arb vm volume type
121 description: the name of the target volume backend
125 type: OS::Nova::Server
127 name: {get_param: [eca_names, 0]}
128 image: {get_param: oam_image_name}
129 flavor: {get_param: oam_flavor}
130 availability_zone: {get_param: availability_zone_0}
132 - port: {get_resource: oam1_int_port}
133 - port: {get_resource: oam1_mgmt_port}
135 vnf_id: { get_param: vnf_id }
140 sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network
141 eth1_ip_address='oam1_mgt_ip'
142 eth1_gateway='oam_gateway'
143 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
144 if [ "$interface" != "lo" ]; then
145 DEVICE_NAME=$interface
146 interface_ip_var="${DEVICE_NAME}_ip_address"
147 gateway_var="${DEVICE_NAME}_gateway"
148 var_name="$interface_ip_var"
149 var_gateway="$gateway_var"
150 if [ ! -z ${!var_name} ]; then
153 GATEWAY=${!var_gateway}
154 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
155 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
156 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
157 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
158 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
159 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
161 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
162 echo "Configuring $DEVICE_NAME to use DHCP"
163 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
164 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
165 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
170 printf "$DEVICE_NAME\n" >> /tmp/network_config
173 mkdir /etc/puppet/files/roles/transcoder
174 mkdir /etc/puppet/files/roles/oam_primary
175 curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp
176 curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp
177 curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml
178 curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml
179 curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf
180 curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf
181 curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf
182 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
183 curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp
184 curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset
185 van-role oam_primary > /root/startup-van-role.out
186 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
187 fdisk /dev/vdb < /root/fdisk-keystrokes
188 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
189 chmod 755 /root/os-conf-cinder-vol
190 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
192 oam1_mgt_ip: {get_param: [eca_oam_ips, 0] }
193 oam_gateway: {get_param: eca_oam_gateway }
194 oam1_hostname: {get_param: [eca_names, 0]}
195 swift_url: {get_param: swift_eca_url}
198 type: OS::Neutron::Port
200 network: {get_param: oam_net_name}
201 fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
202 security_groups: [{get_param: security_group_name}]
203 replacement_policy: AUTO
206 type: OS::Neutron::Port
208 network: {get_param: eca_mgmt_net_name}
209 fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}]
210 security_groups: [{get_param: security_group_name}]
211 replacement_policy: AUTO
214 type: OS::Cinder::Volume
216 size: {get_param: oam_volume_size}
217 volume_type: {get_param: ECA_OAM_volume_type}
219 oam1_volume_attachment:
220 type: OS::Cinder::VolumeAttachment
222 volume_id: {get_resource: oam1_volume}
223 instance_uuid: {get_resource: oam1_instance}
226 type: OS::Nova::Server
228 name: {get_param: [eca_names, 1]}
229 image: {get_param: oam_image_name}
230 flavor: {get_param: oam_flavor}
231 availability_zone: {get_param: availability_zone_0}
233 - port: {get_resource: oam2_int_port}
234 - port: {get_resource: oam2_mgmt_port}
236 vnf_id: { get_param: vnf_id }
241 sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network
242 eth1_ip_address='oam2_mgt_ip'
243 eth1_gateway='oam_gateway'
244 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
245 if [ "$interface" != "lo" ]; then
246 DEVICE_NAME=$interface
247 interface_ip_var="${DEVICE_NAME}_ip_address"
248 gateway_var="${DEVICE_NAME}_gateway"
249 var_name="$interface_ip_var"
250 var_gateway="$gateway_var"
251 if [ ! -z ${!var_name} ]; then
254 GATEWAY=${!var_gateway}
255 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
256 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
257 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
258 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
259 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
260 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
262 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
263 echo "Configuring $DEVICE_NAME to use DHCP"
264 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
265 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
266 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
271 printf "$DEVICE_NAME\n" >> /tmp/network_config
274 curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp
275 curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
276 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
277 van-role oam_secondary > /root/startup-van-role.out
278 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
279 fdisk /dev/vdb < /root/fdisk-keystrokes
280 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
281 chmod 755 /root/os-conf-cinder-vol
282 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
285 oam2_mgt_ip: {get_param: [eca_oam_ips, 1] }
286 oam2_hostname: {get_param: [eca_names, 1]}
287 swift_url: {get_param: swift_eca_url}
288 oam_gateway: {get_param: eca_oam_gateway }
291 type: OS::Neutron::Port
293 network: {get_param: oam_net_name}
294 fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}]
295 security_groups: [{get_param: security_group_name}]
296 replacement_policy: AUTO
299 type: OS::Neutron::Port
301 network: {get_param: eca_mgmt_net_name}
302 fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}]
303 security_groups: [{get_param: security_group_name}]
304 replacement_policy: AUTO
307 type: OS::Cinder::Volume
309 size: {get_param: oam_volume_size}
310 volume_type: {get_param: ECA_OAM_volume_type}
312 oam2_volume_attachment:
313 type: OS::Cinder::VolumeAttachment
315 volume_id: {get_resource: oam2_volume}
316 instance_uuid: {get_resource: oam2_instance}
319 type: OS::Nova::Server
321 name: {get_param: [arb_names, 0]}
322 image: {get_param: oam_image_name}
323 flavor: {get_param: arbiter_flavor}
324 availability_zone: {get_param: availability_zone_0}
326 - port: {get_resource: arb_int_port}
327 - port: {get_resource: arb_mgmt_port}
329 vnf_id: { get_param: vnf_id }
334 sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network
335 eth1_ip_address='arb_mgt_ip'
336 eth1_gateway='oam_gateway'
337 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
338 if [ "$interface" != "lo" ]; then
339 DEVICE_NAME=$interface
340 interface_ip_var="${DEVICE_NAME}_ip_address"
341 gateway_var="${DEVICE_NAME}_gateway"
342 var_name="$interface_ip_var"
343 var_gateway="$gateway_var"
344 if [ ! -z ${!var_name} ]; then
347 GATEWAY=${!var_gateway}
348 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
349 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
350 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
351 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
352 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
353 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
355 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
356 echo "Configuring $DEVICE_NAME to use DHCP"
357 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
358 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
359 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
364 printf "$DEVICE_NAME\n" >> /tmp/network_config
367 curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp
368 curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
369 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
370 van-role oam_arbiter > /root/startup-van-role.out
371 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
372 fdisk /dev/vdb < /root/fdisk-keystrokes
373 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
374 chmod 755 /root/os-conf-cinder-vol
375 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
377 arb_mgt_ip: {get_param: [arb_oam_ips, 0] }
378 arb_hostname: {get_param: [arb_names, 0]}
379 swift_url: {get_param: swift_eca_url}
380 oam_gateway: {get_param: eca_oam_gateway }
383 type: OS::Neutron::Port
385 network: {get_param: oam_net_name}
386 fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}]
387 security_groups: [{get_param: security_group_name}]
388 replacement_policy: AUTO
391 type: OS::Neutron::Port
393 network: {get_param: eca_mgmt_net_name}
394 fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}]
395 security_groups: [{get_param: security_group_name}]
396 replacement_policy: AUTO
399 type: OS::Cinder::Volume
401 size: {get_param: arb_volume_size}
402 volume_type: {get_param: ARB_volume_type}
403 arb_volume_attachment:
404 type: OS::Cinder::VolumeAttachment
406 volume_id: {get_resource: arb_volume}
407 instance_uuid: {get_resource: arb_instance}