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: 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: oam network gateway
73 description: oam network gateway
76 label: security group name
77 description: the name of security group
81 description: the size of the OAM volume
85 description: the size of the ARB volume
89 description: Base URL for eca swift object store
92 label: eca oam vm volume type
93 description: the name of the target volume backend
96 label: arb vm volume type
97 description: the name of the target volume backend
101 type: OS::Nova::Server
103 name: {get_param: [eca_names, 0]}
104 image: {get_param: oam_image_name}
105 flavor: {get_param: oam_flavor}
106 availability_zone: {get_param: availability_zone_0}
108 - port: {get_resource: oam1_int_port}
109 - port: {get_resource: oam1_mgmt_port}
111 vnf_id: { get_param: vnf_id }
116 sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network
117 eth1_ip_address='oam1_mgt_ip'
118 eth1_gateway='oam_gateway'
119 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
120 if [ "$interface" != "lo" ]; then
121 DEVICE_NAME=$interface
122 interface_ip_var="${DEVICE_NAME}_ip_address"
123 gateway_var="${DEVICE_NAME}_gateway"
124 var_name="$interface_ip_var"
125 var_gateway="$gateway_var"
126 if [ ! -z ${!var_name} ]; then
129 GATEWAY=${!var_gateway}
130 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
131 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
132 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
133 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
134 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
135 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
137 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
138 echo "Configuring $DEVICE_NAME to use DHCP"
139 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
140 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
141 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
146 printf "$DEVICE_NAME\n" >> /tmp/network_config
149 mkdir /etc/puppet/files/roles/transcoder
150 mkdir /etc/puppet/files/roles/oam_primary
151 curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp
152 curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp
153 curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml
154 curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml
155 curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf
156 curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf
157 curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf
158 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
159 curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp
160 curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset
161 van-role oam_primary > /root/startup-van-role.out
162 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
163 fdisk /dev/vdb < /root/fdisk-keystrokes
164 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
165 chmod 755 /root/os-conf-cinder-vol
166 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
168 oam1_mgt_ip: {get_param: [eca_oam_ips, 0] }
169 oam_gateway: {get_param: eca_oam_gateway }
170 oam1_hostname: {get_param: [eca_names, 0]}
171 swift_url: {get_param: swift_eca_url}
174 type: OS::Neutron::Port
176 network: {get_param: oam_net_name}
177 fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
178 security_groups: [{get_param: security_group_name}]
179 replacement_policy: AUTO
182 type: OS::Neutron::Port
184 network: {get_param: eca_mgmt_net_name}
185 fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}]
186 security_groups: [{get_param: security_group_name}]
187 replacement_policy: AUTO
190 type: OS::Cinder::Volume
192 size: {get_param: oam_volume_size}
193 volume_type: {get_param: ECA_OAM_volume_type}
195 oam1_volume_attachment:
196 type: OS::Cinder::VolumeAttachment
198 volume_id: {get_resource: oam1_volume}
199 instance_uuid: {get_resource: oam1_instance}
202 type: OS::Nova::Server
204 name: {get_param: [eca_names, 1]}
205 image: {get_param: oam_image_name}
206 flavor: {get_param: oam_flavor}
207 availability_zone: {get_param: availability_zone_0}
209 - port: {get_resource: oam2_int_port}
210 - port: {get_resource: oam2_mgmt_port}
212 vnf_id: { get_param: vnf_id }
217 sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network
218 eth1_ip_address='oam2_mgt_ip'
219 eth1_gateway='oam_gateway'
220 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
221 if [ "$interface" != "lo" ]; then
222 DEVICE_NAME=$interface
223 interface_ip_var="${DEVICE_NAME}_ip_address"
224 gateway_var="${DEVICE_NAME}_gateway"
225 var_name="$interface_ip_var"
226 var_gateway="$gateway_var"
227 if [ ! -z ${!var_name} ]; then
230 GATEWAY=${!var_gateway}
231 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
232 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
233 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
234 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
235 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
236 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
238 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
239 echo "Configuring $DEVICE_NAME to use DHCP"
240 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
241 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
242 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
247 printf "$DEVICE_NAME\n" >> /tmp/network_config
250 curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp
251 curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
252 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
253 van-role oam_secondary > /root/startup-van-role.out
254 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
255 fdisk /dev/vdb < /root/fdisk-keystrokes
256 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
257 chmod 755 /root/os-conf-cinder-vol
258 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
261 oam2_mgt_ip: {get_param: [eca_oam_ips, 1] }
262 oam2_hostname: {get_param: [eca_names, 1]}
263 swift_url: {get_param: swift_eca_url}
264 oam_gateway: {get_param: eca_oam_gateway }
267 type: OS::Neutron::Port
269 network: {get_param: oam_net_name}
270 fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}]
271 security_groups: [{get_param: security_group_name}]
272 replacement_policy: AUTO
275 type: OS::Neutron::Port
277 network: {get_param: eca_mgmt_net_name}
278 fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}]
279 security_groups: [{get_param: security_group_name}]
280 replacement_policy: AUTO
283 type: OS::Cinder::Volume
285 size: {get_param: oam_volume_size}
286 volume_type: {get_param: ECA_OAM_volume_type}
288 oam2_volume_attachment:
289 type: OS::Cinder::VolumeAttachment
291 volume_id: {get_resource: oam2_volume}
292 instance_uuid: {get_resource: oam2_instance}
295 type: OS::Nova::Server
297 name: {get_param: [arb_names, 0]}
298 image: {get_param: oam_image_name}
299 flavor: {get_param: arbiter_flavor}
300 availability_zone: {get_param: availability_zone_0}
302 - port: {get_resource: arb_int_port}
303 - port: {get_resource: arb_mgmt_port}
305 vnf_id: { get_param: vnf_id }
310 sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network
311 eth1_ip_address='arb_mgt_ip'
312 eth1_gateway='oam_gateway'
313 for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
314 if [ "$interface" != "lo" ]; then
315 DEVICE_NAME=$interface
316 interface_ip_var="${DEVICE_NAME}_ip_address"
317 gateway_var="${DEVICE_NAME}_gateway"
318 var_name="$interface_ip_var"
319 var_gateway="$gateway_var"
320 if [ ! -z ${!var_name} ]; then
323 GATEWAY=${!var_gateway}
324 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
325 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
326 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
327 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
328 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
329 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
331 if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
332 echo "Configuring $DEVICE_NAME to use DHCP"
333 IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
334 IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
335 printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
340 printf "$DEVICE_NAME\n" >> /tmp/network_config
343 curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp
344 curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
345 curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
346 van-role oam_arbiter > /root/startup-van-role.out
347 curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes
348 fdisk /dev/vdb < /root/fdisk-keystrokes
349 curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
350 chmod 755 /root/os-conf-cinder-vol
351 /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
353 arb_mgt_ip: {get_param: [arb_oam_ips, 0] }
354 arb_hostname: {get_param: [arb_names, 0]}
355 swift_url: {get_param: swift_eca_url}
356 oam_gateway: {get_param: eca_oam_gateway }
359 type: OS::Neutron::Port
361 network: {get_param: oam_net_name}
362 fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}]
363 security_groups: [{get_param: security_group_name}]
364 replacement_policy: AUTO
367 type: OS::Neutron::Port
369 network: {get_param: eca_mgmt_net_name}
370 fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}]
371 security_groups: [{get_param: security_group_name}]
372 replacement_policy: AUTO
375 type: OS::Cinder::Volume
377 size: {get_param: arb_volume_size}
378 volume_type: {get_param: ARB_volume_type}
379 arb_volume_attachment:
380 type: OS::Cinder::VolumeAttachment
382 volume_id: {get_resource: arb_volume}
383 instance_uuid: {get_resource: arb_instance}