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: arbiter server names
25 description: the names of the arbiter VM instances
29 description: the OAM image name
33 description: OAM flavor name
37 description: arbiter flavor name
40 label: availabilityzone name
41 description: availabilityzone name
44 label: oam network name
45 description: the name of the oam network
48 label: internal network name
49 description: the name of the internal network
51 type: comma_delimited_list
52 label: oam network ips
53 description: the ips of oam networks for eca VM
56 label: oam1 oam gateway
57 description: the ip of oam gateway
59 type: comma_delimited_list
60 label: eca_mgmt network ips for eca VM
61 description: internal eca_mgmt network ips for eca VM
63 type: comma_delimited_list
64 label: oam network ips for arb VM
65 description: oam network ips for eca VM
67 type: comma_delimited_list
68 label: eca_mgmt network ips
69 description: internal eca_mgmt network ips for arb VM
72 label: security group name
73 description: the name of security group
77 description: the size of the OAM volume
81 description: the size of the ARB volume
85 description: Base URL for eca swift object store
88 label: eca oam vm volume type
89 description: the name of the target volume backend
92 label: arb vm volume type
93 description: the name of the target volume backend
97 type: OS::Nova::Server
99 name: {get_param: [eca_names, 0]}
100 image: {get_param: oam_image_name}
101 flavor: {get_param: oam_flavor}
102 availability_zone: {get_param: availability_zone_0}
104 - port: {get_resource: oam1_int_port}
105 - port: {get_resource: oam1_mgmt_port}
107 vnf_id: { get_param: vnf_id }
112 sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network
113 eth1_ip_address='oam1_mgt_ip'
114 eth1_gateway='oam_gateway'
115 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
116 if [ "$interface" != "lo" ]; then
117 DEVICE_NAME=$interface
118 interface_ip_var="${DEVICE_NAME}_ip_address"
119 gateway_var="${DEVICE_NAME}_gateway"
120 var_name="$interface_ip_var"
121 var_gateway="$gateway_var"
122 if [ ! -z ${!var_name} ]; then
125 GATEWAY=${!var_gateway}
126 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
127 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
128 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
129 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
130 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
131 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
133 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
134 echo "Configuring $DEVICE_NAME to use DHCP"
135 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
136 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
137 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
142 printf "$DEVICE_NAME\n" >> /tmp/network_config
145 mkdir /etc/puppet/files/roles/transcoder
146 mkdir /etc/puppet/files/roles/oam_primary
147 curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp
148 curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp
149 curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml
150 curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml
151 curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf
152 curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf
153 curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf
154 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
155 curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp
156 curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset
157 van-role oam_primary > /root/startup-van-role.out
158 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
159 fdisk /dev/vdb < /root/fdisk-keystrokes
160 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
161 chmod 755 /root/os-conf-cinder-vol
162 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
164 oam1_mgt_ip: {get_param: [eca_oam_ips, 0] }
165 oam_gateway: {get_param: eca_oam_gateway }
166 oam1_hostname: {get_param: [eca_names, 0]}
167 swift_url: {get_param: swift_eca_url}
170 type: OS::Neutron::Port
172 network: {get_param: oam_net_name}
173 fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
174 security_groups: [{get_param: security_group_name}]
175 replacement_policy: AUTO
178 type: OS::Neutron::Port
180 network: {get_param: eca_mgmt_net_name}
181 fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}]
182 security_groups: [{get_param: security_group_name}]
183 replacement_policy: AUTO
186 type: OS::Cinder::Volume
188 size: {get_param: oam_volume_size}
189 volume_type: {get_param: ECA_OAM_volume_type}
191 oam1_volume_attachment:
192 type: OS::Cinder::VolumeAttachment
194 volume_id: {get_resource: oam1_volume}
195 instance_uuid: {get_resource: oam1_instance}
198 type: OS::Nova::Server
200 name: {get_param: [eca_names, 1]}
201 image: {get_param: oam_image_name}
202 flavor: {get_param: oam_flavor}
203 availability_zone: {get_param: availability_zone_0}
205 - port: {get_resource: oam2_int_port}
206 - port: {get_resource: oam2_mgmt_port}
208 vnf_id: { get_param: vnf_id }
213 sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network
214 eth1_ip_address='oam2_mgt_ip'
215 eth1_gateway='oam_gateway'
216 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
217 if [ "$interface" != "lo" ]; then
218 DEVICE_NAME=$interface
219 interface_ip_var="${DEVICE_NAME}_ip_address"
220 gateway_var="${DEVICE_NAME}_gateway"
221 var_name="$interface_ip_var"
222 var_gateway="$gateway_var"
223 if [ ! -z ${!var_name} ]; then
226 GATEWAY=${!var_gateway}
227 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
228 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
229 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
230 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
231 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
232 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
234 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
235 echo "Configuring $DEVICE_NAME to use DHCP"
236 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
237 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
238 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
243 printf "$DEVICE_NAME\n" >> /tmp/network_config
246 curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp
247 curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
248 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
249 van-role oam_secondary > /root/startup-van-role.out
250 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
251 fdisk /dev/vdb < /root/fdisk-keystrokes
252 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
253 chmod 755 /root/os-conf-cinder-vol
254 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
257 oam2_mgt_ip: {get_param: [eca_oam_ips, 1] }
258 oam2_hostname: {get_param: [eca_names, 1]}
259 swift_url: {get_param: swift_eca_url}
260 oam_gateway: {get_param: eca_oam_gateway }
263 type: OS::Neutron::Port
265 network: {get_param: oam_net_name}
266 fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}]
267 security_groups: [{get_param: security_group_name}]
268 replacement_policy: AUTO
271 type: OS::Neutron::Port
273 network: {get_param: eca_mgmt_net_name}
274 fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}]
275 security_groups: [{get_param: security_group_name}]
276 replacement_policy: AUTO
279 type: OS::Cinder::Volume
281 size: {get_param: oam_volume_size}
282 volume_type: {get_param: ECA_OAM_volume_type}
284 oam2_volume_attachment:
285 type: OS::Cinder::VolumeAttachment
287 volume_id: {get_resource: oam2_volume}
288 instance_uuid: {get_resource: oam2_instance}
291 type: OS::Nova::Server
293 name: {get_param: [arb_names, 0]}
294 image: {get_param: oam_image_name}
295 flavor: {get_param: arbiter_flavor}
296 availability_zone: {get_param: availability_zone_0}
298 - port: {get_resource: arb_int_port}
299 - port: {get_resource: arb_mgmt_port}
301 vnf_id: { get_param: vnf_id }
306 sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network
307 eth1_ip_address='arb_mgt_ip'
308 eth1_gateway='oam_gateway'
309 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
310 if [ "$interface" != "lo" ]; then
311 DEVICE_NAME=$interface
312 interface_ip_var="${DEVICE_NAME}_ip_address"
313 gateway_var="${DEVICE_NAME}_gateway"
314 var_name="$interface_ip_var"
315 var_gateway="$gateway_var"
316 if [ ! -z ${!var_name} ]; then
319 GATEWAY=${!var_gateway}
320 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
321 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
322 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
323 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
324 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
325 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
327 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
328 echo "Configuring $DEVICE_NAME to use DHCP"
329 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
330 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
331 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
336 printf "$DEVICE_NAME\n" >> /tmp/network_config
339 curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp
340 curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
341 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
342 van-role oam_arbiter > /root/startup-van-role.out
343 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
344 fdisk /dev/vdb < /root/fdisk-keystrokes
345 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
346 chmod 755 /root/os-conf-cinder-vol
347 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
349 arb_mgt_ip: {get_param: [arb_oam_ips, 0] }
350 arb_hostname: {get_param: [arb_names, 0]}
351 swift_url: {get_param: swift_eca_url}
352 oam_gateway: {get_param: eca_oam_gateway }
355 type: OS::Neutron::Port
357 network: {get_param: oam_net_name}
358 fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}]
359 security_groups: [{get_param: security_group_name}]
360 replacement_policy: AUTO
363 type: OS::Neutron::Port
365 network: {get_param: eca_mgmt_net_name}
366 fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}]
367 security_groups: [{get_param: security_group_name}]
368 replacement_policy: AUTO
371 type: OS::Cinder::Volume
373 size: {get_param: arb_volume_size}
374 volume_type: {get_param: ARB_volume_type}
375 arb_volume_attachment:
376 type: OS::Cinder::VolumeAttachment
378 volume_id: {get_resource: arb_volume}
379 instance_uuid: {get_resource: arb_instance}