aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Platania <platania@research.att.com>2017-04-04 15:40:09 -0400
committerMarco Platania <platania@research.att.com>2017-04-04 15:40:09 -0400
commit950417ff2a17ee788728fe2fb19023d09bc7e4e0 (patch)
treedfababd1758b6dd0fe365f89df79f56362ff6e5b
parentf6a51980bb61a2e70cb80b3fa33a0a7c93438f4f (diff)
Add HEAT template for vanilla Openstack
Change-Id: Ib29bf825f81d93a738a1ac12b99b9092f5000767 Signed-off-by: Marco Platania <platania@research.att.com>
-rw-r--r--README.md81
-rw-r--r--heat/OpenECOMP/onap_openstack.env99
-rw-r--r--heat/OpenECOMP/onap_openstack.yaml1506
3 files changed, 1662 insertions, 24 deletions
diff --git a/README.md b/README.md
index 92b666b7..737b01d9 100644
--- a/README.md
+++ b/README.md
@@ -8,11 +8,11 @@ The repository includes:
- LICENSE.TXT: the license text
- - The "boot" directory: the scripts to instantiate ONAP.
+ - The "boot" directory: the scripts that instantiate ONAP.
- The "heat" directory: contains the following three directories:
- - OpenECOMP: contains the HEAT template for the installation of the ONAP platform (openecomp_rackspace.yaml) and the environment file (openecomp_rackspace.env)
+ - OpenECOMP: contains the HEAT template for the installation of the ONAP platform. The template openecomp_rackspace.yaml and the environment file openecomp_rackspace.env work in Rackspace, while the template onap_openstack.yaml and the environment file onap_openstack.env work in vanilla OpenStack.
- vFW: contains the HEAT template for the instantiation of the vFirewall VNF (base_vfw.yaml) and the environment file (base_vfw.env)
@@ -20,7 +20,7 @@ The repository includes:
- The "vnfs" directory: contains the following directories:
- - honeycomb_plugin: Honeycomb plugin that allows upstream systems to change VNF configuration via RESTCONF or NETCONF protocols.
+ - honeycomb_plugin: Honeycomb plugin that allows ONAP to change VNF configuration via RESTCONF or NETCONF protocols.
- VES: source code of the ECOMP Vendor Event Listener (VES) Library. The VES library used here has been cloned from the GitHub repository at https://github.com/att/evel-library on February 1, 2017.
@@ -33,16 +33,16 @@ The repository includes:
- vLB: scripts that download, install and run packages for the vLoadBalancer/vDNS demo application.
-ONAP HEAT Template
+ONAP HEAT Template for Rackspace
---
The ONAP HEAT template spins up the entire ONAP platform. The template, openecomp_rackspace.yaml, comes with an environment file, openecomp_rackspace.env, in which all the default values are defined.
-The HEAT template is composed of two sections: (i) parameters, and (ii) resources. The parameter section contains the declaration and description of the parameters that will be used to spin up OpenECOMP, such as public network identifier, URLs of code and artifacts repositories, etc.
+The HEAT template is composed of two sections: (i) parameters, and (ii) resources. The parameter section contains the declaration and description of the parameters that will be used to spin up ONAP, such as public network identifier, URLs of code and artifacts repositories, etc.
The default values of these parameters can be found in the environment file. The resource section contains the definition of:
- ONAP Private Management Network, which ONAP components use to communicate with each other and with VNFs
- ONAP Virtual Machines (VMs)
- - Public/private key pair used to access OpenECOMP VMs
+ - Public/private key pair used to access ONAP VMs
- Virtual interfaces towards the ONAP Private Management Network
- Disk volumes.
@@ -64,7 +64,7 @@ public_net_id is the unique identifier (UUID) or name of the public network of t
00000000-0000-0000-0000-000000000000
-pub_key is string value of the public key that will be installed in each OpenECOMP VM. To create a public/private key pair in Linux, execute the following instruction:
+pub_key is string value of the public key that will be installed in each ONAP VM. To create a public/private key pair in Linux, please execute the following instruction:
user@ubuntu:~$ ssh-keygen -t rsa
@@ -78,10 +78,15 @@ The following operations to create the public/private key pair occur:
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
-openstack_username, openstack_tenant_id (password), and openstack_api_key are user's credentials to access the Openstack-based cloud. Note that in the Rackspace web interface, openstack_api_key can be found by clicking on the username and then "Account Settings".
+openstack_username, openstack_tenant_id (password), and openstack_api_key are user's credentials to access the Openstack-based cloud. Note that in the Rackspace web interface, openstack_api_key can be found by clicking on the username on the top-right corner of the GUI and then "Account Settings".
+DCAE spins up the data collection and analytics environment outside the HEAT template. This environment is composed of: 3-VM CDAP/Hadoop cluster, 1 VM for the DCAE data collector, and 1 VM for Postgres DB. DCAE needs to know where (i.e. Rackspace region) it has to spin up these VMs. Three parameters have to be setup to reflect the Rackspace region, namely dcae_zone, dcae_state and openstack_region. dcae_zone and dcae_state are used to compose the name of the VMs, so any meaningful name can be used. openstack_region, instead, represents the actual location, so Rackspace-specific values must be used: IAD, DFW, HKG, SYD. The example below shows a snippet of the HEAT environment file that instantiate ONAP in IAD region in Rackspace:
-The OpenECOMP platform can be instantiated via Rackspace GUI or command line.
+ dcae_zone: iad4
+ dcae_state: vi
+ openstack_region: IAD
+
+The ONAP platform can be instantiated via Rackspace GUI or command line.
Instantiation via Rackspace GUI:
- Login to Rackspace with your personal credentials
@@ -114,26 +119,54 @@ Instantiation via Command Line:
source ~/rackspace/openrc
- - In order to install the OpenECOMP platform, type:
+ - In order to install the ONAP platform, type:
heat stack-create STACK_NAME -f PATH_TO_HEAT_TEMPLATE(YAML FILE) -e PATH_TO_ENV_FILE # Old HEAT client, OR
openstack stack create -t PATH_TO_HEAT_TEMPLATE(YAML FILE) -e PATH_TO_ENV_FILE STACK_NAME # New Openstack client
+ONAP HEAT Template for vanilla OpenStack
+---
+
+The HEAT template for vanilla OpenStack is similar to the HEAT template for Rackspace. The main difference is the way in which some VMs resource-intensive VMs are defined. Unlike OpenStack, in fact, Rackspace requires to explicitly define a local disk for memory- or CPU-intensive VMs.
+
+The HEAT template for vanilla OpenStack tries to replicate typical application deployments in OpenStack. VMs have a private IP address in the ONAP Private Management Network space. Unlike the Rackspace deployment, they use floating IP addresses. Currently, floating IPs are automatically assigned by OpenStack. A router is also created that connects the ONAP Private Management Network to the external network.
+
+In addition to the parameters described in the previous section, the HEAT template for vanilla OpenStack uses the following parameters to define the image name and flavor of a VM:
+
+ ubuntu_1404_image: PUT THE UBUNTU 14.04 IMAGE NAME HERE
+ ubuntu_1604_image: PUT THE UBUNTU 16.04 IMAGE NAME HERE
+ flavor_small: PUT THE SMALL FLAVOR NAME HERE
+ flavor_medium: PUT THE MEDIUM FLAVOR NAME HERE
+ flavor_large: PUT THE LARGE FLAVOR NAME HERE
+ flavor_xlarge: PUT THE XLARGE FLAVOR NAME HERE
+
+Parameters for network configuration are also used:
+
+ external_dns
+ oam_network_cidr
+ aai_ip_addr
+ appc_ip_addr
+ ...
+ vid_ip_addr
+
+These parameters are used to configure the ONAP internal DNS VM. The external_dns parameter is a comma-separated list of IP addresses (they can be obtained from /etc/resolv.conf in many UNIX-based Operating Systems). The IP address of the ONAP VMs must comply with the oam_network_cidr parameter, and viceversa. Except for external_dns, the other network parameters are already set. They should work for many deployments.
+
+
VNFs HEAT Templates
---
-The HEAT templates for the demo apps are stored in vFW and vLB directories.
+The HEAT templates for the demo applications are stored in heat/vFW and heat/vLB directories.
vFW contains the HEAT template, base_vfw.yaml, and the environment file, base_vfw.env, that are used to instantiate a virtual firewall. The VNF is composed of three VMs:
- Packet generator
- Firewall
- Sink
-The packet generator generates traffic that passes through the firewall and reaches the sink. The firewall periodically reports the number of packets received in a unit of time to the DCAE collector. If the reported number of packets received on the firewall is above a high-water mark or below a low-water mark, OpenECOMP will enforce a configuration change on the packet generator, reducing or augmenting the quantity of traffic generated, respectively.
+The packet generator generates traffic that passes through the firewall and reaches the sink. The firewall periodically reports the number of packets received in a unit of time to the DCAE collector. If the reported number of packets received on the firewall is above a high-water mark or below a low-water mark, ONAP will enforce a configuration change on the packet generator, reducing or augmenting the quantity of traffic generated, respectively.
vLB contains the HEAT template, base_vlb.yaml, and the environment file, base_vlb.env, that are used to spin up a virtual load balancer and a virtual DNS. vLB also contains the HEAT template, packet_gen_vlb.yaml, and the environment file packet_gen_vlb.env, of a packet generator that generates DNS queries.
-The load balancer periodically reports the number of DNS query packets received in a time unit to the DCAE collector. If the reported number of received packets crosses a threshold, then OpenECOMP will spin up a new DNS based on the dnsscaling.yaml HEAT template and dnsscaling.env to better balance the load of incoming DNS queries.
+The load balancer periodically reports the number of DNS query packets received in a time unit to the DCAE collector. If the reported number of received packets crosses a threshold, then ONAP will spin up a new DNS based on the dnsscaling.yaml HEAT template and dnsscaling.env to better balance the load of incoming DNS queries.
The vFW and vLB HEAT templates and environment files are onboarded into ONAP SDC and run automatically. The user is not required to run these templates manually.
However, before onboarding the templates following the instructions in the ONAP documentation, the user should set the following values in the environment files:
@@ -154,7 +187,7 @@ vFirewall
The vFirewall application contains 3 VMs: a firewall, a packet generator, and a packet sink.
-The packet generator sends packets to the packet sink through the firewall. The firewall reports the volume of traffic from the packet generator to the sink to OpenECOMP DCAE’s collector. To check the traffic volume to the sink, you can access the link http://sink_IP:667 through your browser. You can see the traffic volume in the charts.
+The packet generator sends packets to the packet sink through the firewall. The firewall reports the volume of traffic from the packet generator to the sink to ONAP DCAE’s collector. To check the traffic volume to the sink, you can access the link http://sink_ip_address:667 through your browser. You can see the traffic volume in the charts.
The packet generator includes a script that periodically generates different volumes of traffic.
@@ -163,10 +196,10 @@ The closed-loop policy has been configured to re-adjust the traffic volume when
__Closedloop for vFirewall demo:__
Through the ONAP Portal’s Policy Portal, we can find the configuration and operation policies that is currently enabled for the vFirewall application.
-+ The configuration policy sets the thresholds for generating an onset event from DCAE to the Policy engine. Currently the threshold is set to below 300 packets or above 700 packets per 10 seconds.
-+ Once the threshold is crossed, the Policy engine executes the operational policy to request APP-C to change the configuration of the packet gen.
++ The configuration policy sets the thresholds for generating an onset event from DCAE to the Policy engine. Currently the thresholds are set to 300 packets and 700 packets, while the measurement interval is set to 10 seconds.
++ Once one of the thresholds is crossed (e.g. the number of received packets is below 300 packets or above 700 per 10 seconds), the Policy engine executes the operational policy to request APP-C to change the configuration of the packet generator.
+ APP-C sends a request to the packet generator to adjust the traffic volume to 500 packets per 10 seconds.
-+ The traffic volume can be observed through the link http://sink_IP:667.
++ The traffic volume can be observed through the link http://sink_ip_address:667.
__Adjust packet generator:__
@@ -180,7 +213,7 @@ To adjust the traffic volume sending from the packet generator, run the followin
curl -X PUT -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{"pg-streams":{"pg-stream": [{"id":"fw_udp1", "is-enabled":"true"},{"id":"fw_udp2", "is-enabled":"true"},{"id":"fw_udp3", "is-enabled":"true"},{"id":"fw_udp4", "is-enabled":"true"},{"id":"fw_udp5", "is-enabled":"true"}]}}' "http://PacketGen_IP:8183/restconf/config/sample-plugin:sample-plugin/pg-streams"
```
-A script in /opt/run_traffic_fw_demo.sh on the packet generator VM starts automatically and alternate the volume of traffic every 10 minutes.
+A script in /opt/run_traffic_fw_demo.sh on the packet generator VM starts automatically and alternate the volume of traffic every 5 minutes.
vLoadBalancer/vDNS
---
@@ -204,10 +237,10 @@ That means the load balancer has been set up correctly and has forwarded the DNS
__Closedloop for vLoadBalancer/vDNS:__
-Through the OpenECOMP Portal’s Policy Portal, we can find the configuration and operation policies that is currently enabled for the vLoadBalancer/vDNS application.
-+ The configuration policy sets the thresholds for generating an onset event from DCAE to the Policy engine. Currently the threshold is set to above 200 packets per 10 seconds.
-+ Once the threshold is crossed, the Policy engine executes the operational policy to query A&AI and send a request to MSO for spinning up a new DNS instance.
-+ A new DNS instance will be spun up after the threshold is crossed. It can take a few minutes for this to happen.
+Through the Policy Portal (accessible via the ONAP Portal), we can find the configuration and operation policies that are currently enabled for the vLoadBalancer/vDNS application.
++ The configuration policy sets the thresholds for generating an onset event from DCAE to the Policy engine. Currently the threshold is set to 200 packets, while the measurement interval is set to 10 seconds.
++ Once the threshold is crossed (e.g. the number of received packets is above 200 packets per 10 seconds), the Policy engine executes the operational policy to query A&AI and send a request to MSO for spinning up a new DNS instance.
++ A new DNS instance will be then spun up.
__Generate DNS queries:__
@@ -227,9 +260,9 @@ To generate DNS queries to the vLoadBalancer/vDNS instance, a separate packet ge
```
curl -X PUT -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{"pg-streams":{"pg-stream": [{"id":"dns1", "is-enabled":"true"}]}}' "http://vLoadBalancer_IP:8183/restconf/config/sample-plugin:sample-plugin/pg-streams"
```
-+ *{"id":"dns1", "is-enabled":"true"}* shows the stream *dns1* is enabled. The packet gen sends requests in the rate of 100 packets per 10 seconds.
++ *{"id":"dns1", "is-enabled":"true"}* shows the stream *dns1* is enabled. The packet generator sends requests in the rate of 100 packets per 10 seconds.
-+ To increase the amount of traffic, we can enable more streams. The packet gen has total 10 streams, *dns1*, *dns2*, *dns3* to *dns10*. Each of them produces 100 packets per 10 seconds. To enable the streams, includes *{"id":"dnsX", "is-enabled":"true"}* where *X* is the stream ID in the pg-stream bracket of the curl command.
++ To increase the amount of traffic, we can enable more streams. The packet generator has 10 streams, *dns1*, *dns2*, *dns3* to *dns10*. Each of them generates 100 packets per 10 seconds. To enable the streams, please insert *{"id":"dnsX", "is-enabled":"true"}* where *X* is the stream ID in the pg-stream bracket of the curl command.
For example, if we want to enable 3 streams, the curl command should be:
```
diff --git a/heat/OpenECOMP/onap_openstack.env b/heat/OpenECOMP/onap_openstack.env
new file mode 100644
index 00000000..1a38ea10
--- /dev/null
+++ b/heat/OpenECOMP/onap_openstack.env
@@ -0,0 +1,99 @@
+parameters:
+
+ # Generic parameters used across all ONAP components
+
+ public_net_id: PUT YOUR NETWORK ID/NAME HERE
+
+ ubuntu_1404_image: PUT THE UBUNTU 14.04 IMAGE NAME HERE
+
+ ubuntu_1604_image: PUT THE UBUNTU 16.04 IMAGE NAME HERE
+
+ flavor_small: PUT THE SMALL FLAVOR NAME HERE
+
+ flavor_medium: PUT THE MEDIUM FLAVOR NAME HERE
+
+ flavor_large: PUT THE LARGE FLAVOR NAME HERE
+
+ flavor_xlarge: PUT THE XLARGE FLAVOR NAME HERE
+
+ vm_base_name: vm1
+
+ key_name: ecomp_key
+
+ pub_key: PUT YOUR PUBLIC KEY HERE
+
+ nexus_repo: https://nexus.onap.org/content/sites/raw
+
+ nexus_docker_repo: nexus3.onap.org:10003
+
+ nexus_username: docker
+
+ nexus_password: docker
+
+ gitlab_username: PUT YOUR GERRIT USERNAME HERE
+
+ gitlab_password: PUT YOUR GERRIT HTTP PASSWORD HERE
+
+ dmaap_topic: AUTO
+
+ artifacts_version: 1.0.0
+
+ docker_version: 1.0-STAGING-latest
+
+ gerrit_branch: release-1.0.0
+
+ openstack_tenant_id: PUT YOUR OPENSTACK PROJECT ID HERE
+
+ openstack_username: PUT YOUR OPENSTACK USERNAME HERE
+
+ openstack_api_key: PUT YOUR OPENSTACK PASSWORD HERE
+
+ horizon_url: PUT THE HORIZON URL HERE
+
+ keystone_url: PUT THE KEYSTONE URL HERE
+
+
+ # Network parameters
+ external_dns: PUT THE ADDRESS OF THE EXTERNAL DNS HERE (e.g. a comma-separated list of IP addresses in your /etc/resolv.conf)
+
+ oam_network_cidr: 10.0.0.0/8
+
+ aai_ip_addr: 10.0.1.1
+
+ appc_ip_addr: 10.0.2.1
+
+ dcae_ip_addr: 10.0.4.1
+
+ dns_ip_addr: 10.0.0.1
+
+ mso_ip_addr: 10.0.5.1
+
+ mr_ip_addr: 10.0.11.1
+
+ policy_ip_addr: 10.0.6.1
+
+ portal_ip_addr: 10.0.9.1
+
+ robot_ip_addr: 10.0.10.1
+
+ sdc_ip_addr: 10.0.3.1
+
+ sdnc_ip_addr: 10.0.7.1
+
+ vid_ip_addr: 10.0.8.1
+
+
+ # Parameters for DCAE instantiation
+
+ dcae_zone: z1
+
+ dcae_state: os
+
+ nexus_repo_root: https://nexus.onap.org
+
+ nexus_url_snapshot: https://nexus.onap.org/content/repositories/snapshots
+
+ openstack_region: RegionOne
+
+ gitlab_branch: master
+
diff --git a/heat/OpenECOMP/onap_openstack.yaml b/heat/OpenECOMP/onap_openstack.yaml
new file mode 100644
index 00000000..3a541790
--- /dev/null
+++ b/heat/OpenECOMP/onap_openstack.yaml
@@ -0,0 +1,1506 @@
+heat_template_version: 2015-10-15
+
+description: Heat template to install ONAP components
+
+##############
+# #
+# PARAMETERS #
+# #
+##############
+
+parameters:
+
+ # Generic parameters used across all ONAP components
+ public_net_id:
+ type: string
+ description: Public network for floating IP address allocation
+
+ ubuntu_1404_image:
+ type: string
+ description: Name of the Ubuntu 14.04 image
+
+ ubuntu_1604_image:
+ type: string
+ description: Name of the Ubuntu 16.04 image
+
+ flavor_small:
+ type: string
+ description: Name of the Small Flavor supported by the cloud provider
+
+ flavor_medium:
+ type: string
+ description: Name of the Medium Flavor supported by the cloud provider
+
+ flavor_large:
+ type: string
+ description: Name of the Large Flavor supported by the cloud provider
+
+ flavor_xlarge:
+ type: string
+ description: Name of the Extra Large Flavor supported by the cloud provider
+
+ vm_base_name:
+ type: string
+ description: Base name of ONAP VMs
+
+ key_name:
+ type: string
+ description: Public/Private key pair name
+
+ pub_key:
+ type: string
+ description: Public key to be installed on the compute instance
+
+ nexus_repo:
+ type: string
+ description: Complete URL for the Nexus repository.
+
+ nexus_docker_repo:
+ type: string
+ description: Complete URL for the Nexus repository for docker images.
+
+ nexus_username:
+ type: string
+ description: Nexus Repository username
+
+ nexus_password:
+ type: string
+ description: Nexus Repository Password
+
+ gitlab_username:
+ type: string
+ description: Gitlab Repository username
+
+ gitlab_password:
+ type: string
+ description: Gitlab Repository Password
+
+ artifacts_version:
+ type: string
+ description: Artifacts version of ONAP components
+
+ docker_version:
+ type: string
+ label: Version number of ONAP docker images
+
+ gerrit_branch:
+ type: string
+ label: Gerrit code branch
+ description: Gerrit branch where to download the code from
+
+ dmaap_topic:
+ type: string
+ description: DmaaP Topic name
+
+ openstack_tenant_id:
+ type: string
+ description: Openstack tenant ID
+
+ openstack_username:
+ type: string
+ description: Openstack username
+
+ openstack_api_key:
+ type: string
+ description: Openstack API Key
+
+ horizon_url:
+ type: string
+ description: URL of Openstack Horizon
+
+ keystone_url:
+ type: string
+ description: URL of Openstack Keystone
+
+ # Network parameters
+ external_dns:
+ type: comma_delimited_list
+ description: External DNS for OAM ONAP network
+
+ oam_network_cidr:
+ type: string
+ description: CIDR of the OAM ONAP network
+
+ aai_ip_addr:
+ type: string
+ description: A&AI IP Address
+
+ appc_ip_addr:
+ type: string
+ description: APP-C IP Address
+
+ dcae_ip_addr:
+ type: string
+ description: DCAE IP Address
+
+ dns_ip_addr:
+ type: string
+ description: DNS IP Address
+
+ mso_ip_addr:
+ type: string
+ description: MSO IP Address
+
+ mr_ip_addr:
+ type: string
+ description: Message Router IP Address
+
+ policy_ip_addr:
+ type: string
+ description: Policy Engine IP Address
+
+ portal_ip_addr:
+ type: string
+ description: Portal IP Address
+
+ robot_ip_addr:
+ type: string
+ description: Robot Framework IP Address
+
+ sdc_ip_addr:
+ type: string
+ description: SDC IP Address
+
+ sdnc_ip_addr:
+ type: string
+ description: SDN-C IP Address
+
+ vid_ip_addr:
+ type: string
+ description: VID IP Address
+
+ # Parameters for DCAE instantiation
+ dcae_zone:
+ type: string
+ description: DCAE Zone to use in VM names created by DCAE controller
+
+ dcae_state:
+ type: string
+ description: DCAE State to use in VM names created by DCAE controller
+
+ nexus_repo_root:
+ type: string
+ description: Root URL of Nexus repository
+
+ nexus_url_snapshot:
+ type: string
+ description: Snapshot of Maven repository for DCAE deployment
+
+ openstack_region:
+ type: string
+ description: Region where the DCAE controller will spin the VMs
+
+ gitlab_branch:
+ type: string
+ description: Branch of the Gitlab repository
+
+
+#############
+# #
+# RESOURCES #
+# #
+#############
+
+resources:
+ random-str:
+ type: OS::Heat::RandomString
+ properties:
+ length: 4
+
+
+ # Public key used to access ONAP 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
+
+
+ # ONAP 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: { get_param: oam_network_cidr }
+ dns_nameservers: { get_param: external_dns }
+
+ router:
+ type: OS::Neutron::Router
+ properties:
+ external_gateway_info:
+ network: { get_param: public_net_id }
+
+ router_interface:
+ type: OS::Neutron::RouterInterface
+ properties:
+ router_id: { get_resource: router }
+ subnet_id: { get_resource: oam_ecomp_subnet }
+
+
+ # 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": { get_param: dns_ip_addr }}]
+
+ dns_floating_ip:
+ type: OS::Neutron::FloatingIP
+ properties:
+ floating_network_id: { get_param: public_net_id }
+ port_id: { get_resource: dns_private_port }
+
+ dns_vm:
+ type: OS::Nova::Server
+ properties:
+ image: { get_param: ubuntu_1404_image }
+ flavor: { get_param: flavor_small }
+ name:
+ str_replace:
+ template: base-dns-server
+ params:
+ base: { get_param: vm_base_name }
+ key_name: { get_resource: vm_key }
+ networks:
+ - port: { get_resource: dns_private_port }
+ user_data_format: RAW
+ user_data:
+ str_replace:
+ params:
+ __nexus_repo__: { get_param: nexus_repo }
+ __artifacts_version__: { get_param: artifacts_version }
+ __oam_network_cidr__: { get_attr: [oam_ecomp_subnet, cidr] }
+ __dns_ip_addr__: { get_param: dns_ip_addr }
+ __aai_ip_addr__: { get_param: aai_ip_addr }
+ __appc_ip_addr__: { get_param: appc_ip_addr }
+ __dcae_ip_addr__: { get_param: dcae_ip_addr }
+ __mso_ip_addr__: { get_param: mso_ip_addr }
+ __mr_ip_addr__: { get_param: mr_ip_addr }
+ __policy_ip_addr__: { get_param: policy_ip_addr }
+ __portal_ip_addr__: { get_param: policy_ip_addr }
+ __robot_ip_addr__: { get_param: robot_ip_addr }
+ __sdc_ip_addr__: { get_param: sdc_ip_addr }
+ __sdnc_ip_addr__: { get_param: sdnc_ip_addr }
+ __vid_ip_addr__: { get_param: vid_ip_addr }
+
+ template: |
+ #!/bin/bash
+
+ hn=`hostname`
+ echo 127.0.0.1 $hn >> /etc/hosts
+
+ # 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__/bind_zones -o /etc/bind/zones/db.simpledemo.openecomp.org
+ curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/bind_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
+ #NETMASK=$(echo "__oam_network_cidr__" | cut -d"/" -f2)
+ #if [[ $NETMASK == "8" ]]
+ #then
+ # ADDR=$(echo "__dns_ip_addr__" | cut -d"." -f1)
+ #elif [[ $NETMASK == "16" ]]
+ #then
+ # ADDR=$(echo "__dns_ip_addr__" | cut -d"." -f1).$(echo "__dns_ip_addr__" | cut -d"." -f2)
+ #elif [[ $NETMASK == "24" ]]
+ #then
+ # ADDR=$(echo "__dns_ip_addr__" | cut -d"." -f1).$(echo "__dns_ip_addr__" | cut -d"." -f2).$(echo "__dns_ip_addr__" | cut -d"." -f3)
+ #fi
+
+ #sed -i "s/netmask/$ADDR\/$NETMASK/g" /etc/bind/named.conf.options
+ sed -i "s/dns_ip_addr/"__dns_ip_addr__"/g" /etc/bind/named.conf.options
+
+ A=$(echo "__dcae_ip_addr__" | cut -d"." -f1)
+ B=$(echo "__dcae_ip_addr__" | cut -d"." -f2)
+ C=$(echo "__dcae_ip_addr__" | cut -d"." -f3)
+ sed -i "s/aai_ip_addr/"__aai_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
+ sed -i "s/appc_ip_addr/"__appc_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
+ sed -i "s/dcae_ip_addr/"__dcae_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
+ sed -i "s/dns_ip_addr/"__dns_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
+ sed -i "s/mso_ip_addr/"__mso_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
+ sed -i "s/mr_ip_addr/"__mr_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
+ sed -i "s/policy_ip_addr/"__policy_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
+ sed -i "s/portal_ip_addr/"__portal_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
+ sed -i "s/robot_ip_addr/"__robot_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
+ sed -i "s/sdc_ip_addr/"__sdc_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
+ sed -i "s/sdnc_ip_addr/"__sdnc_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
+ sed -i "s/vid_ip_addr/"__vid_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
+ sed -i "s/dcae_coll_ip_addr/"$A.$B.$C"/g" /etc/bind/zones/db.simpledemo.openecomp.org
+
+ modprobe ip_gre
+ sed -i "s/OPTIONS=.*/OPTIONS=\"-4 -u bind\"/g" /etc/default/bind9
+
+ # Restart bind to pick up configuration changes
+ 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": { get_param: aai_ip_addr }}]
+
+ aai_floating_ip:
+ type: OS::Neutron::FloatingIP
+ properties:
+ floating_network_id: { get_param: public_net_id }
+ port_id: { get_resource: aai_private_port }
+
+ aai_vm:
+ type: OS::Nova::Server
+ depends_on: sdc_vm
+ properties:
+ image: { get_param: ubuntu_1404_image }
+ flavor: { get_param: flavor_xlarge }
+ name:
+ str_replace:
+ template: base-aai
+ params:
+ base: { get_param: vm_base_name }
+ key_name: { get_resource: vm_key }
+ networks:
+ - 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 }
+ __dns_ip_addr__: { get_param: dns_ip_addr }
+ __docker_version__: { get_param: docker_version }
+ template: |
+ #!/bin/bash
+
+ hn=`hostname`
+ echo 127.0.0.1 $hn >> /etc/hosts
+
+ # 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 /opt/openecomp
+ mkdir /opt/openecomp/aai
+ mkdir /opt/openecomp/aai/logs
+ mkdir /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.onap.org" > /opt/config/gitlab_certname.txt
+ echo "__docker_version__" > /opt/config/docker_version.txt
+
+ # DNS/GW IP address configuration
+ echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
+ resolvconf -u
+
+ # Reboot the VM to pick up configuration changes
+ reboot
+
+
+ # 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": { get_param: mso_ip_addr }}]
+
+ mso_floating_ip:
+ type: OS::Neutron::FloatingIP
+ properties:
+ floating_network_id: { get_param: public_net_id }
+ port_id: { get_resource: mso_private_port }
+
+ mso_vm:
+ type: OS::Nova::Server
+ properties:
+ image: { get_param: ubuntu_1604_image }
+ flavor: { get_param: flavor_large }
+ name:
+ str_replace:
+ template: base-mso
+ params:
+ base: { get_param: vm_base_name }
+ key_name: { get_resource: vm_key }
+ networks:
+ - 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 }
+ __keystone_url__: { get_param: keystone_url }
+ __dmaap_topic__: { get_param: dmaap_topic }
+ __artifacts_version__: { get_param: artifacts_version }
+ __dns_ip_addr__: { get_param: dns_ip_addr }
+ __docker_version__: { get_param: docker_version }
+ __gerrit_branch__: { get_param: gerrit_branch }
+ template: |
+ #!/bin/bash
+
+ hn=`hostname`
+ echo 127.0.0.1 $hn >> /etc/hosts
+
+ # 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 "__keystone_url__" > /opt/config/keystone.txt
+ echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
+ echo "__docker_version__" > /opt/config/docker_version.txt
+
+ # Clone Gerrit repository
+ cd /opt
+ git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.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
+
+ # Rename network interface
+ sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
+ grub-mkconfig -o /boot/grub/grub.cfg
+ sed -i "s/ens3/eth0/g" /etc/network/interfaces.d/*.cfg
+
+ # DNS/GW IP address configuration
+ echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
+ resolvconf -u
+
+ # Reboot the VM to pick up configuration changes
+ reboot
+
+
+ # 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": { get_param: mr_ip_addr }}]
+
+ mrouter_floating_ip:
+ type: OS::Neutron::FloatingIP
+ properties:
+ floating_network_id: { get_param: public_net_id }
+ port_id: { get_resource: mrouter_private_port }
+
+ mrouter_vm:
+ type: OS::Nova::Server
+ properties:
+ image: { get_param: ubuntu_1404_image }
+ flavor: { get_param: flavor_large }
+ name:
+ str_replace:
+ template: base-message-router
+ params:
+ base: { get_param: vm_base_name }
+ key_name: { get_resource: vm_key }
+ networks:
+ - 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 }
+ __dns_ip_addr__: { get_param: dns_ip_addr }
+ __gerrit_branch__: { get_param: gerrit_branch }
+ template: |
+ #!/bin/bash
+
+ hn=`hostname`
+ echo 127.0.0.1 $hn >> /etc/hosts
+
+ # 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
+
+ # Clone Gerrit repository
+ cd /opt
+ git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/dcae/demo/startup/message-router.git dcae-startup-vm-message-router
+
+ # DNS/GW IP address configuration
+ echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
+ resolvconf -u
+
+ # Reboot the VM to pick up configuration changes
+ reboot
+
+
+ # Robot Framework instantiation
+ robot_private_port:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_resource: oam_ecomp }
+ fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: robot_ip_addr }}]
+
+ robot_floating_ip:
+ type: OS::Neutron::FloatingIP
+ properties:
+ floating_network_id: { get_param: public_net_id }
+ port_id: { get_resource: robot_private_port }
+
+ robot_vm:
+ type: OS::Nova::Server
+ properties:
+ image: { get_param: ubuntu_1604_image }
+ flavor: { get_param: flavor_small }
+ name:
+ str_replace:
+ template: base-robot
+ params:
+ base: { get_param: vm_base_name }
+ key_name: { get_resource: vm_key }
+ networks:
+ - 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 }
+ __artifacts_version__: { get_param: artifacts_version }
+ __openstack_region__: { get_param: openstack_region }
+ __dns_ip_addr__: { get_param: dns_ip_addr }
+ __docker_version__: { get_param: docker_version }
+ __gerrit_branch__: { get_param: gerrit_branch }
+ template: |
+ #!/bin/bash
+
+ hn=`hostname`
+ echo 127.0.0.1 $hn >> /etc/hosts
+
+ # 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
+ echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
+
+ # 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
+ 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_api_key__" > /opt/config/openstack_password.txt
+ echo "__openstack_region__" > /opt/config/region.txt
+ echo "__artifacts_version__" > /opt/config/artifacts_version.txt
+ echo "__docker_version__" > /opt/config/docker_version.txt
+
+ # Execute RobotETE-specific instructions: create share folder to run as a docker volume
+ mkdir -p /opt/eteshare/logs
+ mkdir -p /opt/eteshare/config
+
+ # Clone Gerrit repository
+ cd /opt
+ git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/testsuite/properties.git testsuite/properties
+
+ # Rename network interface
+ sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
+ grub-mkconfig -o /boot/grub/grub.cfg
+ sed -i "s/ens3/eth0/g" /etc/network/interfaces.d/*.cfg
+
+ # DNS/GW IP address configuration
+ echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
+ resolvconf -u
+
+ # Reboot the VM to pick up configuration changes
+ reboot
+
+
+ # 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": { get_param: vid_ip_addr }}]
+
+ vid_floating_ip:
+ type: OS::Neutron::FloatingIP
+ properties:
+ floating_network_id: { get_param: public_net_id }
+ port_id: { get_resource: vid_private_port }
+
+ vid_vm:
+ type: OS::Nova::Server
+ properties:
+ image: { get_param: ubuntu_1404_image }
+ flavor: { get_param: flavor_medium }
+ name:
+ str_replace:
+ template: base-vid
+ params:
+ base: { get_param: vm_base_name }
+ key_name: { get_resource: vm_key }
+ networks:
+ - 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 }
+ __dns_ip_addr__: { get_param: dns_ip_addr }
+ __docker_version__: { get_param: docker_version }
+ __gerrit_branch__: { get_param: gerrit_branch }
+ template: |
+ #!/bin/bash
+
+ hn=`hostname`
+ echo 127.0.0.1 $hn >> /etc/hosts
+
+ # 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
+ echo "__docker_version__" > /opt/config/docker_version.txt
+
+ # Clone Gerrit repository
+ cd /opt
+ git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/vid.git
+
+ # DNS/GW IP address configuration
+ echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
+ resolvconf -u
+
+ # Reboot the VM to pick up configuration changes
+ reboot
+
+
+ # 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": { get_param: sdnc_ip_addr }}]
+
+ sdnc_floating_ip:
+ type: OS::Neutron::FloatingIP
+ properties:
+ floating_network_id: { get_param: public_net_id }
+ port_id: { get_resource: sdnc_private_port }
+
+ sdnc_vm:
+ type: OS::Nova::Server
+ properties:
+ image: { get_param: ubuntu_1404_image }
+ flavor: { get_param: flavor_large }
+ name:
+ str_replace:
+ template: base-sdnc
+ params:
+ base: { get_param: vm_base_name }
+ key_name: { get_resource: vm_key }
+ networks:
+ - 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 }
+ __dns_ip_addr__: { get_param: dns_ip_addr }
+ __docker_version__: { get_param: docker_version }
+ __gerrit_branch__: { get_param: gerrit_branch }
+ template: |
+ #!/bin/bash
+
+ hn=`hostname`
+ echo 127.0.0.1 $hn >> /etc/hosts
+
+ # 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
+ echo "__docker_version__" > /opt/config/docker_version.txt
+
+ # Clone Gerrit repository
+ cd /opt
+ git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/sdnc/oam.git sdnc
+
+ # DNS/GW IP address configuration
+ echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
+ resolvconf -u
+
+ # Reboot the VM to pick up configuration changes
+ reboot
+
+
+ # 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": { get_param: sdc_ip_addr }}]
+
+ sdc_floating_ip:
+ type: OS::Neutron::FloatingIP
+ properties:
+ floating_network_id: { get_param: public_net_id }
+ port_id: { get_resource: sdc_private_port }
+
+ sdc_volume_data:
+ type: OS::Cinder::Volume
+ properties:
+ name: vol1-sdc-data
+ size: 100
+
+ sdc_volume_attachment:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ volume_id: { get_resource: sdc_volume_data }
+ instance_uuid: { get_resource: sdc_vm }
+ mountpoint: /dev/vdb
+
+ sdc_vm:
+ type: OS::Nova::Server
+ properties:
+ image: { get_param: ubuntu_1604_image }
+ flavor: { get_param: flavor_xlarge }
+ name:
+ str_replace:
+ template: base-sdc
+ params:
+ base: { get_param: vm_base_name }
+ key_name: { get_resource: vm_key }
+ networks:
+ - 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 }
+ __dns_ip_addr__: { get_param: dns_ip_addr }
+ __mr_ip_addr__: { get_param: mr_ip_addr }
+ __public_ip__: { get_attr: [sdc_floating_ip, floating_ip_address] }
+ __docker_version__: { get_param: docker_version }
+ __gerrit_branch__: { get_param: gerrit_branch }
+ template: |
+ #!/bin/bash
+
+ hn=`hostname`
+ echo 127.0.0.1 $hn >> /etc/hosts
+
+ # 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 -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_ext_volume_partitions.txt -o /opt/asdc_ext_volume_partitions.txt
+ sfdisk /dev/vdb < /opt/asdc_ext_volume_partitions.txt
+ mkfs -t ext4 /dev/vdb1
+ mkdir -p /data
+ mount /dev/vdb1 /data
+ echo "/dev/vdb1 /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
+ echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.txt
+ echo "__public_ip__" > /opt/config/public_ip.txt
+ echo "__docker_version__" > /opt/config/docker_version.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 777 /data
+ chmod 777 /data/logs/BE
+ chmod 777 /data/logs/FE
+
+ # Clone Gerrit repository
+ git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.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
+
+ # Rename network interface
+ sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
+ grub-mkconfig -o /boot/grub/grub.cfg
+ sed -i "s/ens3/eth0/g" /etc/network/interfaces.d/*.cfg
+
+ # DNS/GW IP address configuration
+ echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
+ resolvconf -u
+
+ # Reboot the VM to pick up configuration changes
+ reboot
+
+
+ # 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": { get_param: portal_ip_addr }}]
+
+ portal_floating_ip:
+ type: OS::Neutron::FloatingIP
+ properties:
+ floating_network_id: { get_param: public_net_id }
+ port_id: { get_resource: portal_private_port }
+
+ portal_vm:
+ type: OS::Nova::Server
+ properties:
+ image: { get_param: ubuntu_1404_image }
+ flavor: { get_param: flavor_large }
+ name:
+ str_replace:
+ template: base-portal
+ params:
+ base: { get_param: vm_base_name }
+ key_name: { get_resource: vm_key }
+ networks:
+ - 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 }
+ __dns_ip_addr__: { get_param: dns_ip_addr }
+ __public_ip__: { get_attr: [portal_floating_ip, floating_ip_address] }
+ __docker_version__: { get_param: docker_version }
+ __gerrit_branch__: { get_param: gerrit_branch }
+ template: |
+ #!/bin/bash
+
+ hn=`hostname`
+ echo 127.0.0.1 $hn >> /etc/hosts
+
+ # 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
+ echo "__public_ip__" > /opt/config/public_ip.txt
+ echo "__docker_version__" > /opt/config/docker_version.txt
+
+ # Clone Gerrit repository
+ mkdir -p /PROJECT/OpenSource/UbuntuEP/logs
+ cd /opt
+ git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/portal.git
+
+ # DNS/GW IP address configuration
+ echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
+ resolvconf -u
+
+ # Reboot the VM to pick up configuration changes
+ reboot
+
+
+ # 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": { get_param: dcae_ip_addr }}]
+
+ dcae_c_floating_ip:
+ type: OS::Neutron::FloatingIP
+ properties:
+ floating_network_id: { get_param: public_net_id }
+ port_id: { get_resource: dcae_c_private_port }
+
+ dcae_c_vm:
+ type: OS::Nova::Server
+ properties:
+ image: { get_param: ubuntu_1404_image }
+ flavor: { get_param: flavor_medium }
+ name:
+ str_replace:
+ template: base-dcae-controller
+ params:
+ base: { get_param: vm_base_name }
+ key_name: { get_resource: vm_key }
+ networks:
+ - 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 }
+ __dns_ip_addr__: { get_param: dns_ip_addr }
+ __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 }
+ __horizon_url__ : { get_param: horizon_url }
+ __keystone_url__ : { get_param: keystone_url }
+ __docker_version__: { get_param: docker_version }
+ __gerrit_branch__: { get_param: gerrit_branch }
+ template: |
+ #!/bin/bash
+
+ hn=`hostname`
+ echo 127.0.0.1 $hn >> /etc/hosts
+
+ # 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
+
+ # Clone Gerrit repository
+ cd /opt
+ git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/dcae/demo/startup/controller.git dcae-startup-vm-controller
+
+ # DCAE Controller specific deployment
+ cd /opt/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: __artifacts_version__
+ HORIZON-URL: __horizon_url__/__openstack_user__
+ KEYSTONE-URL: __keystone_url__
+ 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.onap.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
+ echo "__docker_version__" > /opt/config/docker_version.txt
+
+ # DNS/GW IP address configuration
+ echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
+ resolvconf -u
+
+ # Reboot the VM to pick up configuration changes
+ reboot
+
+
+ # 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": { get_param: policy_ip_addr }}]
+
+ policy_floating_ip:
+ type: OS::Neutron::FloatingIP
+ properties:
+ floating_network_id: { get_param: public_net_id }
+ port_id: { get_resource: policy_private_port }
+
+ policy_vm:
+ type: OS::Nova::Server
+ properties:
+ image: { get_param: ubuntu_1404_image }
+ flavor: { get_param: flavor_xlarge }
+ name:
+ str_replace:
+ template: base-policy
+ params:
+ base: { get_param: vm_base_name }
+ key_name: { get_resource: vm_key }
+ networks:
+ - 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 }
+ __dns_ip_addr__: { get_param: dns_ip_addr }
+ __public_ip__: { get_attr: [policy_floating_ip, floating_ip_address] }
+ __docker_version__: { get_param: docker_version }
+ __gerrit_branch__: { get_param: gerrit_branch }
+ template: |
+ #!/bin/bash
+
+ hn=`hostname`
+ echo 127.0.0.1 $hn >> /etc/hosts
+
+ # 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
+ echo "__public_ip__" > /opt/config/public_ip.txt
+ echo "__docker_version__" > /opt/config/docker_version.txt
+
+ # Clone Gerrit repository
+ cd /opt
+ git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/policy/docker.git policy
+
+ # DNS/GW IP address configuration
+ echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
+ resolvconf -u
+
+ # Reboot the VM to pick up configuration changes
+ reboot
+
+
+ # 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": { get_param: appc_ip_addr }}]
+
+ appc_floating_ip:
+ type: OS::Neutron::FloatingIP
+ properties:
+ floating_network_id: { get_param: public_net_id }
+ port_id: { get_resource: appc_private_port }
+
+ appc_vm:
+ type: OS::Nova::Server
+ properties:
+ image: { get_param: ubuntu_1404_image }
+ flavor: { get_param: flavor_large }
+ name:
+ str_replace:
+ template: base-appc
+ params:
+ base: { get_param: vm_base_name }
+ key_name: { get_resource: vm_key }
+ networks:
+ - 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 }
+ __dns_ip_addr__: { get_param: dns_ip_addr }
+ __docker_version__: { get_param: docker_version }
+ __gerrit_branch__: { get_param: gerrit_branch }
+ template: |
+ #!/bin/bash
+
+ hn=`hostname`
+ echo 127.0.0.1 $hn >> /etc/hosts
+
+ # 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
+ echo "__docker_version__" > /opt/config/docker_version.txt
+
+ # Clone Gerrit repository
+ cd /opt
+ git clone -b __gerrit_branch__ --single-branch https://__gitlab_username__:__gitlab_password__@gerrit.onap.org/r/a/appc/deployment.git appc
+
+ # DNS/GW IP address configuration
+ echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
+ resolvconf -u
+
+ # Reboot the VM to pick up configuration changes
+ reboot
+