Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 1 | ########################################################################## |
| 2 | # |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 3 | ########################################################################## |
| 4 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 5 | heat_template_version: 2013-05-23 |
| 6 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 7 | description: Heat template to deploy vLoadBalancer/vDNS demo app for ONAP |
| 8 | |
| 9 | ############## |
| 10 | # # |
| 11 | # PARAMETERS # |
| 12 | # # |
| 13 | ############## |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 14 | |
| 15 | parameters: |
| 16 | vlb_image_name: |
| 17 | type: string |
| 18 | label: Image name or ID |
| 19 | description: Image to be used for compute instance |
| 20 | vlb_flavor_name: |
| 21 | type: string |
| 22 | label: Flavor |
| 23 | description: Type of instance (flavor) to be used |
| 24 | public_net_id: |
| 25 | type: string |
| 26 | label: Public network name or ID |
| 27 | description: Public network that enables remote connection to VNF |
| 28 | vlb_private_net_id: |
| 29 | type: string |
| 30 | label: vLoadBalancer private network name or ID |
| 31 | description: Private network that connects vLoadBalancer with vDNSs |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 32 | pktgen_private_net_id: |
| 33 | type: string |
| 34 | label: vPacketGen private network name or ID |
| 35 | description: Private network that connects vLoadBalancer with vPacketGen |
| 36 | onap_private_net_id: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 37 | type: string |
| 38 | label: ECOMP management network name or ID |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 39 | description: Private network that connects ONAP component and the VNF |
| 40 | onap_private_subnet_id: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 41 | type: string |
| 42 | label: ECOMP management sub-network name or ID |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 43 | description: Private sub-network that connects ONAP component and the VNF |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 44 | vlb_private_net_cidr: |
| 45 | type: string |
| 46 | label: vLoadBalancer private network CIDR |
| 47 | description: The CIDR of the vLoadBalancer private network |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 48 | pktgen_private_net_cidr: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 49 | type: string |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 50 | label: vPacketGen private network CIDR |
| 51 | description: The CIDR of the vPacketGen private network |
| 52 | onap_private_net_cidr: |
| 53 | type: string |
| 54 | label: ONAP private network CIDR |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 55 | description: The CIDR of the protected private network |
| 56 | vlb_private_ip_0: |
| 57 | type: string |
| 58 | label: vLoadBalancer private IP address towards the private network |
| 59 | description: Private IP address that is assigned to the vLoadBalancer to communicate with the vDNSs |
| 60 | vlb_private_ip_1: |
| 61 | type: string |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 62 | label: vLoadBalancer private IP address towards the ONAP management network |
| 63 | description: Private IP address that is assigned to the vLoadBalancer to communicate with ONAP components |
| 64 | vlb_private_ip_2: |
| 65 | type: string |
| 66 | label: vLoadBalancer private IP address towards the vPacketGen network |
| 67 | description: Private IP address that is assigned to the vLoadBalancer to communicate with vPacketGen |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 68 | vdns_private_ip_0: |
| 69 | type: string |
| 70 | label: vDNS private IP address towards the private network |
| 71 | description: Private IP address that is assigned to the vDNS to communicate with the vLoadBalancer |
| 72 | vdns_private_ip_1: |
| 73 | type: string |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 74 | label: vDNS private IP address towards the ONAP management network |
| 75 | description: Private IP address that is assigned to the vDNS to communicate with ONAP components |
| 76 | vpg_private_ip_0: |
| 77 | type: string |
| 78 | label: vPacketGen private IP address towards the vPacketGen private network |
| 79 | description: Private IP address that is assigned to the vPacketGen to communicate with the vLoadBalancer |
| 80 | vpg_private_ip_1: |
| 81 | type: string |
| 82 | label: vPacketGen private IP address towards the ONAP management network |
| 83 | description: Private IP address that is assigned to the vPacketGen to communicate with ONAP components |
| 84 | vip: |
| 85 | type: string |
| 86 | label: Virtual Private IP of the vLoadBalancer |
| 87 | description: Virtual Private IP that is assigned to the vLoadBalancer's VPP layer |
| 88 | gre_ipaddr: |
| 89 | type: string |
| 90 | label: IP Address of the GRE tunnel |
| 91 | description: IP address assigned to the GRE tunnel on the vLoadBalancer |
| 92 | pg_int: |
| 93 | type: string |
| 94 | label: IP Address of the output vPacketGen interface |
| 95 | description: IP address assigned to the output interface of the vPacketGen's VPP layer |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 96 | vlb_name_0: |
| 97 | type: string |
| 98 | label: vLoadBalancer name |
| 99 | description: Name of the vLoadBalancer |
| 100 | vdns_name_0: |
| 101 | type: string |
| 102 | label: vDNS name |
| 103 | description: Name of the vDNS |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 104 | vpg_name_0: |
| 105 | type: string |
| 106 | label: vPKTGEN name |
| 107 | description: Name of the vPKTGEN |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 108 | vnf_id: |
| 109 | type: string |
| 110 | label: VNF ID |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 111 | description: The VNF ID is provided by ONAP |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 112 | vf_module_id: |
| 113 | type: string |
| 114 | label: vFirewall module ID |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 115 | description: The vLoadBalancer Module ID is provided by ONAP |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 116 | dcae_collector_ip: |
| 117 | type: string |
| 118 | label: DCAE collector IP address |
| 119 | description: IP address of the DCAE collector |
| 120 | dcae_collector_port: |
| 121 | type: string |
| 122 | label: DCAE collector port |
| 123 | description: Port of the DCAE collector |
| 124 | key_name: |
| 125 | type: string |
| 126 | label: Key pair name |
| 127 | description: Public/Private key pair name |
| 128 | pub_key: |
| 129 | type: string |
| 130 | label: Public key |
| 131 | description: Public key to be installed on the compute instance |
jf9860 | 9ab2634 | 2017-02-28 15:07:36 -0500 | [diff] [blame] | 132 | repo_url_blob: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 133 | type: string |
| 134 | label: Repository URL |
| 135 | description: URL of the repository that hosts the demo packages |
jf9860 | 9ab2634 | 2017-02-28 15:07:36 -0500 | [diff] [blame] | 136 | repo_url_artifacts: |
| 137 | type: string |
| 138 | label: Repository URL |
| 139 | description: URL of the repository that hosts the demo packages |
| 140 | demo_artifacts_version: |
| 141 | type: string |
| 142 | label: Artifacts version used in demo vnfs |
| 143 | description: Artifacts (jar, tar.gz) version used in demo vnfs |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 144 | install_script_version: |
| 145 | type: string |
| 146 | label: Installation script version number |
| 147 | description: Version number of the scripts that install the vFW demo app |
| 148 | cloud_env: |
| 149 | type: string |
| 150 | label: Cloud environment |
| 151 | description: Cloud environment (e.g., openstack, rackspace) |
| 152 | |
| 153 | ############# |
| 154 | # # |
| 155 | # RESOURCES # |
| 156 | # # |
| 157 | ############# |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 158 | |
| 159 | resources: |
jf9860 | 9ab2634 | 2017-02-28 15:07:36 -0500 | [diff] [blame] | 160 | |
| 161 | random-str: |
| 162 | type: OS::Heat::RandomString |
| 163 | properties: |
| 164 | length: 4 |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 165 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 166 | my_keypair: |
| 167 | type: OS::Nova::KeyPair |
| 168 | properties: |
Jerry Flood | 1973e2c | 2017-10-19 18:26:24 -0400 | [diff] [blame] | 169 | name: |
jf9860 | 9ab2634 | 2017-02-28 15:07:36 -0500 | [diff] [blame] | 170 | str_replace: |
| 171 | template: base_rand |
| 172 | params: |
| 173 | base: { get_param: key_name } |
Jerry Flood | 1973e2c | 2017-10-19 18:26:24 -0400 | [diff] [blame] | 174 | rand: { get_resource: random-str } |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 175 | public_key: { get_param: pub_key } |
| 176 | save_private_key: false |
| 177 | |
| 178 | vlb_private_network: |
| 179 | type: OS::Neutron::Net |
| 180 | properties: |
| 181 | name: { get_param: vlb_private_net_id } |
| 182 | |
| 183 | vlb_private_subnet: |
| 184 | type: OS::Neutron::Subnet |
| 185 | properties: |
| 186 | name: { get_param: vlb_private_net_id } |
| 187 | network_id: { get_resource: vlb_private_network } |
| 188 | cidr: { get_param: vlb_private_net_cidr } |
| 189 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 190 | pktgen_private_network: |
| 191 | type: OS::Neutron::Net |
| 192 | properties: |
| 193 | name: { get_param: pktgen_private_net_id } |
| 194 | |
| 195 | pktgen_private_subnet: |
| 196 | type: OS::Neutron::Subnet |
| 197 | properties: |
| 198 | name: { get_param: pktgen_private_net_id } |
| 199 | network_id: { get_resource: pktgen_private_network } |
| 200 | cidr: { get_param: pktgen_private_net_cidr } |
| 201 | |
| 202 | vlb_private_0_port: |
| 203 | type: OS::Neutron::Port |
| 204 | properties: |
| 205 | network: { get_resource: vlb_private_network } |
| 206 | fixed_ips: [{"subnet": { get_resource: vlb_private_subnet }, "ip_address": { get_param: vlb_private_ip_0 }}] |
| 207 | |
| 208 | vlb_private_1_port: |
| 209 | type: OS::Neutron::Port |
| 210 | properties: |
| 211 | network: { get_param: onap_private_net_id } |
| 212 | fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vlb_private_ip_1 }}] |
| 213 | |
| 214 | vlb_private_2_port: |
| 215 | type: OS::Neutron::Port |
| 216 | properties: |
| 217 | network: { get_resource: pktgen_private_network } |
| 218 | fixed_ips: [{"subnet": { get_resource: pktgen_private_subnet }, "ip_address": { get_param: vlb_private_ip_2 }}] |
| 219 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 220 | vlb_0: |
| 221 | type: OS::Nova::Server |
| 222 | properties: |
| 223 | image: { get_param: vlb_image_name } |
| 224 | flavor: { get_param: vlb_flavor_name } |
| 225 | name: { get_param: vlb_name_0 } |
| 226 | key_name: { get_resource: my_keypair } |
| 227 | networks: |
| 228 | - network: { get_param: public_net_id } |
| 229 | - port: { get_resource: vlb_private_0_port } |
| 230 | - port: { get_resource: vlb_private_1_port } |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 231 | - port: { get_resource: vlb_private_2_port } |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 232 | metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }} |
| 233 | user_data_format: RAW |
| 234 | user_data: |
| 235 | str_replace: |
| 236 | params: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 237 | __dcae_collector_ip__: { get_param: dcae_collector_ip } |
| 238 | __dcae_collector_port__: { get_param: dcae_collector_port } |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 239 | __ip_to_dns_net__: { get_param: vlb_private_ip_0 } |
| 240 | __ip_to_pktgen_net__: { get_param: vlb_private_ip_2 } |
| 241 | __vip__: { get_param: vip } |
| 242 | __gre_ipaddr__: { get_param: gre_ipaddr } |
| 243 | __pktgen_ipaddr__: { get_param: vpg_private_ip_0 } |
| 244 | __oam_private_ipaddr__: { get_param: vlb_private_ip_1 } |
| 245 | __repo_url_blob__: { get_param: repo_url_blob } |
| 246 | __repo_url_artifacts__: { get_param: repo_url_artifacts } |
| 247 | __demo_artifacts_version__: { get_param: demo_artifacts_version } |
| 248 | __install_script_version__: { get_param: install_script_version } |
| 249 | __vlb_private_net_cidr__: { get_param: vlb_private_net_cidr } |
| 250 | __onap_private_net_cidr__: { get_param: onap_private_net_cidr } |
| 251 | __pktgen_private_net_cidr__: { get_param: pktgen_private_net_cidr } |
| 252 | __pktgen_mac__: { get_attr: [vpg_private_0_port, mac_address] } |
| 253 | __cloud_env__: { get_param: cloud_env } |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 254 | template: | |
| 255 | #!/bin/bash |
| 256 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 257 | # Create configuration files |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 258 | mkdir /opt/config |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 259 | echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt |
| 260 | echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt |
| 261 | echo "__ip_to_dns_net__" > /opt/config/ip_to_dns_net.txt |
| 262 | echo "__ip_to_pktgen_net__" > /opt/config/ip_to_pktgen_net.txt |
| 263 | echo "__vip__" > /opt/config/vip.txt |
| 264 | echo "__gre_ipaddr__" > /opt/config/gre_ipaddr.txt |
| 265 | echo "__pktgen_ipaddr__" > /opt/config/pktgen_ipaddr.txt |
| 266 | echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt |
| 267 | echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt |
| 268 | echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt |
| 269 | echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt |
| 270 | echo "__install_script_version__" > /opt/config/install_script_version.txt |
| 271 | echo "__vlb_private_net_cidr__" > /opt/config/vlb_private_net_cidr.txt |
| 272 | echo "__pktgen_private_net_cidr__" > /opt/config/pktgen_private_net_cidr.txt |
| 273 | echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt |
| 274 | echo "__pktgen_mac__" > /opt/config/pktgen_mac.txt |
| 275 | echo "__cloud_env__" > /opt/config/cloud_env.txt |
| 276 | |
| 277 | # Download and run install script |
| 278 | curl -k __repo_url_blob__/org.onap.demo/vnfs/vlb/__install_script_version__/v_lb_install.sh -o /opt/v_lb_install.sh |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 279 | cd /opt |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 280 | chmod +x v_lb_install.sh |
| 281 | ./v_lb_install.sh |
jf9860 | 9ab2634 | 2017-02-28 15:07:36 -0500 | [diff] [blame] | 282 | |
jf9860 | 9ab2634 | 2017-02-28 15:07:36 -0500 | [diff] [blame] | 283 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 284 | vdns_private_0_port: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 285 | type: OS::Neutron::Port |
| 286 | properties: |
| 287 | network: { get_resource: vlb_private_network } |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 288 | fixed_ips: [{"subnet": { get_resource: vlb_private_subnet }, "ip_address": { get_param: vdns_private_ip_0 }}] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 289 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 290 | vdns_private_1_port: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 291 | type: OS::Neutron::Port |
| 292 | properties: |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 293 | network: { get_param: onap_private_net_id } |
| 294 | fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vdns_private_ip_1 }}] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 295 | |
| 296 | vdns_0: |
| 297 | type: OS::Nova::Server |
| 298 | properties: |
| 299 | image: { get_param: vlb_image_name } |
| 300 | flavor: { get_param: vlb_flavor_name } |
| 301 | name: { get_param: vdns_name_0 } |
| 302 | key_name: { get_resource: my_keypair } |
| 303 | networks: |
| 304 | - network: { get_param: public_net_id } |
| 305 | - port: { get_resource: vdns_private_0_port } |
| 306 | - port: { get_resource: vdns_private_1_port } |
| 307 | metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }} |
| 308 | user_data_format: RAW |
| 309 | user_data: |
| 310 | str_replace: |
| 311 | params: |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 312 | __lb_oam_int__: { get_param: vlb_private_ip_1 } |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 313 | __lb_private_ipaddr__: { get_param: vlb_private_ip_0 } |
| 314 | __local_private_ipaddr__: { get_param: vdns_private_ip_0 } |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 315 | __oam_private_ipaddr__: { get_param: vdns_private_ip_1 } |
| 316 | __repo_url_blob__: { get_param: repo_url_blob } |
| 317 | __repo_url_artifacts__: { get_param: repo_url_artifacts } |
| 318 | __demo_artifacts_version__: { get_param: demo_artifacts_version } |
| 319 | __install_script_version__: { get_param: install_script_version } |
| 320 | __vlb_private_net_cidr__: { get_param: vlb_private_net_cidr } |
| 321 | __onap_private_net_cidr__: { get_param: onap_private_net_cidr } |
| 322 | __cloud_env__: { get_param: cloud_env } |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 323 | template: | |
| 324 | #!/bin/bash |
| 325 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 326 | # Create configuration files |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 327 | mkdir /opt/config |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 328 | echo "__lb_oam_int__" > /opt/config/lb_oam_int.txt |
| 329 | echo "__lb_private_ipaddr__" > /opt/config/lb_private_ipaddr.txt |
| 330 | echo "__local_private_ipaddr__" > /opt/config/local_private_ipaddr.txt |
| 331 | echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt |
| 332 | echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt |
| 333 | echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt |
| 334 | echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt |
| 335 | echo "__install_script_version__" > /opt/config/install_script_version.txt |
| 336 | echo "__vlb_private_net_cidr__" > /opt/config/vlb_private_net_cidr.txt |
| 337 | echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt |
| 338 | echo "__cloud_env__" > /opt/config/cloud_env.txt |
| 339 | |
| 340 | # Download and run install script |
| 341 | curl -k __repo_url_blob__/org.onap.demo/vnfs/vlb/__install_script_version__/v_dns_install.sh -o /opt/v_dns_install.sh |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 342 | cd /opt |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 343 | chmod +x v_dns_install.sh |
| 344 | ./v_dns_install.sh |
jf9860 | 9ab2634 | 2017-02-28 15:07:36 -0500 | [diff] [blame] | 345 | |
jf9860 | 9ab2634 | 2017-02-28 15:07:36 -0500 | [diff] [blame] | 346 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 347 | vpg_private_0_port: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 348 | type: OS::Neutron::Port |
| 349 | properties: |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 350 | network: { get_resource: pktgen_private_network } |
| 351 | fixed_ips: [{"subnet": { get_resource: pktgen_private_subnet }, "ip_address": { get_param: vpg_private_ip_0 }}] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 352 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 353 | vpg_private_1_port: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 354 | type: OS::Neutron::Port |
| 355 | properties: |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 356 | network: { get_param: onap_private_net_id } |
| 357 | fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_private_ip_1 }}] |
| 358 | |
| 359 | vpg_0: |
| 360 | type: OS::Nova::Server |
| 361 | properties: |
| 362 | image: { get_param: vlb_image_name } |
| 363 | flavor: { get_param: vlb_flavor_name } |
| 364 | name: { get_param: vpg_name_0 } |
| 365 | key_name: { get_resource: my_keypair } |
| 366 | networks: |
| 367 | - network: { get_param: public_net_id } |
| 368 | - port: { get_resource: vpg_private_0_port } |
| 369 | - port: { get_resource: vpg_private_1_port } |
| 370 | user_data_format: RAW |
| 371 | user_data: |
| 372 | str_replace: |
| 373 | params: |
| 374 | __repo_url_blob__: { get_param: repo_url_blob } |
| 375 | __repo_url_artifacts__: { get_param: repo_url_artifacts } |
| 376 | __local_private_ipaddr__: { get_param: vpg_private_ip_0 } |
| 377 | __oam_private_ipaddr__: { get_param: vpg_private_ip_1 } |
| 378 | __onap_private_net_cidr__: { get_param: onap_private_net_cidr } |
| 379 | __pktgen_private_net_cidr__: { get_param: pktgen_private_net_cidr } |
| 380 | __vlb_ipaddr__: { get_param: vlb_private_ip_2 } |
| 381 | __demo_artifacts_version__: { get_param: demo_artifacts_version } |
| 382 | __install_script_version__: { get_param: install_script_version } |
| 383 | __pg_int__: { get_param: pg_int } |
| 384 | __vlb_mac__: { get_attr: [vlb_private_2_port, mac_address] } |
| 385 | __cloud_env__: { get_param: cloud_env } |
| 386 | template: | |
| 387 | #!/bin/bash |
| 388 | |
| 389 | # Create configuration files |
| 390 | mkdir /opt/config |
| 391 | echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt |
| 392 | echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt |
| 393 | echo "__local_private_ipaddr__" > /opt/config/local_private_ipaddr.txt |
| 394 | echo "__pktgen_private_net_cidr__" > /opt/config/pktgen_private_net_cidr.txt |
| 395 | echo "__vlb_ipaddr__" > /opt/config/vlb_ipaddr.txt |
| 396 | echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt |
| 397 | echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt |
| 398 | echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt |
| 399 | echo "__install_script_version__" > /opt/config/install_script_version.txt |
| 400 | echo "__pg_int__" > /opt/config/pg_int.txt |
| 401 | echo "__vlb_mac__" > /opt/config/vlb_mac.txt |
| 402 | echo "__cloud_env__" > /opt/config/cloud_env.txt |
| 403 | |
| 404 | # Download and run install script |
| 405 | curl -k __repo_url_blob__/org.onap.demo/vnfs/vlb/__install_script_version__/v_packetgen_install.sh -o /opt/v_packetgen_install.sh |
| 406 | cd /opt |
| 407 | chmod +x v_packetgen_install.sh |
| 408 | ./v_packetgen_install.sh |