diff options
author | platania <platania@research.att.com> | 2017-02-24 16:35:34 -0500 |
---|---|---|
committer | platania <platania@research.att.com> | 2017-02-24 16:35:34 -0500 |
commit | ffac8c3daab6211f0b6988404990c17a8a108f16 (patch) | |
tree | 106ed5fa0a2d051ec54caf1a33cb8cf94562b5c9 | |
parent | 9ee4ed868e558f81491d006f656eb54c43828752 (diff) |
upload heat templates
Change-Id: Ic3a897d33b9395df828e3c8692730d0b63e30662
Signed-off-by: platania <platania@research.att.com>
-rw-r--r-- | .DS_Store | bin | 8196 -> 8196 bytes | |||
-rw-r--r-- | heat/.DS_Store | bin | 8196 -> 8196 bytes | |||
-rw-r--r-- | heat/OpenECOMP/openecomp_rackspace.env | 48 | ||||
-rw-r--r-- | heat/OpenECOMP/openecomp_rackspace.yaml | 1182 | ||||
-rw-r--r-- | heat/vFW/base_vfw.env | 30 | ||||
-rw-r--r-- | heat/vFW/base_vfw.yaml | 423 | ||||
-rw-r--r-- | heat/vLB/base_vlb.env | 24 | ||||
-rw-r--r-- | heat/vLB/base_vlb.yaml | 340 | ||||
-rw-r--r-- | heat/vLB/dnsscaling.env | 19 | ||||
-rw-r--r-- | heat/vLB/dnsscaling.yaml | 194 | ||||
-rw-r--r-- | heat/vLB/packet_gen_vlb.env | 11 | ||||
-rw-r--r-- | heat/vLB/packet_gen_vlb.yaml | 139 | ||||
-rw-r--r-- | vnfs/.DS_Store | bin | 10244 -> 10244 bytes | |||
-rw-r--r-- | vnfs/vLB/.DS_Store | bin | 10244 -> 10244 bytes | |||
-rw-r--r-- | vnfs/vLB/scripts/.DS_Store | bin | 8196 -> 8196 bytes | |||
-rw-r--r-- | vnfs/vLB/scripts/v_packetgen_for_dns_demo_init.sh | 2 |
16 files changed, 2411 insertions, 1 deletions
Binary files differ diff --git a/heat/.DS_Store b/heat/.DS_Store Binary files differindex 1afff45a..098cb5c4 100644 --- a/heat/.DS_Store +++ b/heat/.DS_Store diff --git a/heat/OpenECOMP/openecomp_rackspace.env b/heat/OpenECOMP/openecomp_rackspace.env new file mode 100644 index 00000000..90e67f98 --- /dev/null +++ b/heat/OpenECOMP/openecomp_rackspace.env @@ -0,0 +1,48 @@ +parameters: + + # Generic parameters used across all OpenECOMP components + + public_net_id: 00000000-0000-0000-0000-000000000000 + + key_name: ecomp_key + + pub_key: INSERT YOUR PUBLIC KEY HERE + + nexus_repo: https://nexus.openecomp.org/content/sites/raw + + nexus_docker_repo: nexus3.openecomp.org:10001 + + nexus_username: INSERT YOUR USERNAME HERE + + nexus_password: INSERT YOUR PASSWORD HERE + + gitlab_username: INSERT YOUR USERNAME HERE + + gitlab_password: INSERT YOUR PASSWORD HERE + + dmaap_topic: AUTO + + artifacts_version: 1.0.0-SNAPSHOT + + + # Parameters for DCAE instantiation + + dcae_zone: iad4 + + dcae_state: vi + + openstack_tenant_id: INSERT YOUR TENANT ID HERE + + openstack_username: INSERT YOUR USERNAME HERE + + openstack_api_key: INSERT YOUR API KEY HERE + + openstack_password: INSERT YOUR PASSWORD HERE + + nexus_repo_root: https://nexus.openecomp.org + + nexus_url_snapshot: https://nexus.openecomp.org/content/repositories/snapshots + + openstack_region: IAD + + gitlab_branch: master diff --git a/heat/OpenECOMP/openecomp_rackspace.yaml b/heat/OpenECOMP/openecomp_rackspace.yaml new file mode 100644 index 00000000..11c11262 --- /dev/null +++ b/heat/OpenECOMP/openecomp_rackspace.yaml @@ -0,0 +1,1182 @@ +heat_template_version: 2013-05-23 + +description: Heat template to deploy OpenECOMP components + +parameters: + + # Generic parameters used across all OpenECOMP components + public_net_id: + type: string + label: Public network name or ID + description: Public network that enables remote connection to the compute instance + + key_name: + type: string + label: Key pair name + description: Public/Private key pair name + + pub_key: + type: string + label: Public key + description: Public key or SSL certificate to be installed on the compute instance + + nexus_repo: + type: string + label: Nexus Repository + description: Complete URL for the Nexus repository. + + nexus_docker_repo: + type: string + label: Nexus Docker Images Repository + description: Complete URL for the Nexus repository for docker images. + + nexus_username: + type: string + label: Nexus Repository Username + description: Nexus Repository username + + nexus_password: + type: string + label: Nexus Repository Password + description: Nexus Repository Password + + gitlab_username: + type: string + label: Gitlab Repository Username + description: Gitlab Repository username + + gitlab_password: + type: string + label: Gitlab Repository Password + description: Gitlab Repository Password + + dmaap_topic: + type: string + label: DmaaP Topic + description: DmaaP Topic that MSO and A&AI listen to + + artifacts_version: + type: string + label: Artifacts Version + description: Artifacts version of OpenECOMP components + + + # Parameters for DCAE instantiation + dcae_zone: + type: string + label: DCAE Zone + description: DCAE Zone to use in VM names created by DCAE controller + + dcae_state: + type: string + label: DCAE State + description: DCAE State to use in VM names created by DCAE controller + + openstack_tenant_id: + type: string + label: Rackspace tenant ID + description: Rackspace tenant ID + + openstack_username: + type: string + label: Rackspace username + description: Rackspace username + + openstack_api_key: + type: string + label: Rackspace API Key + description: Rackspace API Key + + openstack_password: + type: string + label: Rackspace Password + description: Rackspace Password + + nexus_repo_root: + type: string + label: Root URL of nexus repository + description: Root URL of nexus repository + + nexus_url_snapshot: + type: string + label: Snapshot of Maven repository for DCAE deployment + description: Snapshot of Maven repository + + openstack_region: + type: string + label: Rackspace Region + description: Rackspace region where the DCAE controller will spin the VMs + + gitlab_branch: + type: string + label: Branch of the Gitlab repository + description: Branch of the Gitlab repository + + +resources: + random-str: + type: OS::Heat::RandomString + properties: + length: 4 + + # Public key used to access OpenECOMP components + vm_key: + type: OS::Nova::KeyPair + properties: + name: + str_replace: + template: base_rand + params: + base: { get_param: key_name } + rand: { get_resource: random-str } + public_key: { get_param: pub_key } + save_private_key: false + + + # OpenECOMP management private network + oam_ecomp: + type: OS::Neutron::Net + properties: + name: + str_replace: + template: oam_ecomp_rand + params: + rand: { get_resource: random-str } + + oam_ecomp_subnet: + type: OS::Neutron::Subnet + properties: + name: + str_replace: + template: oam_ecomp_rand + params: + rand: { get_resource: random-str } + network_id: { get_resource: oam_ecomp } + cidr: 10.0.0.0/8 + value: { get_attr: [oam_ecomp, name] } + + + # DNS Server instantiation + dns_private_port: + type: OS::Neutron::Port + properties: + network: { get_resource: oam_ecomp } + fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.0.1}] + + dns_vm: + type: OS::Nova::Server + properties: + image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) + flavor: 4 GB General Purpose v1 + name: vm1-dns-server + key_name: { get_resource: vm_key } + networks: + - network: { get_param: public_net_id } + - port: { get_resource: dns_private_port } + user_data_format: RAW + user_data: + str_replace: + params: + __nexus_repo__: { get_param: nexus_repo } + __nexus_docker_repo__: { get_param: nexus_docker_repo } + __nexus_username__: { get_param: nexus_username } + __nexus_password__: { get_param: nexus_password } + __gitlab_username__: { get_param: gitlab_username } + __gitlab_password__: { get_param: gitlab_password } + __artifacts_version__: { get_param: artifacts_version } + template: | + #!/bin/bash + + # Download dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk bind9 bind9utils bind9-doc ntp ntpdate + + # Download script + mkdir /etc/bind/zones + + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/db_simpledemo_openecomp_org -o /etc/bind/zones/db.simpledemo.openecomp.org + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/named.conf.options -o /etc/bind/named.conf.options + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/named.conf.local -o /etc/bind/named.conf.local + + # Configure Bind + modprobe ip_gre + sed -i "s/OPTIONS=.*/OPTIONS=\"-4 -u bind\"/g" /etc/default/bind9 + service bind9 restart + + + # A&AI instantiation + aai_private_port: + type: OS::Neutron::Port + properties: + network: { get_resource: oam_ecomp } + fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.1.1}] + + aai_volume: + type: OS::Cinder::Volume + properties: + name: vol1-aai + size: 50 + volume_type: SSD + image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) + + aai_vm: + type: OS::Nova::Server + depends_on: sdc_vm + properties: + flavor: 15 GB Compute v1 + name: vm1-aai + key_name: { get_resource: vm_key } + block_device_mapping: + - volume_id: { get_resource: aai_volume } + device_name: vda + networks: + - network: { get_param: public_net_id } + - port: { get_resource: aai_private_port } + user_data_format: RAW + user_data: + str_replace: + params: + __nexus_repo__: { get_param: nexus_repo } + __nexus_docker_repo__: { get_param: nexus_docker_repo } + __nexus_username__: { get_param: nexus_username } + __nexus_password__: { get_param: nexus_password } + __gitlab_username__: { get_param: gitlab_username } + __gitlab_password__: { get_param: gitlab_password } + __dmaap_topic__: { get_param: dmaap_topic } + __artifacts_version__: { get_param: artifacts_version } + template: | + #!/bin/bash + + # DNS/GW IP address configuration + echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head + resolvconf -u + + # Download dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk ntp ntpdate + + # Download scripts from Nexus + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/aai_vm_init.sh -o /opt/aai_vm_init.sh + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/aai_serv.sh -o /opt/aai_serv.sh + chmod +x /opt/aai_vm_init.sh + chmod +x /opt/aai_serv.sh + mv /opt/aai_serv.sh /etc/init.d + update-rc.d aai_serv.sh defaults + + # Download and install docker-engine and docker-compose + apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D + echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list + apt-get update + apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual + apt-get install -y docker-engine + service docker start + + mkdir -p /opt/openecomp/aai/logs + mkdir -p /opt/openecomp/aai/data + mkdir /opt/docker + curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose + chmod +x /opt/docker/docker-compose + + # Store credentials in files + mkdir -p /opt/config + echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt + echo "__nexus_username__" > /opt/config/nexus_username.txt + echo "__nexus_password__" > /opt/config/nexus_password.txt + echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt + echo "__gitlab_username__" > /opt/config/gitlab_username.txt + echo "__gitlab_password__" > /opt/config/gitlab_password.txt + echo "gerrit.openecomp.org" > /opt/config/gitlab_certname.txt + # Execute docker instructions + cd /opt + ./aai_vm_init.sh + + + # MSO instantiation + mso_private_port: + type: OS::Neutron::Port + properties: + network: { get_resource: oam_ecomp } + fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.5.1}] + + mso_vm: + type: OS::Nova::Server + properties: + image: Ubuntu 16.04 LTS (Xenial Xerus) (PVHVM) + flavor: 4 GB General Purpose v1 + name: vm1-mso + key_name: { get_resource: vm_key } + networks: + - network: { get_param: public_net_id } + - port: { get_resource: mso_private_port } + user_data_format: RAW + user_data: + str_replace: + params: + __nexus_repo__: { get_param: nexus_repo } + __nexus_docker_repo__: { get_param: nexus_docker_repo } + __nexus_username__: { get_param: nexus_username } + __nexus_password__: { get_param: nexus_password } + __gitlab_username__: { get_param: gitlab_username } + __gitlab_password__: { get_param: gitlab_password } + __openstack_username__: { get_param: openstack_username } + __openstack_tenant_id__: { get_param: openstack_tenant_id } + __openstack_api_key__: { get_param: openstack_api_key } + __dmaap_topic__: { get_param: dmaap_topic } + __artifacts_version__: { get_param: artifacts_version } + template: | + #!/bin/bash + + # DNS/GW IP address configuration + echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head + resolvconf -u + + # Download dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate + + # Download scripts from Nexus + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mso_vm_init.sh -o /opt/mso_vm_init.sh + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mso_serv.sh -o /opt/mso_serv.sh + chmod +x /opt/mso_vm_init.sh + chmod +x /opt/mso_serv.sh + mv /opt/mso_serv.sh /etc/init.d + update-rc.d mso_serv.sh defaults + + # Download and install docker-engine and docker-compose + apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D + echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list + apt-get update + apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual + apt-get install -y docker-engine + service docker start + + mkdir /opt/docker + curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose + chmod +x /opt/docker/docker-compose + + # Store credentials in files + mkdir -p /opt/config + echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt + echo "__nexus_username__" > /opt/config/nexus_username.txt + echo "__nexus_password__" > /opt/config/nexus_password.txt + echo "__gitlab_username__" > /opt/config/gitlab_username.txt + echo "__gitlab_password__" > /opt/config/gitlab_password.txt + echo "__openstack_username__" > /opt/config/openstack_username.txt + echo "__openstack_tenant_id__" > /opt/config/tenant_id.txt + echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt + + + # Run docker-compose to spin up containers + cd /opt + git clone https://__gitlab_username__:__gitlab_password__@gerrit.openecomp.org/r/a/mso/docker-config.git test_lab + MSO_ENCRYPTION_KEY=$(cat /opt/test_lab/encryption.key) + echo -n "__openstack_api_key__" | openssl aes-128-ecb -e -K $MSO_ENCRYPTION_KEY -nosalt | xxd -c 256 -p > /opt/config/api_key.txt + ./mso_vm_init.sh + + + # Message Router instantiation + mrouter_private_port: + type: OS::Neutron::Port + properties: + network: { get_resource: oam_ecomp } + fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.11.1}] + + mrouter_vm: + type: OS::Nova::Server + properties: + image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) + flavor: 15 GB I/O v1 + name: vm1-message-router + key_name: { get_resource: vm_key } + networks: + - network: { get_param: public_net_id } + - port: { get_resource: mrouter_private_port } + user_data_format: RAW + user_data: + str_replace: + params: + __nexus_repo__: { get_param: nexus_repo } + __nexus_docker_repo__: { get_param: nexus_docker_repo } + __nexus_username__: { get_param: nexus_username } + __nexus_password__: { get_param: nexus_password } + __gitlab_username__: { get_param: gitlab_username } + __gitlab_password__: { get_param: gitlab_password } + __artifacts_version__: { get_param: artifacts_version } + template: | + #!/bin/bash + + # DNS/GW IP address configuration + echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head + resolvconf -u + + # Download dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk ntp ntpdate + + # Download scripts from Nexus + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mr_vm_init.sh -o /opt/mr_vm_init.sh + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mr_serv.sh -o /opt/mr_serv.sh + chmod +x /opt/mr_vm_init.sh + chmod +x /opt/mr_serv.sh + mv /opt/mr_serv.sh /etc/init.d + update-rc.d mr_serv.sh defaults + + # Download and install docker-engine and docker-compose + apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D + echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list + apt-get update + apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual + apt-get install -y docker-engine + service docker start + + mkdir /opt/docker + curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose + chmod +x /opt/docker/docker-compose + + # Store credentials in files + mkdir -p /opt/config + echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt + echo "__nexus_username__" > /opt/config/nexus_username.txt + echo "__nexus_password__" > /opt/config/nexus_password.txt + echo "__gitlab_username__" > /opt/config/gitlab_username.txt + echo "__gitlab_password__" > /opt/config/gitlab_password.txt + + # Run docker-compose to spin up containers + cd /opt + git clone https://__gitlab_username__:__gitlab_password__@gerrit.openecomp.org/r/a/dcae/demo/startup/message-router.git dcae-startup-vm-message-router + ./mr_vm_init.sh + + + # RobotE2E instantiation + robot_private_port: + type: OS::Neutron::Port + properties: + network: { get_resource: oam_ecomp } + fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.10.1}] + + robot_vm: + type: OS::Nova::Server + properties: + image: Ubuntu 16.04 LTS (Xenial Xerus) (PVHVM) + flavor: 2 GB General Purpose v1 + name: vm1-robot + key_name: { get_resource: vm_key } + networks: + - network: { get_param: public_net_id } + - port: { get_resource: robot_private_port } + user_data_format: RAW + user_data: + str_replace: + params: + __nexus_repo__: { get_param: nexus_repo } + __nexus_docker_repo__: { get_param: nexus_docker_repo } + __nexus_username__: { get_param: nexus_username } + __nexus_password__: { get_param: nexus_password } + __gitlab_username__: { get_param: gitlab_username } + __gitlab_password__: { get_param: gitlab_password } + __network_name__: { get_attr: [oam_ecomp, name] } + __openstack_username__: { get_param: openstack_username } + __openstack_api_key__: { get_param : openstack_api_key } + __openstack_password__: { get_param: openstack_password } + __artifacts_version__: { get_param: artifacts_version } + __openstack_region__: { get_param: openstack_region } + template: | + #!/bin/bash + + # DNS/GW IP address configuration + echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head + resolvconf -u + + # Download dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk ntp ntpdate + + # Download scripts from Nexus + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/robot_vm_init.sh -o /opt/robot_vm_init.sh + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/robot_serv.sh -o /opt/robot_serv.sh + chmod +x /opt/robot_vm_init.sh + chmod +x /opt/robot_serv.sh + mv /opt/robot_serv.sh /etc/init.d + update-rc.d robot_serv.sh defaults + + # Download and install docker-engine and docker-compose + apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D + echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list + apt-get update + apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual + apt-get install -y docker-engine + #sed -i 's|^ExecStart=/usr/bin/dockerd \s*-H \s*fd://\s*$|ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375|' /lib/systemd/system/docker.service + service docker start + + mkdir /opt/docker + curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose + chmod +x /opt/docker/docker-compose + + # Store credentials in files + mkdir -p /opt/config + echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt + echo "__nexus_repo__" > /opt/config/nexus_repo.txt + echo "__nexus_username__" > /opt/config/nexus_username.txt + echo "__nexus_password__" > /opt/config/nexus_password.txt + echo "__gitlab_username__" > /opt/config/gitlab_username.txt + echo "__gitlab_password__" > /opt/config/gitlab_password.txt + echo "__network_name__" > /opt/config/network.txt + echo "__openstack_username__" > /opt/config/openstack_username.txt + echo "__openstack_password__" > /opt/config/openstack_password.txt + echo "__openstack_api_key__" > /opt/config/openstack_api_key.txt + echo "__openstack_region__" > /opt/config/region.txt + + # Execute RobotETE-specific instructions: create share folder to run as a docker volume + mkdir -p /opt/eteshare/logs + mkdir -p /opt/eteshare/config + + # Run docker-compose to spin up containers + cd /opt + git clone https://__gitlab_username__:__gitlab_password__@gerrit.openecomp.org/r/a/testsuite/properties.git testsuite/properties + ./robot_vm_init.sh + + + # VID instantiation + vid_private_port: + type: OS::Neutron::Port + properties: + network: { get_resource: oam_ecomp } + fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.8.1}] + + vid_vm: + type: OS::Nova::Server + properties: + image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) + flavor: 2 GB General Purpose v1 + name: vm1-vid + key_name: { get_resource: vm_key } + networks: + - network: { get_param: public_net_id } + - port: { get_resource: vid_private_port } + user_data_format: RAW + user_data: + str_replace: + params: + __nexus_repo__: { get_param: nexus_repo } + __nexus_docker_repo__: { get_param: nexus_docker_repo } + __nexus_username__: { get_param: nexus_username } + __nexus_password__: { get_param: nexus_password } + __gitlab_username__: { get_param: gitlab_username } + __gitlab_password__: { get_param: gitlab_password } + __artifacts_version__: { get_param: artifacts_version } + template: | + #!/bin/bash + + # DNS/GW IP address configuration + echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head + resolvconf -u + + # Download dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk make git ntp ntpdate + + # Download scripts from Nexus + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/vid_vm_init.sh -o /opt/vid_vm_init.sh + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/vid_serv.sh -o /opt/vid_serv.sh + chmod +x /opt/vid_vm_init.sh + chmod +x /opt/vid_serv.sh + mv /opt/vid_serv.sh /etc/init.d + update-rc.d vid_serv.sh defaults + + # Download and install docker-engine and docker-compose + apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D + echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list + apt-get update + apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual + apt-get install -y docker-engine + service docker start + + mkdir /opt/docker + curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose + chmod +x /opt/docker/docker-compose + + # Store credentials in files + mkdir -p /opt/config + echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt + echo "__nexus_username__" > /opt/config/nexus_username.txt + echo "__nexus_password__" > /opt/config/nexus_password.txt + echo "__gitlab_username__" > /opt/config/gitlab_username.txt + echo "__gitlab_password__" > /opt/config/gitlab_password.txt + + # Run script to spin up containers + cd /opt + git clone https://__gitlab_username__:__gitlab_password__@gerrit.openecomp.org/r/a/vid.git + ./vid_vm_init.sh + + + # SDN-C instantiation + sdnc_private_port: + type: OS::Neutron::Port + properties: + network: { get_resource: oam_ecomp } + fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.7.1}] + + sdnc_vm: + type: OS::Nova::Server + properties: + image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) + flavor: 4 GB General Purpose v1 + name: vm1-sdnc + key_name: { get_resource: vm_key } + networks: + - network: { get_param: public_net_id } + - port: { get_resource: sdnc_private_port } + user_data_format: RAW + user_data: + str_replace: + params: + __nexus_repo__: { get_param: nexus_repo } + __nexus_docker_repo__: { get_param: nexus_docker_repo } + __nexus_username__: { get_param: nexus_username } + __nexus_password__: { get_param: nexus_password } + __gitlab_username__: { get_param: gitlab_username } + __gitlab_password__: { get_param: gitlab_password } + __artifacts_version__: { get_param: artifacts_version } + template: | + #!/bin/bash + + # DNS/GW IP address configuration + mkdir /opt/config + echo "10.0.0.1" > /opt/config/dns_gw_ip.txt + echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head + resolvconf -u + + # Download dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk ntp ntpdate + + # Download scripts from Nexus + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/sdnc_vm_init.sh -o /opt/sdnc_vm_init.sh + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/sdnc_serv.sh -o /opt/sdnc_serv.sh + chmod +x /opt/sdnc_vm_init.sh + chmod +x /opt/sdnc_serv.sh + mv /opt/sdnc_serv.sh /etc/init.d + update-rc.d sdnc_serv.sh defaults + + # Download and install docker-engine and docker-compose + apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D + echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list + apt-get update + apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual + apt-get install -y docker-engine + service docker start + + mkdir /opt/docker + curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose + chmod +x /opt/docker/docker-compose + + # Store credentials in files + mkdir -p /opt/config + echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt + echo "__nexus_username__" > /opt/config/nexus_username.txt + echo "__nexus_password__" > /opt/config/nexus_password.txt + echo "__gitlab_username__" > /opt/config/gitlab_username.txt + echo "__gitlab_password__" > /opt/config/gitlab_password.txt + + # Run docker-compose to spin up containers + cd /opt + git clone https://__gitlab_username__:__gitlab_password__@gerrit.openecomp.org/r/a/sdnc/oam.git sdnc + ./sdnc_vm_init.sh + + + # SDC instantiation + sdc_private_port: + type: OS::Neutron::Port + properties: + network: { get_resource: oam_ecomp } + fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.3.1}] + + sdc_volume_local: + type: OS::Cinder::Volume + properties: + name: vol1-sdc-local + size: 50 + volume_type: SSD + image: Ubuntu 16.04 LTS (Xenial Xerus) (PVHVM) + + sdc_volume_data: + type: OS::Cinder::Volume + properties: + name: vol1-sdc-data + size: 100 + volume_type: SSD + + sdc_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_resource: sdc_volume_data } + instance_uuid: { get_resource: sdc_vm } + mountpoint: /dev/xvdb + + sdc_vm: + type: OS::Nova::Server + properties: + flavor: 15 GB Compute v1 + name: vm1-sdc + key_name: { get_resource: vm_key } + block_device_mapping: + - volume_id: { get_resource: sdc_volume_local } + device_name: vda + networks: + - network: { get_param: public_net_id } + - port: { get_resource: sdc_private_port } + user_data_format: RAW + user_data: + str_replace: + params: + __nexus_repo__: { get_param: nexus_repo } + __nexus_docker_repo__: { get_param: nexus_docker_repo } + __nexus_username__: { get_param: nexus_username } + __nexus_password__: { get_param: nexus_password } + __gitlab_username__: { get_param: gitlab_username } + __gitlab_password__: { get_param: gitlab_password } + __env_name__: { get_param: dmaap_topic } + __artifacts_version__: { get_param: artifacts_version } + template: | + #!/bin/bash + # DNS/GW IP address configuration + mkdir /opt/config + echo "10.0.0.1" > /opt/config/dns_gw_ip.txt + echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head + resolvconf -u + + # Download dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk ntp ntpdate + + # Download scripts from Nexus + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_vm_init.sh -o /opt/asdc_vm_init.sh + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_serv.sh -o /opt/asdc_serv.sh + chmod +x /opt/asdc_vm_init.sh + chmod +x /opt/asdc_serv.sh + mv /opt/asdc_serv.sh /etc/init.d + update-rc.d asdc_serv.sh defaults + + # Download and install docker-engine and docker-compose + apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D + echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list + apt-get update + apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual + apt-get install -y docker-engine + service docker start + mkdir /opt/docker + curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose + chmod +x /opt/docker/docker-compose + + # Create partition and mount the external volume + curl --user '__nexus_username__:__nexus_password__' __nexus_repo__/org.openecomp.boot/asdc_ext_volume_partitions.txt -o /opt/asdc_ext_volume_partitions.txt + sfdisk /dev/xvdb < /opt/asdc_ext_volume_partitions.txt + mkfs -t ext4 /dev/xvdb1 + mkdir -p /data + mount /dev/xvdb1 /data + echo "/dev/xvdb1 /data ext4 errors=remount-ro,noatime,barrier=0 0 1" >> /etc/fstab + + # Store credentials in files + mkdir -p /opt/config + echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt + echo "__nexus_username__" > /opt/config/nexus_username.txt + echo "__nexus_password__" > /opt/config/nexus_password.txt + echo "__gitlab_username__" > /opt/config/gitlab_username.txt + echo "__gitlab_password__" > /opt/config/gitlab_password.txt + echo "__env_name__" > /opt/config/env_name.txt + + # Run SDC-specific instructions + cd /opt + mkdir -p /data/environments + mkdir -p /data/scripts + mkdir -p /data/logs/BE + mkdir -p /data/logs/FE + chmod 775 /data + chmod 775 /data/logs/BE + chmod 775 /data/logs/FE + + git clone https://__gitlab_username__:__gitlab_password__@gerrit.openecomp.org/r/a/sdc.git + + cat > /root/.bash_aliases << EOF + alias dcls='/data/scripts/docker_clean.sh \$1' + alias dlog='/data/scripts/docker_login.sh \$1' + alias rund='/data/scripts/docker_run.sh' + alias health='/data/scripts/docker_health.sh' + EOF + + # Run docker-compose to spin up containers + ./asdc_vm_init.sh + + + # PORTAL instantiation + portal_private_port: + type: OS::Neutron::Port + properties: + network: { get_resource: oam_ecomp } + fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.9.1}] + + portal_volume: + type: OS::Cinder::Volume + properties: + name: vol1-portal + size: 50 + volume_type: SSD + image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) + + portal_vm: + type: OS::Nova::Server + properties: + flavor: 15 GB Memory v1 + name: vm1-portal + key_name: { get_resource: vm_key } + block_device_mapping: + - volume_id: { get_resource: portal_volume } + device_name: vda + networks: + - network: { get_param: public_net_id } + - port: { get_resource: portal_private_port } + user_data_format: RAW + user_data: + str_replace: + params: + __nexus_repo__: { get_param: nexus_repo } + __nexus_docker_repo__: { get_param: nexus_docker_repo } + __nexus_username__: { get_param: nexus_username } + __nexus_password__: { get_param: nexus_password } + __gitlab_username__: { get_param: gitlab_username } + __gitlab_password__: { get_param: gitlab_password } + __artifacts_version__: { get_param: artifacts_version } + template: | + #!/bin/bash + # DNS/GW IP address configuration + mkdir /opt/config + echo "10.0.0.1" > /opt/config/dns_gw_ip.txt + echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head + resolvconf -u + + # Download dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk unzip mysql-client-core-5.6 ntp ntpdate + + # Download scripts from Nexus + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/portal_vm_init.sh -o /opt/portal_vm_init.sh + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/portal_serv.sh -o /opt/portal_serv.sh + chmod +x /opt/portal_vm_init.sh + chmod +x /opt/portal_serv.sh + mv /opt/portal_serv.sh /etc/init.d + update-rc.d portal_serv.sh defaults + + # Download and install docker-engine and docker-compose + apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D + echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list + apt-get update + apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual + apt-get install -y docker-engine + service docker start + mkdir /opt/docker + curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose + chmod +x /opt/docker/docker-compose + + # Store credentials in files + mkdir -p /opt/config + echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt + echo "__nexus_username__" > /opt/config/nexus_username.txt + echo "__nexus_password__" > /opt/config/nexus_password.txt + echo "__gitlab_username__" > /opt/config/gitlab_username.txt + echo "__gitlab_password__" > /opt/config/gitlab_password.txt + + # Run Portal-specific instructions + mkdir -p /PROJECT/OpenSource/UbuntuEP/logs + cd /opt + git clone https://__gitlab_username__:__gitlab_password__@gerrit.openecomp.org/r/a/portal.git + + # Run docker-compose to spin up containers + ./portal_vm_init.sh + + + # DCAE Controller instantiation + dcae_c_private_port: + type: OS::Neutron::Port + properties: + network: { get_resource: oam_ecomp } + fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.4.1}] + dcae_c_vm: + type: OS::Nova::Server + properties: + image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) + flavor: 8 GB General Purpose v1 + name: vm1-dcae-controller + key_name: { get_resource: vm_key } + networks: + - network: { get_param: public_net_id } + - port: { get_resource: dcae_c_private_port } + user_data_format: RAW + user_data: + str_replace: + params: + __nexus_repo__: { get_param: nexus_repo } + __nexus_docker_repo__: { get_param: nexus_docker_repo } + __nexus_username__: { get_param: nexus_username } + __nexus_password__: { get_param: nexus_password } + __nexus_url_snapshots__: { get_param: nexus_url_snapshot } + __gitlab_username__: { get_param: gitlab_username } + __gitlab_password__: { get_param: gitlab_password } + __gitlab_branch__: { get_param: gitlab_branch } + __dcae_zone__: { get_param: dcae_zone } + __dcae_state__: { get_param: dcae_state } + __artifacts_version__: { get_param: artifacts_version } + __tenant_id__: { get_param: openstack_tenant_id } + __openstack_private_network_name__: { get_attr: [oam_ecomp, name] } + __openstack_user__: { get_param: openstack_username } + __openstack_password__: { get_param: openstack_api_key } + __key_name__: { get_param: key_name } + __rand_str__: { get_resource: random-str } + __pub_key__: { get_param: pub_key } + __nexus_repo_root__: { get_param: nexus_repo_root } + __openstack_region__: { get_param: openstack_region } + template: | + #!/bin/bash + # DNS/GW IP address configuration + echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head + resolvconf -u + + # Download dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk make git ntp ntpdate + + # Download scripts from Nexus + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/dcae_vm_init.sh -o /opt/dcae_vm_init.sh + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/dcae_serv.sh -o /opt/dcae_serv.sh + chmod +x /opt/dcae_vm_init.sh + chmod +x /opt/dcae_serv.sh + mv /opt/dcae_serv.sh /etc/init.d + update-rc.d dcae_serv.sh defaults + + # Download and install docker-engine and docker-compose + apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D + echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list + apt-get update + apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual + apt-get install -y docker-engine + service docker start + mkdir /opt/docker + curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose + chmod +x /opt/docker/docker-compose + + # DCAE Controller specific deployment + cd /opt + git clone https://__gitlab_username__:__gitlab_password__@gerrit.openecomp.org/r/a/dcae/demo/startup/controller.git dcae-startup-vm-controller + + cd dcae-startup-vm-controller + mkdir -p /opt/app/dcae-controller + cat > /opt/app/dcae-controller/config.yaml << EOF_CONFIG + ZONE: __dcae_zone__ + STATE: __dcae_state__ + DCAE-VERSION: 0.1.0-SNAPSHOT + HORIZON-URL: https://mycloud.rackspace.com/cloud/__tenant_id__ + KEYSTONE-URL: https://identity.api.rackspacecloud.com/v2.0 + OPENSTACK-TENANT-ID: __tenant_id__ + OPENSTACK-TENANT-NAME: OPEN-ECOMP + OPENSTACK-REGION: __openstack_region__ + OPENSTACK-PRIVATE-NETWORK: __openstack_private_network_name__ + OPENSTACK-USER: __openstack_user__ + OPENSTACK-PASSWORD: __openstack_password__ + OPENSTACK-KEYNAME: __key_name_____rand_str___dcae + OPENSTACK-PUBKEY: __pub_key__ + + NEXUS-URL-ROOT: __nexus_repo_root__ + NEXUS-USER: __nexus_username__ + NEXUS-PASSWORD: __nexus_password__ + NEXUS-URL-SNAPSHOTS: __nexus_url_snapshots__ + NEXUS-RAWURL: __nexus_repo__ + + DOCKER-REGISTRY: __nexus_docker_repo__ + + GIT-MR-REPO: https://__gitlab_username__:__gitlab_password__@gerrit.openecomp.org/r/a/dcae/demo/startup/message-router.git + EOF_CONFIG + + # Store credentials in files + mkdir -p /opt/config + echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt + echo "__nexus_username__" > /opt/config/nexus_username.txt + echo "__nexus_password__" > /opt/config/nexus_password.txt + echo "__gitlab_username__" > /opt/config/gitlab_username.txt + echo "__gitlab_password__" > /opt/config/gitlab_password.txt + echo "__gitlab_branch__" > /opt/config/gitlab_branch.txt + + cd /opt + ./dcae_vm_init.sh + + + # Policy engine instantiation + policy_private_port: + type: OS::Neutron::Port + properties: + network: { get_resource: oam_ecomp } + fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.6.1}] + + policy_volume: + type: OS::Cinder::Volume + properties: + name: vol1-policy + size: 50 + volume_type: SSD + image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) + + policy_vm: + type: OS::Nova::Server + properties: + flavor: 15 GB Compute v1 + name: vm1-policy + key_name: { get_resource: vm_key } + block_device_mapping: + - volume_id: { get_resource: policy_volume } + device_name: vda + networks: + - network: { get_param: public_net_id } + - port: { get_resource: policy_private_port } + user_data_format: RAW + user_data: + str_replace: + params: + __nexus_repo__: { get_param: nexus_repo } + __nexus_docker_repo__: { get_param: nexus_docker_repo } + __nexus_username__: { get_param: nexus_username } + __nexus_password__: { get_param: nexus_password } + __gitlab_username__: { get_param: gitlab_username } + __gitlab_password__: { get_param: gitlab_password } + __artifacts_version__: { get_param: artifacts_version } + template: | + #!/bin/bash + # DNS/GW IP address configuration + mkdir /opt/config + echo "10.0.0.1" > /opt/config/dns_gw_ip.txt + echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head + resolvconf -u + + # Download dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk ntp ntpdate + + # Download scripts from Nexus + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/policy_vm_init.sh -o /opt/policy_vm_init.sh + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/policy_serv.sh -o /opt/policy_serv.sh + chmod +x /opt/policy_vm_init.sh + chmod +x /opt/policy_serv.sh + mv /opt/policy_serv.sh /etc/init.d + update-rc.d policy_serv.sh defaults + + # Download and install docker-engine and docker-compose + apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D + echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list + apt-get update + apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual + apt-get install -y docker-engine + service docker start + mkdir /opt/docker + curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose + chmod +x /opt/docker/docker-compose + + # Store credentials in files + mkdir -p /opt/config + echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt + echo "__nexus_username__" > /opt/config/nexus_username.txt + echo "__nexus_password__" > /opt/config/nexus_password.txt + echo "__gitlab_username__" > /opt/config/gitlab_username.txt + echo "__gitlab_password__" > /opt/config/gitlab_password.txt + + # Run docker-compose to spin up containers + cd /opt + git clone https://__gitlab_username__:__gitlab_password__@gerrit.openecomp.org/r/a/policy/docker.git policy + + ./policy_vm_init.sh + + + # APP-C instantiation + appc_private_port: + type: OS::Neutron::Port + properties: + network: { get_resource: oam_ecomp } + fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.2.1}] + + appc_vm: + type: OS::Nova::Server + properties: + image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) + flavor: 4 GB General Purpose v1 + name: vm1-appc + key_name: { get_resource: vm_key } + networks: + - network: { get_param: public_net_id } + - port: { get_resource: appc_private_port } + user_data_format: RAW + user_data: + str_replace: + params: + __nexus_repo__: { get_param: nexus_repo } + __nexus_docker_repo__: { get_param: nexus_docker_repo } + __nexus_username__: { get_param: nexus_username } + __nexus_password__: { get_param: nexus_password } + __gitlab_username__: { get_param: gitlab_username } + __gitlab_password__: { get_param: gitlab_password } + __dmaap_topic__: { get_param: dmaap_topic } + __artifacts_version__: { get_param: artifacts_version } + template: | + #!/bin/bash + + # DNS/GW IP address configuration + mkdir /opt/config + echo "10.0.0.1" > /opt/config/dns_gw_ip.txt + echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head + resolvconf -u + + # Download dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y apt-transport-https ca-certificates wget openjdk-7-jdk ntp ntpdate + + # Download scripts from Nexus + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/appc_vm_init.sh -o /opt/appc_vm_init.sh + curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/appc_serv.sh -o /opt/appc_serv.sh + chmod +x /opt/appc_vm_init.sh + chmod +x /opt/appc_serv.sh + mv /opt/appc_serv.sh /etc/init.d + update-rc.d appc_serv.sh defaults + + # Download and install docker-engine and docker-compose + apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D + echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list + apt-get update + apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual + apt-get install -y docker-engine + service docker start + + mkdir /opt/docker + curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose + chmod +x /opt/docker/docker-compose + + # Store credentials in files + mkdir -p /opt/config + echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt + echo "__nexus_username__" > /opt/config/nexus_username.txt + echo "__nexus_password__" > /opt/config/nexus_password.txt + echo "__gitlab_username__" > /opt/config/gitlab_username.txt + echo "__gitlab_password__" > /opt/config/gitlab_password.txt + echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt + + # Run docker-compose to spin up containers + cd /opt + git clone https://__gitlab_username__:__gitlab_password__@gerrit.openecomp.org/r/a/appc/deployment.git appc + ./appc_vm_init.sh + diff --git a/heat/vFW/base_vfw.env b/heat/vFW/base_vfw.env new file mode 100644 index 00000000..8223a6af --- /dev/null +++ b/heat/vFW/base_vfw.env @@ -0,0 +1,30 @@ +parameters: + vfw_image_name: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) + vfw_flavor_name: 4 GB General Purpose v1 + public_net_id: 00000000-0000-0000-0000-000000000000 + unprotected_private_net_id: zdfw1fwl01_unprotected + protected_private_net_id: zdfw1fwl01_protected + ecomp_private_net_id: oam_ecomp + ecomp_private_subnet_id: oam_ecomp + unprotected_private_net_cidr: 192.168.10.0/24 + protected_private_net_cidr: 192.168.20.0/24 + ecomp_private_net_cidr: 10.0.0.0/8 + vfw_private_ip_0: 192.168.10.100 + vfw_private_ip_1: 192.168.20.100 + vfw_private_ip_2: 10.1.0.1 + vpg_private_ip_0: 192.168.10.200 + vpg_private_ip_1: 10.1.0.2 + vsn_private_ip_0: 192.168.20.250 + vsn_private_ip_1: 10.1.0.3 + vfw_name_0: zdfw1fwl01fwl01 + vpg_name_0: zdfw1fwl01pgn01 + vsn_name_0: zdfw1fwl01snk01 + vnf_id: vFirewall_demo_app + vf_module_id: vFirewall + dcae_collector_ip: 10.0.4.102 + dcae_collector_port: 8080 + repo_url_blob: https://nexus.openecomp.org/content/repositories/raw + repo_url_artifacts: https://nexus.openecomp.org/content/repositories/snapshots + demo_artifacts_version: 1.0.0-SNAPSHOT + key_name: vfw_key + pub_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQXYJYYi3/OUZXUiCYWdtc7K0m5C0dJKVxPG0eI8EWZrEHYdfYe6WoTSDJCww+1qlBSpA5ac/Ba4Wn9vh+lR1vtUKkyIC/nrYb90ReUd385Glkgzrfh5HdR5y5S2cL/Frh86lAn9r6b3iWTJD8wBwXFyoe1S2nMTOIuG4RPNvfmyCTYVh8XTCCE8HPvh3xv2r4egawG1P4Q4UDwk+hDBXThY2KS8M5/8EMyxHV0ImpLbpYCTBA6KYDIRtqmgS6iKyy8v2D1aSY5mc9J0T5t9S2Gv+VZQNWQDDKNFnxqYaAo1uEoq/i1q63XC5AD3ckXb2VT6dp23BQMdDfbHyUWfJN diff --git a/heat/vFW/base_vfw.yaml b/heat/vFW/base_vfw.yaml new file mode 100644 index 00000000..a7df854a --- /dev/null +++ b/heat/vFW/base_vfw.yaml @@ -0,0 +1,423 @@ +heat_template_version: 2013-05-23 + +description: Heat template to deploy vFirewall demo app for OpenECOMP + +parameters: + vfw_image_name: + type: string + label: Image name or ID + description: Image to be used for compute instance + vfw_flavor_name: + type: string + label: Flavor + description: Type of instance (flavor) to be used + public_net_id: + type: string + label: Public network name or ID + description: Public network that enables remote connection to VNF + unprotected_private_net_id: + type: string + label: Unprotected private network name or ID + description: Private network that connects vPacketGenerator with vFirewall + protected_private_net_id: + type: string + label: Protected private network name or ID + description: Private network that connects vFirewall with vSink + ecomp_private_net_id: + type: string + label: ECOMP management network name or ID + description: Private network that connects ECOMP component and the VNF + ecomp_private_subnet_id: + type: string + label: ECOMP management sub-network name or ID + description: Private sub-network that connects ECOMP component and the VNF + unprotected_private_net_cidr: + type: string + label: Unprotected private network CIDR + description: The CIDR of the unprotected private network + protected_private_net_cidr: + type: string + label: Protected private network CIDR + description: The CIDR of the protected private network + ecomp_private_net_cidr: + type: string + label: ECOMP private network CIDR + description: The CIDR of the protected private network + vfw_private_ip_0: + type: string + label: vFirewall private IP address towards the unprotected network + description: Private IP address that is assigned to the vFirewall to communicate with the vPacketGenerator + vfw_private_ip_1: + type: string + label: vFirewall private IP address towards the protected network + description: Private IP address that is assigned to the vFirewall to communicate with the vSink + vfw_private_ip_2: + type: string + label: vFirewall private IP address towards the ECOMP management network + description: Private IP address that is assigned to the vFirewall to communicate with ECOMP components + vpg_private_ip_0: + type: string + label: vPacketGenerator private IP address towards the unprotected network + description: Private IP address that is assigned to the vPacketGenerator to communicate with the vFirewall + vpg_private_ip_1: + type: string + label: vPacketGenerator private IP address towards the ECOMP management network + description: Private IP address that is assigned to the vPacketGenerator to communicate with ECOMP components + vsn_private_ip_0: + type: string + label: vSink private IP address towards the protected network + description: Private IP address that is assigned to the vSink to communicate with the vFirewall + vsn_private_ip_1: + type: string + label: vSink private IP address towards the ECOMP management network + description: Private IP address that is assigned to the vSink to communicate with ECOMP components + vfw_name_0: + type: string + label: vFirewall name + description: Name of the vFirewall + vpg_name_0: + type: string + label: vPacketGenerator name + description: Name of the vPacketGenerator + vsn_name_0: + type: string + label: vSink name + description: Name of the vSink + vnf_id: + type: string + label: VNF ID + description: The VNF ID is provided by ECOMP + vf_module_id: + type: string + label: vFirewall module ID + description: The vFirewall Module ID is provided by ECOMP + dcae_collector_ip: + type: string + label: DCAE collector IP address + description: IP address of the DCAE collector + dcae_collector_port: + type: string + label: DCAE collector port + description: Port of the DCAE collector + key_name: + type: string + label: Key pair name + description: Public/Private key pair name + pub_key: + type: string + label: Public key + description: Public key to be installed on the compute instance + repo_url_blob: + type: string + label: Repository URL + description: URL of the repository that hosts the demo packages + repo_url_artifacts: + type: string + label: Repository URL + description: URL of the repository that hosts the demo packages + demo_artifacts_version: + type: string + label: Artifacts version used in demo vnfs + description: Artifacts (jar, tar.gz) version used in demo vnfs + +resources: + + random-str: + type: OS::Heat::RandomString + properties: + length: 4 + + my_keypair: + type: OS::Nova::KeyPair + properties: + name: + str_replace: + template: base_rand + params: + base: { get_param: key_name } + rand: { get_resource: random-str } + public_key: { get_param: pub_key } + save_private_key: false + + unprotected_private_network: + type: OS::Neutron::Net + properties: + name: { get_param: unprotected_private_net_id } + + protected_private_network: + type: OS::Neutron::Net + properties: + name: { get_param: protected_private_net_id } + + unprotected_private_subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: unprotected_private_network } + cidr: { get_param: unprotected_private_net_cidr } + + protected_private_subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: protected_private_network } + cidr: { get_param: protected_private_net_cidr } + + vfw_0: + type: OS::Nova::Server + properties: + image: { get_param: vfw_image_name } + flavor: { get_param: vfw_flavor_name } + name: { get_param: vfw_name_0 } + key_name: { get_resource: my_keypair } + networks: + - network: { get_param: public_net_id } + - port: { get_resource: vfw_private_0_port } + - port: { get_resource: vfw_private_1_port } + - port: { get_resource: vfw_private_2_port } + metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }} + user_data_format: RAW + user_data: + str_replace: + params: + __dcae_collector_ip__ : { get_param: dcae_collector_ip } + __dcae_collector_port__ : { get_param: dcae_collector_port } + __repo_url_blob__ : { get_param: repo_url_blob } + __repo_url_artifacts__ : { get_param: repo_url_artifacts } + __demo_artifacts_version__ : { get_param: demo_artifacts_version } + template: | + #!/bin/bash + + DCAE_COLLECTOR_IP=__dcae_collector_ip__ + DCAE_COLLECTOR_PORT=__dcae_collector_port__ + REPO_URL_BLOB=__repo_url_blob__ + REPO_URL_ARTIFACTS=__repo_url_artifacts__ + DEMO_ARTIFACTS_VERSION=__demo_artifacts_version__ + + # Download required dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y make wget openjdk-8-jdk gcc libcurl4-openssl-dev python-pip bridge-utils apt-transport-https ca-certificates + apt-get install -y maven + pip install jsonschema + + # Download vFirewall code for virtual firewall + mkdir /opt/config + mkdir /opt/honeycomb + cd /opt + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vfw/$DEMO_ARTIFACTS_VERSION/v_firewall_init.sh + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vfw/$DEMO_ARTIFACTS_VERSION/vfirewall.sh + + mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DremoteRepositories=$REPO_URL_ARTIFACTS -Dartifact=org.openecomp.demo.vnf:sample-distribution:$DEMO_ARTIFACTS_VERSION:tar.gz:hc -Dtransitive=false -Ddest=. + mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DremoteRepositories=$REPO_URL_ARTIFACTS -Dartifact=org.openecomp.demo.vnf.ves:ves:$DEMO_ARTIFACTS_VERSION:tar.gz:demo -Dtransitive=false -Ddest=. + mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DremoteRepositories=$REPO_URL_ARTIFACTS -Dartifact=org.openecomp.demo.vnf.ves:ves_vfw_reporting:$DEMO_ARTIFACTS_VERSION:tar.gz:demo -Dtransitive=false -Ddest=. + + + tar -zxvf ves-$DEMO_ARTIFACTS_VERSION-demo.tar.gz + mv ves-$DEMO_ARTIFACTS_VERSION VES + tar -zxvf ves_vfw_reporting-$DEMO_ARTIFACTS_VERSION-demo.tar.gz + mv ves_vfw_reporting-$DEMO_ARTIFACTS_VERSION VESreporting_vFW + tar -zxvf sample-distribution-$DEMO_ARTIFACTS_VERSION-hc.tar.gz + mv sample-distribution-$DEMO_ARTIFACTS_VERSION honeycomb + sed -i 's/"restconf-binding-address": "127.0.0.1",/"restconf-binding-address": "0.0.0.0",/g' honeycomb/sample-distribution-$DEMO_ARTIFACTS_VERSION/config/honeycomb.json + mv VESreporting_vFW /opt/VES/code/evel_training/VESreporting + rm *.tar.gz + chmod +x v_firewall_init.sh + chmod +x vfirewall.sh + echo $DCAE_COLLECTOR_IP > config/dcae_collector_ip.txt + echo $DCAE_COLLECTOR_PORT > config/dcae_collector_port.txt + echo $DEMO_ARTIFACTS_VERSION > config/artifacts_version.txt + + # Install VPP + export UBUNTU="trusty" + export RELEASE=".stable.1609" + rm /etc/apt/sources.list.d/99fd.io.list + echo "deb [trusted=yes] https://nexus.fd.io/content/repositories/fd.io$RELEASE.ubuntu.$UBUNTU.main/ ./" | sudo tee -a /etc/apt/sources.list.d/99fd.io.list + apt-get update + apt-get install -y vpp vpp-dpdk-dkms vpp-lib vpp-dbg vpp-plugins vpp-dev + sleep 1 + + # Install VES + cd /opt/VES/bldjobs/ + make clean + make + sleep 1 + + # Run instantiation script + cd /opt + mv vfirewall.sh /etc/init.d + update-rc.d vfirewall.sh defaults + ./v_firewall_init.sh + + vfw_private_0_port: + type: OS::Neutron::Port + properties: + network: { get_resource: unprotected_private_network } + fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vfw_private_ip_0 }}] + + vfw_private_1_port: + type: OS::Neutron::Port + properties: + network: { get_resource: protected_private_network } + fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vfw_private_ip_1 }}] + + vfw_private_2_port: + type: OS::Neutron::Port + properties: + network: { get_param: ecomp_private_net_id } + fixed_ips: [{"subnet": { get_param: ecomp_private_subnet_id }, "ip_address": { get_param: vfw_private_ip_2 }}] + + vpg_0: + type: OS::Nova::Server + properties: + image: { get_param: vfw_image_name } + flavor: { get_param: vfw_flavor_name } + name: { get_param: vpg_name_0 } + key_name: { get_resource: my_keypair } + networks: + - network: { get_param: public_net_id } + - port: { get_resource: vpg_private_0_port } + - port: { get_resource: vpg_private_1_port } + metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }} + user_data_format: RAW + user_data: + str_replace: + params: + __fw_ipaddr__: { get_param: vfw_private_ip_0 } + __protected_net_cidr__: { get_param: protected_private_net_cidr } + __sink_ipaddr__: { get_param: vsn_private_ip_0 } + __repo_url_blob__ : { get_param: repo_url_blob } + __repo_url_artifacts__ : { get_param: repo_url_artifacts } + __demo_artifacts_version__ : { get_param: demo_artifacts_version } + template: | + #!/bin/bash + + FW_IPADDR=__fw_ipaddr__ + PROTECTED_NET_CIDR=__protected_net_cidr__ + SINK_IPADDR=__sink_ipaddr__ + REPO_URL_BLOB=__repo_url_blob__ + REPO_URL_ARTIFACTS=__repo_url_artifacts__ + DEMO_ARTIFACTS_VERSION=__demo_artifacts_version__ + + # Download required dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y make wget openjdk-8-jdk gcc libcurl4-openssl-dev python-pip bridge-utils apt-transport-https ca-certificates + apt-get install -y maven + pip install jsonschema + + # Download vFirewall demo code for packet generator + mkdir /opt/config + mkdir /opt/honeycomb + cd /opt + + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vfw/$DEMO_ARTIFACTS_VERSION/v_packetgen_init.sh + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vfw/$DEMO_ARTIFACTS_VERSION/vpacketgen.sh + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vfw/$DEMO_ARTIFACTS_VERSION/run_traffic_fw_demo.sh + + mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DremoteRepositories=$REPO_URL_ARTIFACTS -Dartifact=org.openecomp.demo.vnf:sample-distribution:$DEMO_ARTIFACTS_VERSION:tar.gz:hc -Dtransitive=false -Ddest=. + mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DremoteRepositories=$REPO_URL_ARTIFACTS -Dartifact=org.openecomp.demo.vnf.vfw:vfw_pg_streams:$DEMO_ARTIFACTS_VERSION:tar.gz:demo -Dtransitive=false -Ddest=. + + + tar -zxvf sample-distribution-$DEMO_ARTIFACTS_VERSION-hc.tar.gz + tar -zxvf vfw_pg_streams-$DEMO_ARTIFACTS_VERSION-demo.tar.gz + mv vfw_pg_streams-$DEMO_ARTIFACTS_VERSION pg_streams + mv sample-distribution-$DEMO_ARTIFACTS_VERSION honeycomb + sed -i 's/"restconf-binding-address": "127.0.0.1",/"restconf-binding-address": "0.0.0.0",/g' honeycomb/sample-distribution-$DEMO_ARTIFACTS_VERSION/config/honeycomb.json + rm *.tar.gz + chmod +x v_packetgen_init.sh + chmod +x vpacketgen.sh + echo $FW_IPADDR > config/fw_ipaddr.txt + echo $PROTECTED_NET_CIDR > config/protected_net_cidr.txt + echo $SINK_IPADDR > config/sink_ipaddr.txt + echo $DEMO_ARTIFACTS_VERSION > config/artifacts_version.txt + + # Install VPP + export UBUNTU="trusty" + export RELEASE=".stable.1609" + rm /etc/apt/sources.list.d/99fd.io.list + echo "deb [trusted=yes] https://nexus.fd.io/content/repositories/fd.io$RELEASE.ubuntu.$UBUNTU.main/ ./" | sudo tee -a /etc/apt/sources.list.d/99fd.io.list + apt-get update + apt-get install -y vpp vpp-dpdk-dkms vpp-lib vpp-dbg vpp-plugins vpp-dev + sleep 1 + + # Run instantiation script + cd /opt + mv vpacketgen.sh /etc/init.d + update-rc.d vpacketgen.sh defaults + ./v_packetgen_init.sh + + vpg_private_0_port: + type: OS::Neutron::Port + properties: + network: { get_resource: unprotected_private_network } + fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vpg_private_ip_0 }}] + + vpg_private_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: ecomp_private_net_id } + fixed_ips: [{"subnet": { get_param: ecomp_private_subnet_id }, "ip_address": { get_param: vpg_private_ip_1 }}] + + vsn_0: + type: OS::Nova::Server + properties: + image: { get_param: vfw_image_name } + flavor: { get_param: vfw_flavor_name } + name: { get_param: vsn_name_0 } + key_name: { get_resource: my_keypair } + networks: + - network: { get_param: public_net_id } + - port: { get_resource: vsn_private_0_port } + - port: { get_resource: vsn_private_1_port } + metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }} + user_data_format: RAW + user_data: + str_replace: + params: + __protected_net_gw__: { get_param: vfw_private_ip_1 } + __unprotected_net__: { get_param: unprotected_private_net_cidr } + __repo_url_blob__ : { get_param: repo_url_blob } + __repo_url_artifacts__ : { get_param: repo_url_artifacts } + __demo_artifacts_version__ : { get_param: demo_artifacts_version } + template: | + #!/bin/bash + + PROTECTED_NET_GW=__protected_net_gw__ + UNPROTECTED_NET=__unprotected_net__ + UNPROTECTED_NET=$(echo $UNPROTECTED_NET | cut -d'/' -f1) + REPO_URL_BLOB=__repo_url_blob__ + REPO_URL_ARTIFACTS=__repo_url_artifacts__ + DEMO_ARTIFACTS_VERSION=__demo_artifacts_version__ + + # Download required dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y make wget openjdk-8-jdk apt-transport-https ca-certificates darkstat + + # Configure and run darkstat + sed -i "s/START_DARKSTAT=.*/START_DARKSTAT=yes/g" /etc/darkstat/init.cfg + sed -i "s/INTERFACE=.*/INTERFACE=\"-i eth1\"/g" /etc/darkstat/init.cfg + /etc/init.d/darkstat start + + mkdir /opt/config + cd /opt + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vfw/$DEMO_ARTIFACTS_VERSION/v_sink_init.sh + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vfw/$DEMO_ARTIFACTS_VERSION/vsink.sh + chmod +x v_sink_init.sh + chmod +x vsink.sh + echo $PROTECTED_NET_GW > config/protected_net_gw.txt + echo $UNPROTECTED_NET > config/unprotected_net.txt + mv vsink.sh /etc/init.d + update-rc.d vsink.sh defaults + ./v_sink_init.sh + + vsn_private_0_port: + type: OS::Neutron::Port + properties: + network: { get_resource: protected_private_network } + fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vsn_private_ip_0 }}] + + vsn_private_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: ecomp_private_net_id } + fixed_ips: [{"subnet": { get_param: ecomp_private_subnet_id }, "ip_address": { get_param: vsn_private_ip_1 }}] diff --git a/heat/vLB/base_vlb.env b/heat/vLB/base_vlb.env new file mode 100644 index 00000000..2598a384 --- /dev/null +++ b/heat/vLB/base_vlb.env @@ -0,0 +1,24 @@ +parameters: + vlb_image_name: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) + vlb_flavor_name: 4 GB General Purpose v1 + public_net_id: 00000000-0000-0000-0000-000000000000 + vlb_private_net_id: zdfw1lb01_private + ecomp_private_net_id: oam_ecomp + ecomp_private_subnet_id: oam_ecomp + vlb_private_net_cidr: 192.168.10.0/24 + ecomp_private_net_cidr: 10.0.0.0/8 + vlb_private_ip_0: 192.168.10.111 + vlb_private_ip_1: 10.1.0.4 + vdns_private_ip_0: 192.168.10.211 + vdns_private_ip_1: 10.1.0.5 + vlb_name_0: zdfw1lb01lb01 + vdns_name_0: zdfw1lb01dns01 + vnf_id: vLoadBalancer_demo_app + vf_module_id: vLoadBalancer + dcae_collector_ip: 10.0.4.102 + dcae_collector_port: 8080 + repo_url_blob: https://nexus.openecomp.org/content/repositories/raw + repo_url_artifacts: https://nexus.openecomp.org/content/repositories/snapshots + demo_artifacts_version: 1.0.0-SNAPSHOT + key_name: vlb_key + pub_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQXYJYYi3/OUZXUiCYWdtc7K0m5C0dJKVxPG0eI8EWZrEHYdfYe6WoTSDJCww+1qlBSpA5ac/Ba4Wn9vh+lR1vtUKkyIC/nrYb90ReUd385Glkgzrfh5HdR5y5S2cL/Frh86lAn9r6b3iWTJD8wBwXFyoe1S2nMTOIuG4RPNvfmyCTYVh8XTCCE8HPvh3xv2r4egawG1P4Q4UDwk+hDBXThY2KS8M5/8EMyxHV0ImpLbpYCTBA6KYDIRtqmgS6iKyy8v2D1aSY5mc9J0T5t9S2Gv+VZQNWQDDKNFnxqYaAo1uEoq/i1q63XC5AD3ckXb2VT6dp23BQMdDfbHyUWfJN diff --git a/heat/vLB/base_vlb.yaml b/heat/vLB/base_vlb.yaml new file mode 100644 index 00000000..d65846fc --- /dev/null +++ b/heat/vLB/base_vlb.yaml @@ -0,0 +1,340 @@ +heat_template_version: 2013-05-23 + +description: Heat template to deploy vLoadBalancer/vDNS demo app for OpenECOMP + +parameters: + vlb_image_name: + type: string + label: Image name or ID + description: Image to be used for compute instance + vlb_flavor_name: + type: string + label: Flavor + description: Type of instance (flavor) to be used + public_net_id: + type: string + label: Public network name or ID + description: Public network that enables remote connection to VNF + vlb_private_net_id: + type: string + label: vLoadBalancer private network name or ID + description: Private network that connects vLoadBalancer with vDNSs + ecomp_private_net_id: + type: string + label: ECOMP management network name or ID + description: Private network that connects ECOMP component and the VNF + ecomp_private_subnet_id: + type: string + label: ECOMP management sub-network name or ID + description: Private sub-network that connects ECOMP component and the VNF + vlb_private_net_cidr: + type: string + label: vLoadBalancer private network CIDR + description: The CIDR of the vLoadBalancer private network + ecomp_private_net_cidr: + type: string + label: ECOMP private network CIDR + description: The CIDR of the protected private network + vlb_private_ip_0: + type: string + label: vLoadBalancer private IP address towards the private network + description: Private IP address that is assigned to the vLoadBalancer to communicate with the vDNSs + vlb_private_ip_1: + type: string + label: vLoadBalancer private IP address towards the ECOMP management network + description: Private IP address that is assigned to the vLoadBalancer to communicate with ECOMP components + vdns_private_ip_0: + type: string + label: vDNS private IP address towards the private network + description: Private IP address that is assigned to the vDNS to communicate with the vLoadBalancer + vdns_private_ip_1: + type: string + label: vDNS private IP address towards the ECOMP management network + description: Private IP address that is assigned to the vDNS to communicate with ECOMP components + vlb_name_0: + type: string + label: vLoadBalancer name + description: Name of the vLoadBalancer + vdns_name_0: + type: string + label: vDNS name + description: Name of the vDNS + vnf_id: + type: string + label: VNF ID + description: The VNF ID is provided by ECOMP + vf_module_id: + type: string + label: vFirewall module ID + description: The vLoadBalancer Module ID is provided by ECOMP + dcae_collector_ip: + type: string + label: DCAE collector IP address + description: IP address of the DCAE collector + dcae_collector_port: + type: string + label: DCAE collector port + description: Port of the DCAE collector + key_name: + type: string + label: Key pair name + description: Public/Private key pair name + pub_key: + type: string + label: Public key + description: Public key to be installed on the compute instance + repo_url_blob: + type: string + label: Repository URL + description: URL of the repository that hosts the demo packages + repo_url_artifacts: + type: string + label: Repository URL + description: URL of the repository that hosts the demo packages + demo_artifacts_version: + type: string + label: Artifacts version used in demo vnfs + description: Artifacts (jar, tar.gz) version used in demo vnfs + +resources: + + random-str: + type: OS::Heat::RandomString + properties: + length: 4 + + my_keypair: + type: OS::Nova::KeyPair + properties: + name: + str_replace: + template: base_rand + params: + base: { get_param: key_name } + rand: { get_resource: random-str } + public_key: { get_param: pub_key } + save_private_key: false + + vlb_private_network: + type: OS::Neutron::Net + properties: + name: { get_param: vlb_private_net_id } + + vlb_private_subnet: + type: OS::Neutron::Subnet + properties: + name: { get_param: vlb_private_net_id } + network_id: { get_resource: vlb_private_network } + cidr: { get_param: vlb_private_net_cidr } + + vlb_0: + type: OS::Nova::Server + properties: + image: { get_param: vlb_image_name } + flavor: { get_param: vlb_flavor_name } + name: { get_param: vlb_name_0 } + key_name: { get_resource: my_keypair } + networks: + - network: { get_param: public_net_id } + - port: { get_resource: vlb_private_0_port } + - port: { get_resource: vlb_private_1_port } + metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }} + user_data_format: RAW + user_data: + str_replace: + params: + __dcae_collector_ip__: { get_param: dcae_collector_ip } + __dcae_collector_port__: { get_param: dcae_collector_port } + __local_private_ipaddr__: { get_param: vlb_private_ip_0 } + __repo_url_blob__ : { get_param: repo_url_blob } + __repo_url_artifacts__ : { get_param: repo_url_artifacts } + __demo_artifacts_version__ : { get_param: demo_artifacts_version } + template: | + #!/bin/bash + + DCAE_COLLECTOR_IP=__dcae_collector_ip__ + DCAE_COLLECTOR_PORT=__dcae_collector_port__ + LOCAL_PRIVATE_IPADDR=__local_private_ipaddr__ + REPO_URL_BLOB=__repo_url_blob__ + REPO_URL_ARTIFACTS=__repo_url_artifacts__ + DEMO_ARTIFACTS_VERSION=__demo_artifacts_version__ + + # Download required dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y make gcc wget openjdk-8-jdk bridge-utils libcurl4-openssl-dev apt-transport-https ca-certificates + apt-get install -y maven + sleep 1 + + # Download vLB demo code for load balancer + mkdir /opt/config + mkdir /opt/FDserver + cd /opt + + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/v_lb_init.sh + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/vlb.sh + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/dnsmembership.sh + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/add_dns.sh + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/remove_dns.sh + + mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DremoteRepositories=$REPO_URL_ARTIFACTS -Dartifact=org.openecomp.demo.vnf.vlb:dns-manager:$DEMO_ARTIFACTS_VERSION:jar -Dtransitive=false -Ddest=. + mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DremoteRepositories=$REPO_URL_ARTIFACTS -Dartifact=org.openecomp.demo.vnf.ves:ves:$DEMO_ARTIFACTS_VERSION:tar.gz:demo -Dtransitive=false -Ddest=. + mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DremoteRepositories=$REPO_URL_ARTIFACTS -Dartifact=org.openecomp.demo.vnf.ves:ves_vlb_reporting:$DEMO_ARTIFACTS_VERSION:tar.gz:demo -Dtransitive=false -Ddest=. + + tar -zxvf ves-$DEMO_ARTIFACTS_VERSION-demo.tar.gz + mv ves-$DEMO_ARTIFACTS_VERSION VES + tar -zxvf ves_vlb_reporting-$DEMO_ARTIFACTS_VERSION-demo.tar.gz + mv ves_vlb_reporting-$DEMO_ARTIFACTS_VERSION VESreporting_vLB + + mv VESreporting_vLB /opt/VES/code/evel_training/VESreporting + mv dns-manager-$DEMO_ARTIFACTS_VERSION.jar /opt/FDserver/dns-manager-$DEMO_ARTIFACTS_VERSION.jar + mv dnsmembership.sh /opt/FDserver/dnsmembership.sh + mv add_dns.sh /opt/FDserver/add_dns.sh + mv remove_dns.sh /opt/FDserver/remove_dns.sh + rm *.tar.gz + + chmod +x v_lb_init.sh + chmod +x vlb.sh + chmod +x /opt/VES/code/evel_training/VESreporting/go-client.sh + chmod +x /opt/FDserver/dnsmembership.sh + chmod +x /opt/FDserver/add_dns.sh + chmod +x /opt/FDserver/remove_dns.sh + + echo $DCAE_COLLECTOR_IP > config/dcae_collector_ip.txt + echo $DCAE_COLLECTOR_PORT > config/dcae_collector_port.txt + echo $LOCAL_PRIVATE_IPADDR > config/local_private_ipaddr.txt + LOCAL_PUBLIC_IPADDR=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2) + echo $LOCAL_PUBLIC_IPADDR > config/local_public_ipaddr.txt + echo $DEMO_ARTIFACTS_VERSION > config/artifacts_version.txt + + # Install VPP + export UBUNTU="trusty" + export RELEASE=".stable.1609" + rm /etc/apt/sources.list.d/99fd.io.list + echo "deb [trusted=yes] https://nexus.fd.io/content/repositories/fd.io$RELEASE.ubuntu.$UBUNTU.main/ ./" | sudo tee -a /etc/apt/sources.list.d/99fd.io.list + apt-get update + apt-get install -y vpp vpp-dpdk-dkms vpp-lib vpp-dbg vpp-plugins vpp-dev + sleep 1 + + # Install VES + cd /opt/VES/bldjobs/ + make clean + make + sleep 1 + + # Run instantiation script + cd /opt + mv vlb.sh /etc/init.d + update-rc.d vlb.sh defaults + ./v_lb_init.sh + + vlb_private_0_port: + type: OS::Neutron::Port + properties: + network: { get_resource: vlb_private_network } + fixed_ips: [{"subnet": { get_resource: vlb_private_subnet }, "ip_address": { get_param: vlb_private_ip_0 }}] + + vlb_private_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: ecomp_private_net_id } + fixed_ips: [{"subnet": { get_param: ecomp_private_subnet_id }, "ip_address": { get_param: vlb_private_ip_1 }}] + + vdns_0: + type: OS::Nova::Server + properties: + image: { get_param: vlb_image_name } + flavor: { get_param: vlb_flavor_name } + name: { get_param: vdns_name_0 } + key_name: { get_resource: my_keypair } + networks: + - network: { get_param: public_net_id } + - port: { get_resource: vdns_private_0_port } + - port: { get_resource: vdns_private_0_port } + - port: { get_resource: vdns_private_1_port } + metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }} + user_data_format: RAW + user_data: + str_replace: + params: + __lb_oam_int__ : { get_param: vlb_private_ip_1 } + __lb_private_ipaddr__: { get_param: vlb_private_ip_0 } + __local_private_ipaddr__: { get_param: vdns_private_ip_0 } + __repo_url_blob__ : { get_param: repo_url_blob } + __repo_url_artifacts__ : { get_param: repo_url_artifacts } + __demo_artifacts_version__ : { get_param: demo_artifacts_version } + template: | + #!/bin/bash + + LB_OAM_INT=__lb_oam_int__ + LB_PRIVATE_IPADDR=__lb_private_ipaddr__ + LOCAL_PRIVATE_IPADDR=__local_private_ipaddr__ + REPO_URL_BLOB=__repo_url_blob__ + REPO_URL_ARTIFACTS=__repo_url_artifacts__ + DEMO_ARTIFACTS_VERSION=__demo_artifacts_version__ + + # Download required dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y wget openjdk-8-jdk bind9 bind9utils bind9-doc apt-transport-https ca-certificates + apt-get install -y maven + sleep 1 + + # Download vDNS demo code for DNS Server + mkdir /opt/config + mkdir /opt/FDclient + cd /opt + + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/v_dns_init.sh + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/vdns.sh + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/dnsclient.sh + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/set_gre_tunnel.sh + + mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DremoteRepositories=$REPO_URL_ARTIFACTS -Dartifact=org.openecomp.demo.vnf.vlb:dns-client:$DEMO_ARTIFACTS_VERSION:jar -Dtransitive=false -Ddest=. + + mv dns-client-$DEMO_ARTIFACTS_VERSION.jar /opt/FDclient/ + mv dnsclient.sh /opt/FDclient/ + mv set_gre_tunnel.sh /opt/FDclient/ + + chmod +x v_dns_init.sh + chmod +x vdns.sh + chmod +x /opt/FDclient/dnsclient.sh + chmod +x /opt/FDclient/set_gre_tunnel.sh + + echo $LB_OAM_INT > config/lb_oam_int.txt + echo $LB_PRIVATE_IPADDR > config/lb_private_ipaddr.txt + echo $LOCAL_PRIVATE_IPADDR > config/local_private_ipaddr.txt + echo $DEMO_ARTIFACTS_VERSION > config/artifacts_version.txt + + # Download Bind config files + cd /opt/config + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/db_dnsdemo_openecomp_org + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/named.conf.options + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/named.conf.local + + # Configure Bind + modprobe ip_gre + mkdir /etc/bind/zones + sed -i "s/OPTIONS=.*/OPTIONS=\"-4 -u bind\"/g" /etc/default/bind9 + mv db_dnsdemo_openecomp_org /etc/bind/zones/db.dnsdemo.openecomp.org + mv named.conf.options /etc/bind/ + mv named.conf.local /etc/bind/ + sleep 1 + + # Run instantiation script + cd /opt + mv vdns.sh /etc/init.d + update-rc.d vdns.sh defaults + ./v_dns_init.sh + + vdns_private_0_port: + type: OS::Neutron::Port + properties: + network: { get_resource: vlb_private_network } + fixed_ips: [{"subnet": { get_resource: vlb_private_subnet }, "ip_address": { get_param: vdns_private_ip_0 }}] + + vdns_private_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: ecomp_private_net_id } + fixed_ips: [{"subnet": { get_param: ecomp_private_subnet_id }, "ip_address": { get_param: vdns_private_ip_1 }}] diff --git a/heat/vLB/dnsscaling.env b/heat/vLB/dnsscaling.env new file mode 100644 index 00000000..5496a6cf --- /dev/null +++ b/heat/vLB/dnsscaling.env @@ -0,0 +1,19 @@ +parameters: + vlb_image_name: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) + vlb_flavor_name: 4 GB General Purpose v1 + public_net_id: 00000000-0000-0000-0000-000000000000 + vlb_private_net_id: zdfw1lb01_private + ecomp_private_net_id: oam_ecomp + ecomp_private_subnet_id: oam_ecomp + vlb_private_ip_0: 192.168.10.111 + vlb_private_ip_1: 10.1.0.4 + vdns_private_ip_0: 192.168.10.212 + vdns_private_ip_1: 10.1.0.6 + vdns_name_0: zdfw1lb01dns02 + vnf_id: vLoadBalancer_demo_app + vf_module_id: vLoadBalancer + repo_url_blob: https://nexus.openecomp.org/content/repositories/raw + repo_url_artifacts: https://nexus.openecomp.org/content/repositories/snapshots + demo_artifacts_version: 1.0.0-SNAPSHOT + key_name: vlb_key_scaling + pub_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQXYJYYi3/OUZXUiCYWdtc7K0m5C0dJKVxPG0eI8EWZrEHYdfYe6WoTSDJCww+1qlBSpA5ac/Ba4Wn9vh+lR1vtUKkyIC/nrYb90ReUd385Glkgzrfh5HdR5y5S2cL/Frh86lAn9r6b3iWTJD8wBwXFyoe1S2nMTOIuG4RPNvfmyCTYVh8XTCCE8HPvh3xv2r4egawG1P4Q4UDwk+hDBXThY2KS8M5/8EMyxHV0ImpLbpYCTBA6KYDIRtqmgS6iKyy8v2D1aSY5mc9J0T5t9S2Gv+VZQNWQDDKNFnxqYaAo1uEoq/i1q63XC5AD3ckXb2VT6dp23BQMdDfbHyUWfJN diff --git a/heat/vLB/dnsscaling.yaml b/heat/vLB/dnsscaling.yaml new file mode 100644 index 00000000..003deb91 --- /dev/null +++ b/heat/vLB/dnsscaling.yaml @@ -0,0 +1,194 @@ +heat_template_version: 2013-05-23 + +description: Heat template to deploy a vDNS for OpenECOMP (scaling-up scenario) + +parameters: + vlb_image_name: + type: string + label: Image name or ID + description: Image to be used for compute instance + vlb_flavor_name: + type: string + label: Flavor + description: Type of instance (flavor) to be used + public_net_id: + type: string + label: Public network name or ID + description: Public network that enables remote connection to VNF + vlb_private_net_id: + type: string + label: vLoadBalancer private network name or ID + description: Private network that connects vLoadBalancer with vDNSs + ecomp_private_net_id: + type: string + label: ECOMP management network name or ID + description: Private network that connects ECOMP component and the VNF + ecomp_private_subnet_id: + type: string + label: ECOMP management sub-network name or ID + description: Private sub-network that connects ECOMP component and the VNF + vlb_private_ip_0: + type: string + label: vLoadBalancer private IP address towards the private network + description: Private IP address that is assigned to the vLoadBalancer to communicate with the vDNSs + vlb_private_ip_1: + type: string + label: vLoadBalancer private IP address towards the ECOMP management network + description: Private IP address that is assigned to the vLoadBalancer to communicate with ECOMP components + vdns_private_ip_0: + type: string + label: vDNS private IP address towards the private network + description: Private IP address that is assigned to the vDNS to communicate with the vLoadBalancer + vdns_private_ip_1: + type: string + label: vDNS private IP address towards the ECOMP management network + description: Private IP address that is assigned to the vDNS to communicate with ECOMP components + vdns_name_0: + type: string + label: vDNS name + description: Name of the vDNS + vnf_id: + type: string + label: VNF ID + description: The VNF ID is provided by ECOMP + vf_module_id: + type: string + label: vFirewall module ID + description: The vLoadBalancer Module ID is provided by ECOMP + key_name: + type: string + label: Key pair name + description: Public/Private key pair name + pub_key: + type: string + label: Public key + description: Public key to be installed on the compute instance + repo_url_blob: + type: string + label: Repository URL + description: URL of the repository that hosts the demo packages + repo_url_artifacts: + type: string + label: Repository URL + description: URL of the repository that hosts the demo packages + demo_artifacts_version: + type: string + label: Artifacts version used in demo vnfs + description: Artifacts (jar, tar.gz) version used in demo vnfs + +resources: + + random-str: + type: OS::Heat::RandomString + properties: + length: 4 + + my_keypair: + type: OS::Nova::KeyPair + properties: + name: + str_replace: + template: base_rand + params: + base: { get_param: key_name } + rand: { get_resource: random-str } + public_key: { get_param: pub_key } + save_private_key: false + + vdns_0: + type: OS::Nova::Server + properties: + image: { get_param: vlb_image_name } + flavor: { get_param: vlb_flavor_name } + name: { get_param: vdns_name_0 } + key_name: { get_resource: my_keypair } + networks: + - network: { get_param: public_net_id } + - port: { get_resource: vdns_private_0_port } + - port: { get_resource: vdns_private_1_port } + metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }} + user_data_format: RAW + user_data: + str_replace: + params: + __lb_oam_int__ : { get_param: vlb_private_ip_1 } + __lb_private_ipaddr__: { get_param: vlb_private_ip_0 } + __local_private_ipaddr__: { get_param: vdns_private_ip_0 } + __repo_url_blob__ : { get_param: repo_url_blob } + __repo_url_artifacts__ : { get_param: repo_url_artifacts } + __demo_artifacts_version__ : { get_param: demo_artifacts_version } + template: | + #!/bin/bash + + LB_OAM_INT=__lb_oam_int__ + LB_PRIVATE_IPADDR=__lb_private_ipaddr__ + LOCAL_PRIVATE_IPADDR=__local_private_ipaddr__ + REPO_URL_BLOB=__repo_url_blob__ + REPO_URL_ARTIFACTS=__repo_url_artifacts__ + DEMO_ARTIFACTS_VERSION=__demo_artifacts_version__ + + # Download required dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y wget openjdk-8-jdk bind9 bind9utils bind9-doc apt-transport-https ca-certificates + apt-get install -y maven + sleep 1 + + # Download vDNS demo code for DNS Server + mkdir /opt/config + mkdir /opt/FDclient + cd /opt + + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/v_dns_init.sh + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/vdns.sh + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/dnsclient.sh + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/set_gre_tunnel.sh + + mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DremoteRepositories=$REPO_URL_ARTIFACTS -Dartifact=org.openecomp.demo.vnf.vlb:dns-client:$DEMO_ARTIFACTS_VERSION:jar -Dtransitive=false -Ddest=. + + mv dns-client-$DEMO_ARTIFACTS_VERSION.jar /opt/FDclient/ + mv dnsclient.sh /opt/FDclient/ + mv set_gre_tunnel.sh /opt/FDclient/ + + chmod +x v_dns_init.sh + chmod +x vdns.sh + chmod +x /opt/FDclient/dnsclient.sh + chmod +x /opt/FDclient/set_gre_tunnel.sh + + echo $LB_OAM_INT > config/lb_oam_int.txt + echo $LB_PRIVATE_IPADDR > config/lb_private_ipaddr.txt + echo $LOCAL_PRIVATE_IPADDR > config/local_private_ipaddr.txt + echo $DEMO_ARTIFACTS_VERSION > config/artifacts_version.txt + + # Download Bind config files + cd /opt/config + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/db_dnsdemo_openecomp_org + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/named.conf.options + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/named.conf.local + + # Configure Bind + modprobe ip_gre + mkdir /etc/bind/zones + sed -i "s/OPTIONS=.*/OPTIONS=\"-4 -u bind\"/g" /etc/default/bind9 + mv db_dnsdemo_openecomp_org /etc/bind/zones/db.dnsdemo.openecomp.org + mv named.conf.options /etc/bind/ + mv named.conf.local /etc/bind/ + sleep 1 + + # Run instantiation script + cd /opt + mv vdns.sh /etc/init.d + update-rc.d vdns.sh defaults + ./v_dns_init.sh + + vdns_private_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: vlb_private_net_id } + fixed_ips: [{"subnet": { get_param: vlb_private_net_id }, "ip_address": { get_param: vdns_private_ip_0 }}] + + vdns_private_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: ecomp_private_net_id } + fixed_ips: [{"subnet": { get_param: ecomp_private_subnet_id }, "ip_address": { get_param: vdns_private_ip_1 }}] diff --git a/heat/vLB/packet_gen_vlb.env b/heat/vLB/packet_gen_vlb.env new file mode 100644 index 00000000..5143861a --- /dev/null +++ b/heat/vLB/packet_gen_vlb.env @@ -0,0 +1,11 @@ +parameters: + vpg_image_name: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) + vpg_flavor_name: 4 GB General Purpose v1 + public_net_id: 00000000-0000-0000-0000-000000000000 + vlb_ipaddr: INSERT THE PUBLIC ADDRESS OF THE vLB HERE + vpg_name_0: ziad1vdnspg01pg01 + repo_url_blob: https://nexus.openecomp.org/content/repositories/raw + repo_url_artifacts: https://nexus.openecomp.org/content/repositories/snapshots + demo_artifacts_version: 1.0.0-SNAPSHOT + key_name: pgforvdnsdemo_key + pub_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQXYJYYi3/OUZXUiCYWdtc7K0m5C0dJKVxPG0eI8EWZrEHYdfYe6WoTSDJCww+1qlBSpA5ac/Ba4Wn9vh+lR1vtUKkyIC/nrYb90ReUd385Glkgzrfh5HdR5y5S2cL/Frh86lAn9r6b3iWTJD8wBwXFyoe1S2nMTOIuG4RPNvfmyCTYVh8XTCCE8HPvh3xv2r4egawG1P4Q4UDwk+hDBXThY2KS8M5/8EMyxHV0ImpLbpYCTBA6KYDIRtqmgS6iKyy8v2D1aSY5mc9J0T5t9S2Gv+VZQNWQDDKNFnxqYaAo1uEoq/i1q63XC5AD3ckXb2VT6dp23BQMdDfbHyUWfJN diff --git a/heat/vLB/packet_gen_vlb.yaml b/heat/vLB/packet_gen_vlb.yaml new file mode 100644 index 00000000..e631fc46 --- /dev/null +++ b/heat/vLB/packet_gen_vlb.yaml @@ -0,0 +1,139 @@ +heat_template_version: 2013-05-23 +description: Heat template to deploy vFirewall demo app for OpenECOMP + +parameters: + public_net_id: + type: string + label: Public network name or ID + description: Public network that enables remote connection to VNF + vpg_image_name: + type: string + label: Image name or ID + description: Image to be used for compute instance + vpg_flavor_name: + type: string + label: Flavor + description: Type of instance (flavor) to be used + vpg_name_0: + type: string + label: vPacketGenerator name + description: Name of the vPacketGenerator + key_name: + type: string + label: Key pair name + description: Public/Private key pair name + pub_key: + type: string + label: Public key + description: Public key to be installed on the compute instance + repo_url_blob: + type: string + label: Repository URL + description: URL of the repository that hosts the demo packages + repo_url_artifacts: + type: string + label: Repository URL + description: URL of the repository that hosts the demo packages + vlb_ipaddr: + type: string + label: Public IP of the vLoadBalancer to which we want to send traffic + description: Public IP of the vLoadBalancer to which we want to send traffic + demo_artifacts_version: + type: string + label: Artifacts version used in demo vnfs + description: Artifacts (jar, tar.gz) version used in demo vnfs + + +resources: + + random-str: + type: OS::Heat::RandomString + properties: + length: 4 + + my_keypair: + type: OS::Nova::KeyPair + properties: + name: + str_replace: + template: base_rand + params: + base: { get_param: key_name } + rand: { get_resource: random-str } + public_key: { get_param: pub_key } + save_private_key: false + + + vpg_0: + type: OS::Nova::Server + properties: + image: { get_param: vpg_image_name } + flavor: { get_param: vpg_flavor_name } + name: { get_param: vpg_name_0 } + key_name: { get_resource: my_keypair } + networks: + - network: { get_param: public_net_id } + user_data_format: RAW + user_data: + str_replace: + params: + __repo_url_blob__ : { get_param: repo_url_blob } + __repo_url_artifacts__ : { get_param: repo_url_artifacts } + __vlb_ipaddr__: { get_param: vlb_ipaddr } + __demo_artifacts_version__ : { get_param: demo_artifacts_version } + template: | + #!/bin/bash + + REPO_URL_BLOB=__repo_url_blob__ + REPO_URL_ARTIFACTS=__repo_url_artifacts__ + VLB_IPADDR=__vlb_ipaddr__ + DEMO_ARTIFACTS_VERSION=__demo_artifacts_version__ + + # Download required dependencies + add-apt-repository -y ppa:openjdk-r/ppa + apt-get update + apt-get install -y make wget openjdk-8-jdk gcc libcurl4-openssl-dev python-pip bridge-utils apt-transport-https ca-certificates + apt-get install -y maven + pip install jsonschema + + # Download vFirewall demo code for packet generator + mkdir /opt/config + mkdir /opt/honeycomb + cd /opt + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/v_packetgen_for_dns_demo_init.sh + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/vpacketgenfordnsdemo.sh + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/run_streams_dns.sh + wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/vdnspacketgen_change_streams_ports.sh + + mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DremoteRepositories=$REPO_URL_ARTIFACTS -Dartifact=org.openecomp.demo.vnf:sample-distribution:$DEMO_ARTIFACTS_VERSION:tar.gz:hc -Dtransitive=false -Ddest=. + mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DremoteRepositories=$REPO_URL_ARTIFACTS -Dartifact=org.openecomp.demo.vnf.vlb:vlb_dns_streams:$DEMO_ARTIFACTS_VERSION:tar.gz:demo -Dtransitive=false -Ddest=. + + + tar -zxvf vpp.tar.gz + tar -zxvf sample-distribution-$DEMO_ARTIFACTS_VERSION-hc.tar.gz + mv sample-distribution-$DEMO_ARTIFACTS_VERSION honeycomb + sed -i 's/"restconf-binding-address": "127.0.0.1",/"restconf-binding-address": "0.0.0.0",/g' honeycomb/sample-distribution-$DEMO_ARTIFACTS_VERSION/config/honeycomb.json + tar -zxvf vlb_dns_streams-$DEMO_ARTIFACTS_VERSION-demo.tar.gz + mv vlb_dns_streams-$DEMO_ARTIFACTS_VERSION dns_streams + rm *.tar.gz + chmod +x v_packetgen_for_dns_demo_init.sh + chmod +x vpacketgenfordnsdemo.sh + chmod +x run_streams_dns.sh + chmod +x vdnspacketgen_change_streams_ports.sh + echo $VLB_IPADDR > config/vlb_ipaddr.txt + echo $DEMO_ARTIFACTS_VERSION > config/artifacts_version.txt + + # Install VPP + export UBUNTU="trusty" + export RELEASE=".stable.1609" + rm /etc/apt/sources.list.d/99fd.io.list + echo "deb [trusted=yes] https://nexus.fd.io/content/repositories/fd.io$RELEASE.ubuntu.$UBUNTU.main/ ./" | sudo tee -a /etc/apt/sources.list.d/99fd.io.list + apt-get update + apt-get install -y vpp vpp-dpdk-dkms vpp-lib vpp-dbg vpp-plugins vpp-dev + sleep 1 + + # Run instantiation script + cd /opt + mv vpacketgenfordnsdemo.sh /etc/init.d + update-rc.d vpacketgenfordnsdemo.sh defaults + ./v_packetgen_for_dns_demo_init.sh diff --git a/vnfs/.DS_Store b/vnfs/.DS_Store Binary files differindex 892df7cf..42fd5df9 100644 --- a/vnfs/.DS_Store +++ b/vnfs/.DS_Store diff --git a/vnfs/vLB/.DS_Store b/vnfs/vLB/.DS_Store Binary files differindex 7670c655..ea2e0531 100644 --- a/vnfs/vLB/.DS_Store +++ b/vnfs/vLB/.DS_Store diff --git a/vnfs/vLB/scripts/.DS_Store b/vnfs/vLB/scripts/.DS_Store Binary files differindex b7b2ad39..a77bdc47 100644 --- a/vnfs/vLB/scripts/.DS_Store +++ b/vnfs/vLB/scripts/.DS_Store diff --git a/vnfs/vLB/scripts/v_packetgen_for_dns_demo_init.sh b/vnfs/vLB/scripts/v_packetgen_for_dns_demo_init.sh index 094f3222..9078b7f5 100644 --- a/vnfs/vLB/scripts/v_packetgen_for_dns_demo_init.sh +++ b/vnfs/vLB/scripts/v_packetgen_for_dns_demo_init.sh @@ -94,5 +94,5 @@ sleep 20 # Enable traffic flows cd /opt chmod +x run_streams_dns.sh -#./run_streams_dns.sh &>/dev/null &disown +./run_streams_dns.sh &>/dev/null &disown |