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 that deploys vFirewall 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 | vfw_image_name: |
| 17 | type: string |
| 18 | label: Image name or ID |
| 19 | description: Image to be used for compute instance |
| 20 | vfw_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 | unprotected_private_net_id: |
| 29 | type: string |
| 30 | label: Unprotected private network name or ID |
| 31 | description: Private network that connects vPacketGenerator with vFirewall |
| 32 | protected_private_net_id: |
| 33 | type: string |
| 34 | label: Protected private network name or ID |
| 35 | description: Private network that connects vFirewall with vSink |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 36 | onap_private_net_id: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 37 | type: string |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 38 | label: ONAP management network name or ID |
| 39 | description: Private network that connects ONAP components and the VNF |
| 40 | onap_private_subnet_id: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 41 | type: string |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 42 | label: ONAP management sub-network name or ID |
| 43 | description: Private sub-network that connects ONAP components and the VNF |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 44 | unprotected_private_net_cidr: |
| 45 | type: string |
| 46 | label: Unprotected private network CIDR |
| 47 | description: The CIDR of the unprotected private network |
| 48 | protected_private_net_cidr: |
| 49 | type: string |
| 50 | label: Protected private network CIDR |
| 51 | description: The CIDR of the protected private network |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 52 | onap_private_net_cidr: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 53 | type: string |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 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 | vfw_private_ip_0: |
| 57 | type: string |
| 58 | label: vFirewall private IP address towards the unprotected network |
| 59 | description: Private IP address that is assigned to the vFirewall to communicate with the vPacketGenerator |
| 60 | vfw_private_ip_1: |
| 61 | type: string |
| 62 | label: vFirewall private IP address towards the protected network |
| 63 | description: Private IP address that is assigned to the vFirewall to communicate with the vSink |
| 64 | vfw_private_ip_2: |
| 65 | type: string |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 66 | label: vFirewall private IP address towards the ONAP management network |
| 67 | description: Private IP address that is assigned to the vFirewall to communicate with ONAP components |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 68 | vpg_private_ip_0: |
| 69 | type: string |
| 70 | label: vPacketGenerator private IP address towards the unprotected network |
| 71 | description: Private IP address that is assigned to the vPacketGenerator to communicate with the vFirewall |
| 72 | vpg_private_ip_1: |
| 73 | type: string |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 74 | label: vPacketGenerator private IP address towards the ONAP management network |
| 75 | description: Private IP address that is assigned to the vPacketGenerator to communicate with ONAP components |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 76 | vsn_private_ip_0: |
| 77 | type: string |
| 78 | label: vSink private IP address towards the protected network |
| 79 | description: Private IP address that is assigned to the vSink to communicate with the vFirewall |
| 80 | vsn_private_ip_1: |
| 81 | type: string |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 82 | label: vSink private IP address towards the ONAP management network |
| 83 | description: Private IP address that is assigned to the vSink to communicate with ONAP components |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 84 | vfw_name_0: |
| 85 | type: string |
| 86 | label: vFirewall name |
| 87 | description: Name of the vFirewall |
| 88 | vpg_name_0: |
| 89 | type: string |
| 90 | label: vPacketGenerator name |
| 91 | description: Name of the vPacketGenerator |
| 92 | vsn_name_0: |
| 93 | type: string |
| 94 | label: vSink name |
| 95 | description: Name of the vSink |
| 96 | vnf_id: |
| 97 | type: string |
| 98 | label: VNF ID |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 99 | description: The VNF ID is provided by ONAP |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 100 | vf_module_id: |
| 101 | type: string |
| 102 | label: vFirewall module ID |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 103 | description: The vFirewall Module ID is provided by ONAP |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 104 | dcae_collector_ip: |
| 105 | type: string |
| 106 | label: DCAE collector IP address |
| 107 | description: IP address of the DCAE collector |
| 108 | dcae_collector_port: |
| 109 | type: string |
| 110 | label: DCAE collector port |
| 111 | description: Port of the DCAE collector |
| 112 | key_name: |
| 113 | type: string |
| 114 | label: Key pair name |
| 115 | description: Public/Private key pair name |
| 116 | pub_key: |
| 117 | type: string |
| 118 | label: Public key |
| 119 | description: Public key to be installed on the compute instance |
jf9860 | 9ab2634 | 2017-02-28 15:07:36 -0500 | [diff] [blame] | 120 | repo_url_blob: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 121 | type: string |
| 122 | label: Repository URL |
| 123 | description: URL of the repository that hosts the demo packages |
jf9860 | 9ab2634 | 2017-02-28 15:07:36 -0500 | [diff] [blame] | 124 | repo_url_artifacts: |
| 125 | type: string |
| 126 | label: Repository URL |
| 127 | description: URL of the repository that hosts the demo packages |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 128 | install_script_version: |
| 129 | type: string |
| 130 | label: Installation script version number |
| 131 | description: Version number of the scripts that install the vFW demo app |
jf9860 | 9ab2634 | 2017-02-28 15:07:36 -0500 | [diff] [blame] | 132 | demo_artifacts_version: |
| 133 | type: string |
| 134 | label: Artifacts version used in demo vnfs |
| 135 | description: Artifacts (jar, tar.gz) version used in demo vnfs |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 136 | cloud_env: |
| 137 | type: string |
| 138 | label: Cloud environment |
| 139 | description: Cloud environment (e.g., openstack, rackspace) |
| 140 | |
| 141 | ############# |
| 142 | # # |
| 143 | # RESOURCES # |
| 144 | # # |
| 145 | ############# |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 146 | |
| 147 | resources: |
jf9860 | 9ab2634 | 2017-02-28 15:07:36 -0500 | [diff] [blame] | 148 | random-str: |
| 149 | type: OS::Heat::RandomString |
| 150 | properties: |
| 151 | length: 4 |
| 152 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 153 | my_keypair: |
| 154 | type: OS::Nova::KeyPair |
| 155 | properties: |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 156 | name: |
jf9860 | 9ab2634 | 2017-02-28 15:07:36 -0500 | [diff] [blame] | 157 | str_replace: |
| 158 | template: base_rand |
| 159 | params: |
| 160 | base: { get_param: key_name } |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 161 | rand: { get_resource: random-str } |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 162 | public_key: { get_param: pub_key } |
| 163 | save_private_key: false |
| 164 | |
| 165 | unprotected_private_network: |
| 166 | type: OS::Neutron::Net |
| 167 | properties: |
| 168 | name: { get_param: unprotected_private_net_id } |
| 169 | |
| 170 | protected_private_network: |
| 171 | type: OS::Neutron::Net |
| 172 | properties: |
| 173 | name: { get_param: protected_private_net_id } |
| 174 | |
| 175 | unprotected_private_subnet: |
| 176 | type: OS::Neutron::Subnet |
| 177 | properties: |
| 178 | network_id: { get_resource: unprotected_private_network } |
| 179 | cidr: { get_param: unprotected_private_net_cidr } |
| 180 | |
| 181 | protected_private_subnet: |
| 182 | type: OS::Neutron::Subnet |
| 183 | properties: |
| 184 | network_id: { get_resource: protected_private_network } |
| 185 | cidr: { get_param: protected_private_net_cidr } |
| 186 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 187 | # Virtual Firewall instantiation |
| 188 | vfw_private_0_port: |
| 189 | type: OS::Neutron::Port |
| 190 | properties: |
| 191 | network: { get_resource: unprotected_private_network } |
| 192 | fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vfw_private_ip_0 }}] |
| 193 | |
| 194 | vfw_private_1_port: |
| 195 | type: OS::Neutron::Port |
| 196 | properties: |
| 197 | allowed_address_pairs: [{ "ip_address": { get_param: vpg_private_ip_0 }}] |
| 198 | network: { get_resource: protected_private_network } |
| 199 | fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vfw_private_ip_1 }}] |
| 200 | |
| 201 | vfw_private_2_port: |
| 202 | type: OS::Neutron::Port |
| 203 | properties: |
| 204 | network: { get_param: onap_private_net_id } |
| 205 | fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vfw_private_ip_2 }}] |
| 206 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 207 | vfw_0: |
| 208 | type: OS::Nova::Server |
| 209 | properties: |
| 210 | image: { get_param: vfw_image_name } |
| 211 | flavor: { get_param: vfw_flavor_name } |
| 212 | name: { get_param: vfw_name_0 } |
| 213 | key_name: { get_resource: my_keypair } |
| 214 | networks: |
| 215 | - network: { get_param: public_net_id } |
| 216 | - port: { get_resource: vfw_private_0_port } |
| 217 | - port: { get_resource: vfw_private_1_port } |
| 218 | - port: { get_resource: vfw_private_2_port } |
| 219 | metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }} |
| 220 | user_data_format: RAW |
| 221 | user_data: |
| 222 | str_replace: |
| 223 | params: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 224 | __dcae_collector_ip__ : { get_param: dcae_collector_ip } |
| 225 | __dcae_collector_port__ : { get_param: dcae_collector_port } |
jf9860 | 9ab2634 | 2017-02-28 15:07:36 -0500 | [diff] [blame] | 226 | __repo_url_blob__ : { get_param: repo_url_blob } |
| 227 | __repo_url_artifacts__ : { get_param: repo_url_artifacts } |
| 228 | __demo_artifacts_version__ : { get_param: demo_artifacts_version } |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 229 | __install_script_version__ : { get_param: install_script_version } |
| 230 | __vfw_private_ip_0__ : { get_param: vfw_private_ip_0 } |
| 231 | __vfw_private_ip_1__ : { get_param: vfw_private_ip_1 } |
| 232 | __vfw_private_ip_2__ : { get_param: vfw_private_ip_2 } |
| 233 | __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr } |
| 234 | __protected_private_net_cidr__ : { get_param: protected_private_net_cidr } |
| 235 | __onap_private_net_cidr__ : { get_param: onap_private_net_cidr } |
| 236 | __cloud_env__ : { get_param: cloud_env } |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 237 | template: | |
| 238 | #!/bin/bash |
Jerry Flood | 1973e2c | 2017-10-19 18:26:24 -0400 | [diff] [blame] | 239 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 240 | # Create configuration files |
Jerry Flood | d750315 | 2017-10-09 16:33:00 -0400 | [diff] [blame] | 241 | mkdir /opt/config |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 242 | echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt |
| 243 | echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt |
| 244 | echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt |
| 245 | echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt |
| 246 | echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt |
| 247 | echo "__install_script_version__" > /opt/config/install_script_version.txt |
| 248 | echo "__vfw_private_ip_0__" > /opt/config/vfw_private_ip_0.txt |
| 249 | echo "__vfw_private_ip_1__" > /opt/config/vfw_private_ip_1.txt |
| 250 | echo "__vfw_private_ip_2__" > /opt/config/vfw_private_ip_2.txt |
| 251 | echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt |
| 252 | echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt |
| 253 | echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt |
| 254 | echo "__cloud_env__" > /opt/config/cloud_env.txt |
Jerry Flood | 1973e2c | 2017-10-19 18:26:24 -0400 | [diff] [blame] | 255 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 256 | # Download and run install script |
| 257 | curl -k __repo_url_blob__/org.onap.demo/vnfs/vfw/__install_script_version__/v_firewall_install.sh -o /opt/v_firewall_install.sh |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 258 | cd /opt |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 259 | chmod +x v_firewall_install.sh |
| 260 | ./v_firewall_install.sh |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 261 | |
Jerry Flood | d750315 | 2017-10-09 16:33:00 -0400 | [diff] [blame] | 262 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 263 | # Virtual Packet Generator instantiation |
| 264 | vpg_private_0_port: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 265 | type: OS::Neutron::Port |
| 266 | properties: |
| 267 | network: { get_resource: unprotected_private_network } |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 268 | fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vpg_private_ip_0 }}] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 269 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 270 | vpg_private_1_port: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 271 | type: OS::Neutron::Port |
| 272 | properties: |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 273 | network: { get_param: onap_private_net_id } |
| 274 | fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_private_ip_1 }}] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 275 | |
| 276 | vpg_0: |
| 277 | type: OS::Nova::Server |
| 278 | properties: |
| 279 | image: { get_param: vfw_image_name } |
| 280 | flavor: { get_param: vfw_flavor_name } |
| 281 | name: { get_param: vpg_name_0 } |
| 282 | key_name: { get_resource: my_keypair } |
| 283 | networks: |
| 284 | - network: { get_param: public_net_id } |
| 285 | - port: { get_resource: vpg_private_0_port } |
| 286 | - port: { get_resource: vpg_private_1_port } |
| 287 | metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }} |
| 288 | user_data_format: RAW |
| 289 | user_data: |
| 290 | str_replace: |
| 291 | params: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 292 | __fw_ipaddr__: { get_param: vfw_private_ip_0 } |
| 293 | __protected_net_cidr__: { get_param: protected_private_net_cidr } |
| 294 | __sink_ipaddr__: { get_param: vsn_private_ip_0 } |
jf9860 | 9ab2634 | 2017-02-28 15:07:36 -0500 | [diff] [blame] | 295 | __repo_url_blob__ : { get_param: repo_url_blob } |
| 296 | __repo_url_artifacts__ : { get_param: repo_url_artifacts } |
| 297 | __demo_artifacts_version__ : { get_param: demo_artifacts_version } |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 298 | __install_script_version__ : { get_param: install_script_version } |
| 299 | __vpg_private_ip_0__ : { get_param: vpg_private_ip_0 } |
| 300 | __vpg_private_ip_1__ : { get_param: vpg_private_ip_1 } |
| 301 | __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr } |
| 302 | __onap_private_net_cidr__ : { get_param: onap_private_net_cidr } |
| 303 | __cloud_env__ : { get_param: cloud_env } |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 304 | template: | |
| 305 | #!/bin/bash |
Jerry Flood | 1973e2c | 2017-10-19 18:26:24 -0400 | [diff] [blame] | 306 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 307 | # Create configuration files |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 308 | mkdir /opt/config |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 309 | echo "__fw_ipaddr__" > /opt/config/fw_ipaddr.txt |
| 310 | echo "__protected_net_cidr__" > /opt/config/protected_net_cidr.txt |
| 311 | echo "__sink_ipaddr__" > /opt/config/sink_ipaddr.txt |
| 312 | echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt |
| 313 | echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt |
| 314 | echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt |
| 315 | echo "__install_script_version__" > /opt/config/install_script_version.txt |
| 316 | echo "__vpg_private_ip_0__" > /opt/config/vpg_private_ip_0.txt |
| 317 | echo "__vpg_private_ip_1__" > /opt/config/vpg_private_ip_1.txt |
| 318 | echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt |
| 319 | echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt |
| 320 | echo "__cloud_env__" > /opt/config/cloud_env.txt |
Jerry Flood | 1973e2c | 2017-10-19 18:26:24 -0400 | [diff] [blame] | 321 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 322 | # Download and run install script |
| 323 | curl -k __repo_url_blob__/org.onap.demo/vnfs/vfw/__install_script_version__/v_packetgen_install.sh -o /opt/v_packetgen_install.sh |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 324 | cd /opt |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 325 | chmod +x v_packetgen_install.sh |
| 326 | ./v_packetgen_install.sh |
jf9860 | 9ab2634 | 2017-02-28 15:07:36 -0500 | [diff] [blame] | 327 | |
| 328 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 329 | # Virtual Sink instantiation |
| 330 | vsn_private_0_port: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 331 | type: OS::Neutron::Port |
| 332 | properties: |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 333 | network: { get_resource: protected_private_network } |
| 334 | fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vsn_private_ip_0 }}] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 335 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 336 | vsn_private_1_port: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 337 | type: OS::Neutron::Port |
| 338 | properties: |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 339 | network: { get_param: onap_private_net_id } |
| 340 | fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vsn_private_ip_1 }}] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 341 | |
| 342 | vsn_0: |
| 343 | type: OS::Nova::Server |
| 344 | properties: |
| 345 | image: { get_param: vfw_image_name } |
| 346 | flavor: { get_param: vfw_flavor_name } |
| 347 | name: { get_param: vsn_name_0 } |
| 348 | key_name: { get_resource: my_keypair } |
| 349 | networks: |
| 350 | - network: { get_param: public_net_id } |
| 351 | - port: { get_resource: vsn_private_0_port } |
| 352 | - port: { get_resource: vsn_private_1_port } |
| 353 | metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }} |
| 354 | user_data_format: RAW |
| 355 | user_data: |
| 356 | str_replace: |
| 357 | params: |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 358 | __protected_net_gw__: { get_param: vfw_private_ip_1 } |
| 359 | __unprotected_net__: { get_param: unprotected_private_net_cidr } |
jf9860 | 9ab2634 | 2017-02-28 15:07:36 -0500 | [diff] [blame] | 360 | __repo_url_blob__ : { get_param: repo_url_blob } |
| 361 | __repo_url_artifacts__ : { get_param: repo_url_artifacts } |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 362 | __install_script_version__ : { get_param: install_script_version } |
| 363 | __vsn_private_ip_0__ : { get_param: vsn_private_ip_0 } |
| 364 | __vsn_private_ip_1__ : { get_param: vsn_private_ip_1 } |
| 365 | __protected_private_net_cidr__ : { get_param: protected_private_net_cidr } |
| 366 | __onap_private_net_cidr__ : { get_param: onap_private_net_cidr } |
| 367 | __cloud_env__ : { get_param: cloud_env } |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 368 | template: | |
| 369 | #!/bin/bash |
Jerry Flood | 1973e2c | 2017-10-19 18:26:24 -0400 | [diff] [blame] | 370 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 371 | # Create configuration files |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 372 | mkdir /opt/config |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 373 | echo "__protected_net_gw__" > /opt/config/protected_net_gw.txt |
| 374 | echo "__unprotected_net__" > /opt/config/unprotected_net.txt |
| 375 | echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt |
| 376 | echo "__install_script_version__" > /opt/config/install_script_version.txt |
| 377 | echo "__vsn_private_ip_0__" > /opt/config/vsn_private_ip_0.txt |
| 378 | echo "__vsn_private_ip_1__" > /opt/config/vsn_private_ip_1.txt |
| 379 | echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt |
| 380 | echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt |
| 381 | echo "__cloud_env__" > /opt/config/cloud_env.txt |
Jerry Flood | 1973e2c | 2017-10-19 18:26:24 -0400 | [diff] [blame] | 382 | |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 383 | # Download and run install script |
| 384 | curl -k __repo_url_blob__/org.onap.demo/vnfs/vfw/__install_script_version__/v_sink_install.sh -o /opt/v_sink_install.sh |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 385 | cd /opt |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 386 | chmod +x v_sink_install.sh |
| 387 | ./v_sink_install.sh |