aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam.yaml
blob: 7bca8d40e770143d106c41b7648c3251065120fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
heat_template_version: 2013-05-23

##########################################################
#
#  Changes from MSO 
#  - Updated per OPENECOMP Feedback
#  
#
##########################################################

description: This stack creates two ECA OAM VM and one ARB VM

parameters:
  vnf_id:
    type: string
    description: Unique ID for this VNF instance
    default: This_is_ths_MMSC-ECA_id
  eca_names:
    type: comma_delimited_list
    label: oam servers names
    description: the names of the OAM1,OAM2 VM instances
  cmaui_name:
    type: comma_delimited_list
    label: oam servers names
  cmaui_image:
    type: comma_delimited_list
    label: oam servers names
    description: the names of the OAM1,OAM2 VM instances
  networks:
    type: string
    label: internal network name
    description: the name of the internal network
  flavor:
    type: string
    label: internal network name
    description: the name of the internal network
  metadata:
    type: string
    label: internal network name
    description: the name of the internal network
  user_data:
    type: string
    label: internal network name
    description: the name of the internal network
  user_data_format:
    type: string
    label: internal network name
    description: the name of the internal network
  cmaui_names:
    type: comma_delimited_list
    label: oam servers names
    description: the names of the OAM1,OAM2 VM instances
  cmaui_flavor:
    type: comma_delimited_list
    label: oam servers names
    description: the names of the OAM1,OAM2 VM instances
  arb_names:
    type: comma_delimited_list
    label: arbiter server names
    description: the names of the arbiter VM instances
  oam_image_name:
    type: string
    label: image name
    description: the OAM image name
  oam_flavor:
    type: string
    label: flavor name
    description: OAM flavor name
  arbiter_flavor:
    type: string
    label: flavor name
    description: arbiter flavor name
  availability_zone_0:
    type: string
    label: availabilityzone name
    description: availabilityzone name
  oam_net_name:
    type: string
    label: oam network name
    description: the name of the oam network
  eca_mgmt_net_name:
    type: string
    label: internal network name
    description: the name of the internal network
  eca_oam_ips:
    type: comma_delimited_list
    label: oam network ips
    description: the ips of oam networks for eca VM
  eca_eca_mgmt_ips:
    type: comma_delimited_list
    label: eca_mgmt network ips for eca VM
    description: internal eca_mgmt network ips for eca VM
  arb_oam_ips:
    type: comma_delimited_list
    label: oam network ips for arb VM
    description: oam network ips for eca VM
  arb_eca_mgmt_ips:
    type: comma_delimited_list
    label: eca_mgmt network ips 
    description:  internal eca_mgmt network ips for arb VM
  eca_oam_gateway:
    type: string
    label: oam network gateway
    description: oam network gateway
  security_group_name:
    type: string
    label: security group name
    description: the name of security group
  oam_volume_size:
    type: number
    label: volume size
    description: the size of the OAM volume
  arb_volume_size:
    type: number
    label: volume size
    description: the size of the ARB volume
  swift_eca_url:
    type: string
    label: Swift URL
    description: Base URL for eca swift object store
  ECA_OAM_volume_type:
    type: string
    label: eca oam vm volume type
    description: the name of the target volume backend
  ARB_volume_type:
    type: string
    label: arb vm volume type
    description: the name of the target volume backend

