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
22 type: comma_delimited_list
23 label: oam servers names
24 description: the names of the OAM1,OAM2 VM instances
27 label: internal network name
28 description: the name of the internal network
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
46 type: comma_delimited_list
47 label: oam servers names
48 description: the names of the OAM1,OAM2 VM instances
50 type: comma_delimited_list
51 label: arbiter server names
52 description: the names of the arbiter VM instances
56 description: the OAM image name
60 description: OAM flavor name
64 description: arbiter flavor name
67 label: availabilityzone name
68 description: availabilityzone name
71 label: oam network name
72 description: the name of the oam network
75 label: internal network name
76 description: the name of the internal network
78 type: comma_delimited_list
79 label: oam network ips
80 description: the ips of oam networks for eca VM
82 type: comma_delimited_list
83 label: eca_mgmt network ips for eca VM
84 description: internal eca_mgmt network ips for eca VM
86 type: comma_delimited_list
87 label: oam network ips for arb VM
88 description: oam network ips for eca VM
90 type: comma_delimited_list
91 label: eca_mgmt network ips
92 description: internal eca_mgmt network ips for arb VM
95 label: oam network gateway
96 description: oam network gateway
99 label: security group name
100 description: the name of security group
104 description: the size of the OAM volume
108 description: the size of the ARB volume
112 description: Base URL for eca swift object store
115 label: eca oam vm volume type
116 description: the name of the target volume backend
119 label: arb vm volume type
120 description: the name of the target volume backend
124 type: OS::Nova::Server
126 name: {get_param: [eca_names, 0]}
127 image: {get_param: oam_image_name}
128 flavor: {get_param: oam_flavor}
129 availability_zone: {get_param: availability_zone_0}
131 - port: {get_resource: oam1_int_port}
132 - port: {get_resource: oam1_mgmt_port}
134 vnf_id: { get_param: vnf_id }
139 sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network
140 eth1_ip_address='oam1_mgt_ip'
141 eth1_gateway='oam_gateway'
142 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
143 if [ "$interface" != "lo" ]; then
144 DEVICE_NAME=$interface
145 interface_ip_var="${DEVICE_NAME}_ip_address"
146 gateway_var="${DEVICE_NAME}_gateway"
147 var_name="$interface_ip_var"
148 var_gateway="$gateway_var"
149 if [ ! -z ${!var_name} ]; then
152 GATEWAY=${!var_gateway}
153 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
154 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
155 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
156 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
157 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
158 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
160 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
161 echo "Configuring $DEVICE_NAME to use DHCP"
162 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
163 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
164 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
169 printf "$DEVICE_NAME\n" >> /tmp/network_config
172 mkdir /etc/puppet/files/roles/transcoder
173 mkdir /etc/puppet/files/roles/oam_primary
174 curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp
175 curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp
176 curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml
177 curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml
178 curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf
179 curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf
180 curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf
181 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
182 curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp
183 curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset
184 van-role oam_primary > /root/startup-van-role.out
185 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
186 fdisk /dev/vdb < /root/fdisk-keystrokes
187 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
188 chmod 755 /root/os-conf-cinder-vol
189 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
191 oam1_mgt_ip: {get_param: [eca_oam_ips, 0] }
192 oam_gateway: {get_param: eca_oam_gateway }
193 oam1_hostname: {get_param: [eca_names, 0]}
194 swift_url: {get_param: swift_eca_url}
197 type: OS::Neutron::Port
199 network: {get_param: oam_net_name}
200 fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
201 security_groups: [{get_param: security_group_name}]
202 replacement_policy: AUTO
205 type: OS::Neutron::Port
207 network: {get_param: eca_mgmt_net_name}
208 fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}]
209 security_groups: [{get_param: security_group_name}]
210 replacement_policy: AUTO
213 type: OS::Cinder::Volume
215 size: {get_param: oam_volume_size}
216 volume_type: {get_param: ECA_OAM_volume_type}
218 oam1_volume_attachment:
219 type: OS::Cinder::VolumeAttachment
221 volume_id: {get_resource: oam1_volume}
222 instance_uuid: {get_resource: oam1_instance}
225 type: OS::Nova::Server
227 name: {get_param: [eca_names, 1]}
228 image: {get_param: oam_image_name}
229 flavor: {get_param: oam_flavor}
230 availability_zone: {get_param: availability_zone_0}
232 - port: {get_resource: oam2_int_port}
233 - port: {get_resource: oam2_mgmt_port}
235 vnf_id: { get_param: vnf_id }
240 sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network
241 eth1_ip_address='oam2_mgt_ip'
242 eth1_gateway='oam_gateway'
243 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
244 if [ "$interface" != "lo" ]; then
245 DEVICE_NAME=$interface
246 interface_ip_var="${DEVICE_NAME}_ip_address"
247 gateway_var="${DEVICE_NAME}_gateway"
248 var_name="$interface_ip_var"
249 var_gateway="$gateway_var"
250 if [ ! -z ${!var_name} ]; then
253 GATEWAY=${!var_gateway}
254 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
255 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
256 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
257 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
258 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
259 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
261 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
262 echo "Configuring $DEVICE_NAME to use DHCP"
263 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
264 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
265 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
270 printf "$DEVICE_NAME\n" >> /tmp/network_config
273 curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp
274 curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
275 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
276 van-role oam_secondary > /root/startup-van-role.out
277 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
278 fdisk /dev/vdb < /root/fdisk-keystrokes
279 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
280 chmod 755 /root/os-conf-cinder-vol
281 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
284 oam2_mgt_ip: {get_param: [eca_oam_ips, 1] }
285 oam2_hostname: {get_param: [eca_names, 1]}
286 swift_url: {get_param: swift_eca_url}
287 oam_gateway: {get_param: eca_oam_gateway }
290 type: OS::Neutron::Port
292 network: {get_param: oam_net_name}
293 fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}]
294 security_groups: [{get_param: security_group_name}]
295 replacement_policy: AUTO
298 type: OS::Neutron::Port
300 network: {get_param: eca_mgmt_net_name}
301 fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}]
302 security_groups: [{get_param: security_group_name}]
303 replacement_policy: AUTO
306 type: OS::Cinder::Volume
308 size: {get_param: oam_volume_size}
309 volume_type: {get_param: ECA_OAM_volume_type}
311 oam2_volume_attachment:
312 type: OS::Cinder::VolumeAttachment
314 volume_id: {get_resource: oam2_volume}
315 instance_uuid: {get_resource: oam2_instance}
318 type: OS::Nova::Server
320 name: {get_param: [arb_names, 0]}
321 image: {get_param: oam_image_name}
322 flavor: {get_param: arbiter_flavor}
323 availability_zone: {get_param: availability_zone_0}
325 - port: {get_resource: arb_int_port}
326 - port: {get_resource: arb_mgmt_port}
328 vnf_id: { get_param: vnf_id }
333 sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network
334 eth1_ip_address='arb_mgt_ip'
335 eth1_gateway='oam_gateway'
336 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
337 if [ "$interface" != "lo" ]; then
338 DEVICE_NAME=$interface
339 interface_ip_var="${DEVICE_NAME}_ip_address"
340 gateway_var="${DEVICE_NAME}_gateway"
341 var_name="$interface_ip_var"
342 var_gateway="$gateway_var"
343 if [ ! -z ${!var_name} ]; then
346 GATEWAY=${!var_gateway}
347 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
348 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
349 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
350 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
351 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
352 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
354 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
355 echo "Configuring $DEVICE_NAME to use DHCP"
356 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
357 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
358 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
363 printf "$DEVICE_NAME\n" >> /tmp/network_config
366 curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp
367 curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
368 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
369 van-role oam_arbiter > /root/startup-van-role.out
370 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
371 fdisk /dev/vdb < /root/fdisk-keystrokes
372 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
373 chmod 755 /root/os-conf-cinder-vol
374 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
376 arb_mgt_ip: {get_param: [arb_oam_ips, 0] }
377 arb_hostname: {get_param: [arb_names, 0]}
378 swift_url: {get_param: swift_eca_url}
379 oam_gateway: {get_param: eca_oam_gateway }
382 type: OS::Neutron::Port
384 network: {get_param: oam_net_name}
385 fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}]
386 security_groups: [{get_param: security_group_name}]
387 replacement_policy: AUTO
390 type: OS::Neutron::Port
392 network: {get_param: eca_mgmt_net_name}
393 fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}]
394 security_groups: [{get_param: security_group_name}]
395 replacement_policy: AUTO
398 type: OS::Cinder::Volume
400 size: {get_param: arb_volume_size}
401 volume_type: {get_param: ARB_volume_type}
402 arb_volume_attachment:
403 type: OS::Cinder::VolumeAttachment
405 volume_id: {get_resource: arb_volume}
406 instance_uuid: {get_resource: arb_instance}