To add a new ONAP component to Heat it is necessary to complete the following three steps:
- Add the definition of a new component VM to the Heat template
- Make sure that all the component-specific configuration is in the Gerrit repository
- Prepare installation scripts that install software dependencies and docker containers
Add the definition of a new component VM to the Heat template
The Heat template contains the definition of the ONAP components and the Operation And Management (OAM) private network that those components use to communicate with each other. Each component has a fixed private IP address towards the OAM network, in the 10.0.0.0/16 address space.
The Heat stack contains a DNS server that resolves the Fully Qualified Domain Names (FQDNs) to IP addresses. The DNS configuration has an entry for each component VM, for example:
vm1.aai.simpledemo.openecomp.org. IN A aai1_ip_addr
Then, all the services that run in a VM are associated to that FQDN:
aai.api.simpledemo.openecomp.org. IN CNAME vm1.aai.simpledemo.openecomp.org.
aai.ui.simpledemo.openecomp.org. IN CNAME vm1.aai.simpledemo.openecomp.org.
aai.searchservice.simpledemo.openecomp.org. IN CNAME vm1.aai.simpledemo.openecomp.org.
Adding a new ONAP component requires to add a description of the host VM in terms of operating system, flavor (number of vCPUs, RAM, disk), ports, etc. The VM description also contains a "user data" section that is used to implement custom operations. In ONAP, the "user data" section is used to save environment-specific parameters in the VM and make them usable by installation scripts (see next sections).
Find below the description of the SO VM:
- MSO instantiation
mso_private_port:
type: OS::Neutron::Port
properties:
network:Unknown macro: { get_resource}fixed_ips: [Unknown macro: {"subnet"}]
mso_floating_ip:
type: OS::Neutron::FloatingIP
properties:
floating_network_id:
port_id:
mso_vm:
type: OS::Nova::Server
properties:
image:
flavor:
name:
str_replace:
template: base-mso
params:
base:
key_name:
networks:
- port:
Unknown macro: { get_resource}user_data_format: RAW
user_data:
str_replace:
params:
_nexus_repo_:Unknown macro: { get_param}_nexus_docker_repo_:Unknown macro: { get_param}_nexus_username_:Unknown macro: { get_param}_nexus_password_:Unknown macro: { get_param}_openstack_username_:Unknown macro: { get_param}_openstack_tenant_id_:Unknown macro: { get_param}_openstack_api_key_:Unknown macro: { get_param}_openstack_region_:Unknown macro: { get_param}_keystone_url_:Unknown macro: { get_param}_dmaap_topic_:Unknown macro: { get_param}_artifacts_version_:Unknown macro: { get_param}_dns_ip_addr_:Unknown macro: { get_param}_docker_version_:Unknown macro: { get_param}_gerrit_branch_:Unknown macro: { get_param}_cloud_env_:Unknown macro: { get_param}_external_dns_:Unknown macro: { get_param}_mso_repo_:Unknown macro: { get_param}template: |
#!/bin/bash
- Create configuration files
mkdir -p /opt/config
echo "_nexus_repo_" > /opt/config/nexus_repo.txt
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 "_artifacts_version_" > /opt/config/artifacts_version.txt
echo "_dns_ip_addr_" > /opt/config/dns_ip_addr.txt
echo "_dmaap_topic_" > /opt/config/dmaap_topic.txt
echo "_openstack_username_" > /opt/config/openstack_username.txt
echo "_openstack_tenant_id_" > /opt/config/tenant_id.txt
echo "_openstack_api_key_" > /opt/config/openstack_api_key.txt
echo "_openstack_region_" > /opt/config/openstack_region.txt
echo "_keystone_url_" > /opt/config/keystone.txt
echo "_docker_version_" > /opt/config/docker_version.txt
echo "_gerrit_branch_" > /opt/config/gerrit_branch.txt
echo "_cloud_env_" > /opt/config/cloud_env.txt
echo "_external_dns_" > /opt/config/external_dns.txt
echo "_mso_repo_" > /opt/config/remote_repo.txt
- Download and run install script
curl -k _nexus_repo/org.onap.demo/boot/artifacts_version_/mso_install.sh -o /opt/mso_install.sh
cd /opt
chmod +x mso_install.sh
./mso_install.sh