aboutsummaryrefslogtreecommitdiffstats
path: root/asdc-controller/src/main/resources/resource-examples/nested-oam_v1.0.yaml
blob: d3baf41da5bdc14510624de9d4840be339aa9ef8 (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
heat_template_version: 2013-05-23

description: nested heat template that creates a PCRF OAM node stack

parameters:
  pcrf_oam_server_name:
    type: string
    label: PCRF OAM server name
    description: PCRF OAM server name
  pcrf_oam_image_name:
    type: string
    label: image name
    description: PCRF OAM image name
  pcrf_oam_flavor_name:
    type: string
    label: PCRF OAM flavor name
    description: flavor name of PCRF OAM instance
  availabilityzone_name:
    type: string
    label: availabilityzone name
    description: availabilityzone name
  pcrf_cps_net_name:
    type: string
    label: CPS network name
    description: CPS network name
  pcrf_cps_net_ip:
    type: string
    label: CPS network ip
    description: CPS network ip
  pcrf_cps_net_mask:
    type: string
    label: CPS network mask
    description: CPS network mask
  pcrf_arbiter_vip:
    type: string
    label: OAM Arbiter LB VIP
    description: OAM Arbiter LB VIP
  pcrf_oam_net_name:
    type: string
    label: OAM network name
    description: OAM network name
  pcrf_oam_net_ip:
    type: string
    label: OAM network ip
    description: OAM network ip
  pcrf_oam_net_gw:
    type: string
    label: CPS network gateway
    description: CPS network gateway
  pcrf_oam_net_mask:
    type: string
    label: CPS network mask
    description: CPS network mask
  pcrf_oam_volume_id:
    type: string
    label: CPS OAM Cinder Volume
    description: CPS OAM Cinder Volume
  pcrf_security_group_name:
    type: string
    label: security group name
    description: the name of security group
  pcrf_vnf_id:
    type: string
    label: PCRF VNF Id
    description: PCRF VNF Id

resources:
  network:
    type: OS::Heat::CloudConfig
    properties:
      cloud_config:
        write_files:
          - path: /etc/sysconfig/network-scripts/ifcfg-eth0
            permissions: "0644"
            content:
              str_replace:
                template: { get_file: nimbus-ethernet }
                params:
                  $dev: eth0
                  $ip: { get_param: pcrf_cps_net_ip }
                  $netmask: { get_param: pcrf_cps_net_mask }
          - path: /etc/sysconfig/network-scripts/ifcfg-eth1
            permissions: "0644"
            content:
              str_replace:
                template: { get_file: nimbus-ethernet-gw }
                params:
                  $dev: eth1
                  $ip: { get_param: pcrf_oam_net_ip }
                  $netmask: { get_param: pcrf_oam_net_mask }
                  $gateway: { get_param: pcrf_oam_net_gw }
        runcmd:
          - ifdown eth0 && ifup eth0
          - ifdown eth1 && ifup eth1
  script_init:
    type: OS::Heat::SoftwareConfig
    properties:
      group: ungrouped
      config:
        str_replace:
          template: { get_file: cloud-nimbus.sh }
          params:
            $vm_name: { get_param: pcrf_oam_server_name }
  pcrf_server_init:
    type: OS::Heat::MultipartMime
    properties:
      parts:
      - config: { get_resource: network}
      - config: { get_resource: script_init}

  pcrf_server_oam:
    type: OS::Nova::Server
    properties:
      config_drive: "True"
      name: { get_param: pcrf_oam_server_name }
      image: { get_param: pcrf_oam_image_name }
      flavor: { get_param: pcrf_oam_flavor_name }
      availability_zone: { get_param: availabilityzone_name }
      networks:
        - port: { get_resource: pcrf_oam_port_0}
        - port: { get_resource: pcrf_oam_port_1}
      user_data_format: RAW
      user_data:
        get_resource: pcrf_server_init
      metadata:
        vnf_id: {get_param: pcrf_vnf_id}
  
  pcrf_oam_port_0:
    type: OS::Neutron::Port
    properties:
      network: { get_param: pcrf_cps_net_name }
      fixed_ips:
        - ip_address: { get_param: pcrf_cps_net_ip }
      allowed_address_pairs:
        - ip_address: { get_param: pcrf_arbiter_vip }
      security_groups: [{ get_param: pcrf_security_group_name }]

  pcrf_oam_port_1:
    type: OS::Neutron::Port
    properties:
      network: { get_param: pcrf_oam_net_name }
      fixed_ips:
        - ip_address: { get_param: pcrf_oam_net_ip }
      security_groups: [{ get_param: pcrf_security_group_name }]

  pcrf_oam_vol_attachment:
    type: OS::Cinder::VolumeAttachment
    properties:
      volume_id: { get_param: pcrf_oam_volume_id }
      mountpoint: /dev/vdd
      instance_uuid: { get_resource: pcrf_server_oam }

outputs:
  pcrf_oam_vol_attachment_id:
    description: the pcrf_oam_vol_attachment_id id
    value: { get_resource: pcrf_oam_vol_attachment }