resources:
  server_cmaui_nested:
    type: eca_oam_nested.yaml
    properties:
      cmaui_name: { get_param: [cmaui_names, 0]}
      cmaui_image: { get_param: cmaui_image }
      availability_zone_0: { get_param: availability_zone_0 }
      flavor: { get_param: cmaui_flavor }
      networks:
      - port: { get_resource: cmaui_port_0 }
      metadata:
        vnf_id: { get_param: vnf_id }
      user_data:
        str_replace:
          template: |
            cmaui.mgmt.ip=${cmaui.mgmt.ip}
            cmaui.mgmt.netmask=${cmaui.mgmt.netmask}
            cmaui.mgmt.gateway=${cmaui.mgmt.gateway}
            cmaui.external.dns=${cmaui.external.dns}
            cmaui.external.ntp=${cmaui.external.ntp}
            cmaui.node=${cmaui.node}
            cmaui.timezone=${cmaui.timezone}
          params:
            ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} 
            ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask}
            ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway}
            ${cmaui.external.dns}: {get_param: external_dns}
            ${cmaui.external.ntp}: {get_param: external_ntp}
            ${cmaui.node}: {get_param: [cmaui_names, 0]} 
            ${cmaui.timezone}: {get_param: timezone}
      user_data_format: RAW 

  oam1_instance:
    type: OS::Nova::Server
    properties:
      name: {get_param: [eca_names, 0]}
      image: {get_param: oam_image_name}
      flavor: {get_param: oam_flavor}
      availability_zone: {get_param: availability_zone_0}
      networks:
        - port: {get_resource: oam1_int_port}
        - port: {get_resource: oam1_mgmt_port}
      metadata:
        vnf_id: { get_param: vnf_id }  
      user_data:
        str_replace:
          template: |
            #!/bin/bash
            sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network
            eth1_ip_address='oam1_mgt_ip'
            eth1_gateway='oam_gateway'
            for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
              if [ "$interface" != "lo" ]; then
                DEVICE_NAME=$interface
                interface_ip_var="${DEVICE_NAME}_ip_address"
                gateway_var="${DEVICE_NAME}_gateway"
                var_name="$interface_ip_var"
                var_gateway="$gateway_var"
                if [ ! -z ${!var_name} ]; then
                  IPADDR=${!var_name}
                  BOOTPROTO="static"
                  GATEWAY=${!var_gateway}
                  IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
                  IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
                  IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
                  IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
                  IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
                  printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
                else
                  if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
                    echo "Configuring $DEVICE_NAME to use DHCP"
                    IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
                    IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
                    printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
                  fi
                fi
                ifdown $DEVICE_NAME
                ifup $DEVICE_NAME
                printf "$DEVICE_NAME\n" >> /tmp/network_config
              fi
            done
            mkdir /etc/puppet/files/roles/transcoder
            mkdir /etc/puppet/files/roles/oam_primary
            curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp
            curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp
            curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml
            curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml
            curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf
            curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf
            curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf
            curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
            curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp
            curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset
            van-role oam_primary > /root/startup-van-role.out
            curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes 
            fdisk /dev/vdb < /root/fdisk-keystrokes 
            curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
            chmod 755 /root/os-conf-cinder-vol
            /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
          params:
            oam1_mgt_ip: {get_param: [eca_oam_ips, 0] }
            oam_gateway: {get_param: eca_oam_gateway }
            oam1_hostname: {get_param: [eca_names, 0]}
            swift_url: {get_param: swift_eca_url}

  oam1_mgmt_port:
    type: OS::Neutron::Port
    properties:
      network: {get_param: oam_net_name}
      fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
      security_groups: [{get_param: security_group_name}]
      replacement_policy: AUTO

  cmaui_port_0:
    type: OS::Neutron::Port
    properties:
      network: {get_param: oam_net_name}
      fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}]
      security_groups: [{get_param: security_group_name}]
      replacement_policy: AUTO

  oam1_int_port:
    type: OS::Neutron::Port
    properties:
      network: {get_param: eca_mgmt_net_name}
      fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}]
      security_groups: [{get_param: security_group_name}]
      replacement_policy: AUTO

  oam1_volume:
    type: OS::Cinder::Volume
    properties:
      size: {get_param: oam_volume_size}
      volume_type: {get_param: ECA_OAM_volume_type}

  oam1_volume_attachment:
    type: OS::Cinder::VolumeAttachment
    properties:
      volume_id: {get_resource: oam1_volume}
      instance_uuid: {get_resource: oam1_instance}

  oam2_instance:
    type: OS::Nova::Server
    properties:
      name: {get_param: [eca_names, 1]}
      image: {get_param: oam_image_name}
      flavor: {get_param: oam_flavor}
      availability_zone: {get_param: availability_zone_0}
      networks:
        - port: {get_resource: oam2_int_port}
        - port: {get_resource: oam2_mgmt_port}
      metadata:
        vnf_id: { get_param: vnf_id }
      user_data:
        str_replace:
          template: |
            #!/bin/bash
            sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network
            eth1_ip_address='oam2_mgt_ip'
            eth1_gateway='oam_gateway'
            for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
              if [ "$interface" != "lo" ]; then
                DEVICE_NAME=$interface
                interface_ip_var="${DEVICE_NAME}_ip_address"
                gateway_var="${DEVICE_NAME}_gateway"
                var_name="$interface_ip_var"
                var_gateway="$gateway_var"
                if [ ! -z ${!var_name} ]; then
                  IPADDR=${!var_name}
                  BOOTPROTO="static"
                  GATEWAY=${!var_gateway}
                  IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
                  IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
                  IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
                  IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
                  IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
                  printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
                else
                  if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
                    echo "Configuring $DEVICE_NAME to use DHCP"
                    IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
                    IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
                    printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
                  fi
                fi
                ifdown $DEVICE_NAME
                ifup $DEVICE_NAME
                printf "$DEVICE_NAME\n" >> /tmp/network_config
              fi
            done
            curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp
            curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
            curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
            van-role oam_secondary > /root/startup-van-role.out
            curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes 
            fdisk /dev/vdb < /root/fdisk-keystrokes 
            curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
            chmod 755 /root/os-conf-cinder-vol
            /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
            
          params:
            oam2_mgt_ip: {get_param: [eca_oam_ips, 1] }
            oam2_hostname: {get_param: [eca_names, 1]}
            swift_url: {get_param: swift_eca_url}
            oam_gateway: {get_param: eca_oam_gateway }

  oam2_mgmt_port:
    type: OS::Neutron::Port
    properties:
      network: {get_param: oam_net_name}
      fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}]
      security_groups: [{get_param: security_group_name}]
      replacement_policy: AUTO

  oam2_int_port:
    type: OS::Neutron::Port
    properties:
      network: {get_param: eca_mgmt_net_name}
      fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}]
      security_groups: [{get_param: security_group_name}]
      replacement_policy: AUTO

  oam2_volume:
    type: OS::Cinder::Volume
    properties:
      size: {get_param: oam_volume_size}
      volume_type: {get_param: ECA_OAM_volume_type}

  oam2_volume_attachment:
    type: OS::Cinder::VolumeAttachment
    properties:
      volume_id: {get_resource: oam2_volume}
      instance_uuid: {get_resource: oam2_instance}

  arb_instance:
    type: OS::Nova::Server
    properties:
      name: {get_param: [arb_names, 0]}
      image: {get_param: oam_image_name}
      flavor: {get_param: arbiter_flavor}
      availability_zone: {get_param: availability_zone_0}
      networks:
        - port: {get_resource: arb_int_port}
        - port: {get_resource: arb_mgmt_port}
      metadata:
        vnf_id: { get_param: vnf_id }
      user_data:
        str_replace:
          template: |
            #!/bin/bash
            sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network
            eth1_ip_address='arb_mgt_ip'
            eth1_gateway='oam_gateway'
            for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do
              if [ "$interface" != "lo" ]; then
                DEVICE_NAME=$interface
                interface_ip_var="${DEVICE_NAME}_ip_address"
                gateway_var="${DEVICE_NAME}_gateway"
                var_name="$interface_ip_var"
                var_gateway="$gateway_var"
                if [ ! -z ${!var_name} ]; then
                  IPADDR=${!var_name}
                  BOOTPROTO="static"
                  GATEWAY=${!var_gateway}
                  IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no"
                  IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO"
                  IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR"
                  IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0"
                  IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY"
                  printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
                else
                  if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then
                    echo "Configuring $DEVICE_NAME to use DHCP"
                    IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes"
                    IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no"
                    printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME
                  fi
                fi
                ifdown $DEVICE_NAME
                ifup $DEVICE_NAME
                printf "$DEVICE_NAME\n" >> /tmp/network_config
              fi
            done
            curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp
            curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml
            curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf
            van-role oam_arbiter > /root/startup-van-role.out
            curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes 
            fdisk /dev/vdb < /root/fdisk-keystrokes 
            curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol
            chmod 755 /root/os-conf-cinder-vol
            /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log
          params:
            arb_mgt_ip: {get_param: [arb_oam_ips, 0] }
            arb_hostname: {get_param: [arb_names, 0]}
            swift_url: {get_param: swift_eca_url}
            oam_gateway: {get_param: eca_oam_gateway }

  arb_mgmt_port:
    type: OS::Neutron::Port
    properties:
      network: {get_param: oam_net_name}
      fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}]
      security_groups: [{get_param: security_group_name}]
      replacement_policy: AUTO

  arb_int_port:
    type: OS::Neutron::Port
    properties:
      network: {get_param: eca_mgmt_net_name}
      fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}]
      security_groups: [{get_param: security_group_name}]
      replacement_policy: AUTO

  arb_volume:
    type: OS::Cinder::Volume
    properties:
      size: {get_param: arb_volume_size}
      volume_type: {get_param: ARB_volume_type}
  arb_volume_attachment:
    type: OS::Cinder::VolumeAttachment
    properties:
      volume_id: {get_resource: arb_volume}
      instance_uuid: {get_resource: arb_instance}