blob: af6144fef877b52d71ef083e39e921d8146e9ff7 [file] [log] [blame]
Lusheng Jia73548f2017-11-05 19:24:05 -05001OpenStack Heat Template Based ONAP Deployment
2=============================================
3
Lusheng Jic02a89f2017-11-20 11:35:35 -05004For ONAP R1, ONAP is deployed using OpenStack Heat template. DCAE is also deployed through this process. This i document describes the details of the Heat template deployment process and how to configure DCAE related parameters in the Heat template and its parameter file.
Lusheng Jia73548f2017-11-05 19:24:05 -05005
6
Lusheng Jic02a89f2017-11-20 11:35:35 -05007ONAP Deployment Overview
8------------------------
Lusheng Jia73548f2017-11-05 19:24:05 -05009
10ONAP supports an OpenStack Heat template based system deployment. When a new "stack" is created using the template, the following virtual resources will be launched in the target OpenStack tenant:
11
12* A four-character alphanumerical random text string, to be used as the ID of the deployment. It is denoted as {{RAND}} in the remainder of this document.
13* A private OAM network interconnecting all ONAP VMs, named oam_onap_{{RAND}}.
14* A virtual router interconnecting the private OAM network with the external network of the OpenStack installation.
15* A key-pair named onap_key_{{RAND}}.
16* A security group named onap_sg_{{RAND}}.
Lusheng Jic02a89f2017-11-20 11:35:35 -050017* A list of VMs for ONAP components. Each VM has one NIC connected to the OAM network and assigned a fixed IP. Each VM is also assigned a floating IP address from the external network. The VM hostnames are name consistently across different ONAP deployments, a user defined prefix, denoted as {{PREFIX}}, followed by a descriptive string for the ONAP component this VM runs, and optionally followed by a sub-function name. In the parameter env file supplied when running the Heat template, the {{PREFIX}} is defined by the **vm_base_name** parameter. The VMs of the same ONAP role across different ONAP deployments will always have the same OAM network IP address. For example, the Message Router will always have the OAM network IP address of 10.0.11.1.
Lusheng Jia73548f2017-11-05 19:24:05 -050018
19 ============== ========================== ==========================
20 ONAP Role VM (Neutron) hostname OAM IP address(s)
21 ============== ========================== ==========================
22 A&AI {{PREFIX}}-aai-inst1 10.0.1.1
23 A&AI {{PREFIX}}-aai-inst2 10.0.1.2
24 APPC {{PREFIX}}-appc 10.0.2.1
25 SDC {{PREFIX}}-sdc 10.0.3.1
26 DCAE {{PREFIX}}-dcae-bootstrap 10.0.4.1
27 SO {{PREFIX}}-so 10.0.5.1
28 Policy {{PREFIX}}-policy 10.0.6.1
29 SD&C {{PREFIX}}-sdnc 10.0.7.1
30 VID {{PREFIX}}-vid 10.0.8.1
31 Portal {{PREFIX}}-portal 10.0.9.1
32 Robot TF {{PREFIX}}-robot 10.0.10.1
33 Message Router {{PREFIX}}-message-router 10.0.11.1
34 CLAMP {{PREFIX}}-clamp 10.0.12.1
35 MultiService {{PREFIX}}-multi-service 10.0.14.1
36 Private DNS {{PREFIX}}-dns-server 10.0.100.1
37 ============== ========================== ==========================
Lusheng Jic02a89f2017-11-20 11:35:35 -050038* Each of the above VMs will also be associated with a floating IP address from the external network.
39* A list of DCAE VMs, launched by the {{PREFIX}}-dcae-bootstrap VM. These VMs are also connected to the OAM network and associated with floating IP addresses on the external network. What's different is that their OAM IP addresses are DHCP assigned. The table below lists the DCAE VMs that are deployed for R1 use stories.
Lusheng Jia73548f2017-11-05 19:24:05 -050040
Eric Debeaude420982017-11-13 22:16:07 +000041 ===================== ============================
42 DCAE Role VM (Neutron) hostname(s)
43 ===================== ============================
Lusheng Jia73548f2017-11-05 19:24:05 -050044 Cloudify Manager {{DCAEPREFIX}}orcl{00}
45 Consul cluster {{DCAEPREFIX}}cnsl{00-02}
46 Platform Docker Host {{DCAEPREFIX}}dokp{00}
Eric Debeaude420982017-11-13 22:16:07 +000047 Service Docker Host {{DCAEPREFIX}}doks{00}
Lusheng Jia73548f2017-11-05 19:24:05 -050048 CDAP cluster {{DCAEPREFIX}}cdap{00-06}
49 Postgres {{DCAEPREFIX}}pgvm{00}
Eric Debeaude420982017-11-13 22:16:07 +000050 ===================== ============================
Lusheng Jia73548f2017-11-05 19:24:05 -050051
Lusheng Jia73548f2017-11-05 19:24:05 -050052
Lusheng Jic02a89f2017-11-20 11:35:35 -050053DNS Configurations and Designate
Lusheng Jic5e03752017-11-22 00:38:22 -050054--------------------------------
Lusheng Jia73548f2017-11-05 19:24:05 -050055
Lusheng Jic02a89f2017-11-20 11:35:35 -050056.. image:: images/designate.gif
Lusheng Jia73548f2017-11-05 19:24:05 -050057
Lusheng Jic02a89f2017-11-20 11:35:35 -050058When DCAE VMs are launched by the dcae-bootstrap VM, they obtain their OAM IP addresses from
59the DHCP server running on the OAM network (ONAP private network). Because these addresses
60are dynamic, DCAE VMs rely on the OpenStack **Designate** DNSaaS API for registering their
61IP-address-to-hostname bindings.
Lusheng Jia73548f2017-11-05 19:24:05 -050062
Lusheng Jic02a89f2017-11-20 11:35:35 -050063DCAE VMs register their hostnames under a DNS zone. This zone can be a zone that is exposed
64to the global DNS hierarchy, or a zone that is only known to the ONAP deployment. The actual
65zone name is configurable, by the blueprint input files of the DCAE VMs. By default they are
66set to be {{DCAE_ZONE}}.{{DOMAIN_NAME}}, where {{DCAE_ZONE}} is set to the {{RANDID}} and the
67domain name is set to "dcaeg2.onap.org". If DCAE VMs are required to be routable in operator organization or on the Internet, it is expected that the DNS domain is already configured in
68the organizational or global DNS hierarchy.
Lusheng Jia73548f2017-11-05 19:24:05 -050069
Lusheng Jic02a89f2017-11-20 11:35:35 -050070For OpenStack installations without Designate, there is an alternative "Proxyed-Designate"
71solution. That is, a second OpenStack installation with Designate support is used for
72providing Designate API and DNSaaS for the first OpenStack installation where ONAP is
73deployed. The Designate API calls from DCAE VMs are proxyed through the MultiCloud
74service running in the same ONAP installation. The diagram above illustrates the solution.
75Such a solution can be utilized by operators who have difficulties enhancing their existing
76OpenStack infrastructure with Designate. The ONAP Pod25 lab is configured using this
77approach.
78
79To prepare for using the proxyed-Designate solution for an ONAP deployment, a surrogate
80tenant needs to be set up in the Designate-providing OpenStack. The name of the surrogate
81tenant must match with the name of the tenant where the ONAP is deployed. At DCAE bootstrap
82time, the dcae2_vm_init.sh script will first register two records into A&AI, which contain
83parameters describing the two OpenStack installations, parameters that are needed by the MultiCloud service when performing the Designate and other API call proxying.
84
85When DCAE VMs make OpenStack API calls, these calls are made to the MultiCloud service
86node instead, not to the underlying OpenStack cloud infrastructure. For non-Designate
87calls, the MultiCloud node proxys them to the same OpenStack installation and the project
88where the ONAP is installed. For Designate
89calls, the MultiCloud node proxys to the Designate-providing OpenStack installation as if
90such calls are for the surrogate tenant. The result is that the Designate providing
91OpenStack's backend DNS server will have the new records for DCAE VMs and their IP
92addresses.
93
94ONAP VMs deployed by Heat template are all registered with the private DNS server under the domain name of **simpledemo.onap.org**. This domain can not be exposed to any where outside of the ONAP deployment because all ONAP deployments use the same domain name and same address space. Hence these host names remain only resolvable within the same ONAP deployment. On the
95other hand DCAE VMs have host names under the DNS zone of **{{DCAE_ZONE}}.{{DOMAIN_NAME}}**,
96which can be set up to be resolvable within organizational network or even global Internet.
97
98To make the hostnames of ONAP VMs and external servers (e.g. onap.org) resolvable, the
99following DNS related configurations are needed.
100
101* The ONAP deployment's private DNS server, 10.0.100.1, is the default resolver for all the VMS. This is necessary to make the **simpledemo.onap.org** hostnames resolvable.
102* The ONAP deployment's private DNS server, 10.0.100.1, must have the Designate backend DNS server as the forwarder. This is necessary to make the **{{DCAE_ZONE}}.{{DOMAIN_NAME}}** hostnames resolvable.
103* The Designate backend DNS server needs to be configured so it can resolve all global hostnames. One exemplary configuration for achieving this is to have an external DNS server such as an organizational or global DNS server, e.g. Google's 8.8.8.8, as the forwarder.
104
105As the result of such configurations, below lists how different hostnames are resolved, as illustrated in the figure above:
106
107* For hostnames within the **simpledemo.onap.org** domain, the private DNS server at 10.0.100.1 has the bindings;
108* For hostnames within the **{{DCAE_ZONE}}.{{DOMAIN_NAME}}** domain, the private DNS server forwards to the Designate backend DNS server, which has the bindings;
109* For all other hostnames, e.g. ubuntu.org, the private DNS server forwards to the Designate backend DNS server, which then forwards to an external DNS server that has or is able to further forward request to a DNS server that has the bindings.
110
111We wil go over the details of related Heat template env parameters in the next section.
Lusheng Jia73548f2017-11-05 19:24:05 -0500112
113Heat Template Parameters
Lusheng Jic5e03752017-11-22 00:38:22 -0500114------------------------
Lusheng Jia73548f2017-11-05 19:24:05 -0500115
116Here we list Heat template parameters that are related to DCAE operation. Bold values are the default values that should be used "as-is".
117
Lusheng Jic02a89f2017-11-20 11:35:35 -0500118* public_net_id: the UUID of the external network where floating IPs are assigned from. For example: 971040b2-7059-49dc-b220-4fab50cb2ad4.
119* public_net_name: the name of the external network where floating IPs are assigned from. For example: external.
Eric Debeaude420982017-11-13 22:16:07 +0000120* openstack_tenant_id: the ID of the OpenStack tenant/project that will host the ONAP deployment. For example: dd327af0542e47d7853e0470fe9ad625.
121* openstack_tenant_name: the name of the OpenStack tenant/project that will host the ONAP deployment. For example: Integration-SB-01.
122* openstack_username: the username for accessing the OpenStack tenant specified by openstack_tenant_id/openstack_tenant_name.
123* openstack_api_key: the password for accessing the OpenStack tenant specified by openstack_tenant_id/openstack_tenant_name.
Lusheng Jic02a89f2017-11-20 11:35:35 -0500124* openstack_auth_method: '**password**'.
125* openstack_region: '**RegionOne**'.
126* cloud_env: '**openstack**'.
Lusheng Jic5e03752017-11-22 00:38:22 -0500127* dns_list: This is the list of DNS servers to be configured into DHCP server of the ONAP OAM network. As mentioned above it needs to have the ONAP private DNS server as the first item, then one or more external DNS servers next, for example: **["10.0.100.1", "8.8.8.8"]**. For installations where the private DNS server VM takes too long to be set up, the solution is to use the Designate backend DNS server as the first entry in this list. Fot example **["10.12.25.5", "8.8.8.8"]**.
Lusheng Jic02a89f2017-11-20 11:35:35 -0500128* external_dns: This is the first external DNS server in the list above. For example, **"8.8.8.8"**
129* dns_forwarder: This is the DNS forwarder for the ONAP private DNS server. It must point to the IP address of the Designate backend DNS. For example **'10.12.25.5'** for the Integration Pod25 lab.
130* dcae_ip_addr: The static IP address on the OAM network that is assigned to the DCAE bootstraping VM. **10.0.4.1**.
Eric Debeaude420982017-11-13 22:16:07 +0000131* dnsaas_config_enabled: Whether a proxy-ed Designate solution is used. For example: **true**.
Lusheng Jic02a89f2017-11-20 11:35:35 -0500132* dnsaas_region: The OpenStack region of the Designate-providing OpenStack installation. For example: **RegionOne**.
133* dnsaas_tenant_name: The surrogate tenant/project name of the Designate-providing OpenStack. It must match with the *openstack_tenant_name* parameter. For example Integration-SB-01.
134* dnsaas_keystone_url: The keystone URL of the Designate providing OpenStack. For example **http://10.12.25.5:5000/v3**.
135* dnsaas_username: The username for accessing the surrogate tenant/project in Designate providing OpenStack. For Pod25 Integration lab, this value is set to **demo**.
136* dnsaas_password: The password for accessing surrogate tenant/project in the Designate providing OpenStack. For Pod25 Integration lab, this value is set to **onapdemo**.
137* dcae_keystone_url: This is the keystone API endpoint used by DCAE VMs. If MultiCloud proxying is used, this parameter needs to provide the service endpoint of the MltiCloud service node: **"http://10.0.14.1/api/multicloud-titanium_cloud/v0/pod25_RegionOne/identity/v2.0"**. Otherwise it shall point to the keystone 2.0 API endpoint of the under-lying OpenStack installation.
Lusheng Jia73548f2017-11-05 19:24:05 -0500138* dcae_centos_7_image: The name of the CentOS-7 image.
Lusheng Jic02a89f2017-11-20 11:35:35 -0500139* dcae_domain: The domain under which DCAE VMs register their zone. For example: **'dcaeg2.onap.org'**.
Lusheng Jia73548f2017-11-05 19:24:05 -0500140* dcae_public_key: the public key of the onap_key_{{RAND}} key-pair.
Lusheng Jic02a89f2017-11-20 11:35:35 -0500141* dcae_private_key: The private key of the onap_key_{{RAND}} key-pair (with the additions of literal \n at the end of each line of text).
142
143
Lusheng Jia73548f2017-11-05 19:24:05 -0500144
145Heat Deployment
Lusheng Jic5e03752017-11-22 00:38:22 -0500146---------------
Lusheng Jia73548f2017-11-05 19:24:05 -0500147
148Heat template can be deployed using the OpenStack CLI. For more details, please visit the demo project of ONAP. All files references in this secton can be found under the **demo** project.
149
150In the Heat template file **heat/ONAP/onap_openstack.yaml** file, there is one block of sepcification towrads the end of the file defines the dcae_bootstrap VM. This block follows the same approach as other VMs defined in the same template. That is, a number of parameters within the Heat context, such as the floating IP addresses of the VMs and parameters provided in the user defined parameter env file, are written to disk files under the /opt/config directory of the VM during cloud init time. Then a script, found under the **boot** directory of the **demo** project, **{{VMNAME}}_install.sh**, is called to prepare the VM. At the end of running this script, another script **{VMNAME}}_vm_init.sh** is called.
151
152For DCAE bootstrap VM, the dcae2_vm_init.sh script completes the following steps:
153
154* If we use proxy-ed Designate solution, runs:
155 * Wait for A&AI to become ready
156 * Register MultiCloud proxy information into A&AI
157 * Wait for MultiCloud proxy node ready
158 * Register the DNS zone for the ONAP installation, **{{RAND}}.dcaeg2.onap.org**
159* Runs DCAE bootstrap docker container
160 * Install Cloudify locally
161 * Launch the Cloudify Manager VM
162 * Launch the Consul cluster
163 * Launch the platform component Docker host
164 * Launch the service component Docker host
165 * Launch the CDAP cluster
166 * Install Config Binding Service onto platform component Docker host
167 * Launch the Postgres VM
168 * Install Platform Inventory onto platform component Docker host
169 * Install Deployment Handler onto platform component Docker host
170 * Install Policy Handler onto platform component Docker host
171 * Install CDAP Broker onto platform component Docker host
172 * Install VES collector onto service component Docker host
173 * Install TCA analytics onto CDAP cluster
174 * Install Holmes Engine onto service component Docker host
175 * Install Holmes Rules onto service component Docker host
176* Starts a Nginx docker container to proxy the healthcheck API to Consul
177* Enters a infinite sleep loop to keep the bootstrap container up
178
179
Lusheng Jic02a89f2017-11-20 11:35:35 -0500180Removing Deployed ONAP Deployment
Lusheng Jic5e03752017-11-22 00:38:22 -0500181---------------------------------
Lusheng Jic02a89f2017-11-20 11:35:35 -0500182
183Because DACE VMs are not deployed directly from Heat template, they need to be deleted using
184a separate method.
185
186* Ssh into the dcae-bootstrap VM
187* Enter the dcae-bootstrap container by executing:
188 * **sudo docker exec -it boot /bin/bash**
189* Inside of the bootstrap container, execute:
190 * **bash ./teardown**
191 * All DCAE assets deployed by the bootstrap container will be uninstalled in the reverse order that they are installed.
192* Exit from the bootstrap container.
193
194After all DCAE assets are deleted, the next step is to delete the ONAP stack, using either the
195dashboard GUI or openstack CLI.
196
197When VMs are not terminated in a graceful fashion, certain resources such as ports and floating
198IP addresses may not be released promptly by OpenStack. One "quick-nad-dirty" way to release
199these resources is to use the openstack CLI with the following commands::
200
201 openstack port list |grep 'DOWN' |cut -b 3-38 |xargs openstack port delete
202 openstack floating ip list |grep 'None' |cut -b 3-38 |xargs openstack floating ip delete
203
204
Lusheng Jic5e03752017-11-22 00:38:22 -0500205Tips for Manual Interventions
206-----------------------------
207
208During DCAE deployment, there are several places where manual interventions are possible:
209
210* Running dcae2_install.sh
211* Running dcae2_vm_init.sh
212* Running the dcae bootstrap docker.
213
214All these require ssh-ing into the dcae-botstrap VM, then change directory or /opt and sudo.
215Configurations injected from the Heat template and cloud init can be found under /opt/config.
216DCAE run time configuration values can be found under /opt/app/config. After any parameters are changed, the dcae2_vm_init.sh script needs to be rerun.
217
218Some manual interventions also require interaction with the OpenStack environment. This can be
219done by using the OpenStack CLI tool. OpenStack CLI tool comes very handy for various uses in deployment and maintenance of ONAP/DCAE.
220
221It is usually most convenient to install OpenStack CLI tool in a Python virtual environment. Here are the steps and commands::
222
223 # create and activate the virtual environment, install CLI
224 $ virtualenv openstackcli
225 $ . openstackcli/bin/activate
226 $ pip install --upgrade pip python-openstackclient python-designateclient python-novaclient python-keystoneclient python-heatclient
227
228 # here we need to download the RC file form OpenStack dashboard:
229 # Compute->Access & Security_>API Aceess->Download OpenStack RC file
230
231 # activate the environment variables with values point to the taregt OpenStack tenant
232 (openstackcli) $ . ./openrc.sh
233
234Now we are all set for using OpenStack cli tool to run various commands. For example::
235
236 # list all tenants
237 (openstackcli) $ openstack project list
238
239Designate/DNS related operations::
240
241 # DNS/Designate related commands
242 # list all DNS zones
243 (openstackcli) $ openstack zone list
244 # create a new zone
245 (openstackcli) $ openstack zone create ${ZONENAME} --email dcae@onap.org
246 # delete an existing zone
247 (openstackcli) $ openstack zone delete ${ZONENAME}
248
249Note that depending on OpenStack configuration, there may be a quota for how many zones can be created
250under each tenant. If such limit is reached, further zone creation request will be rejected. In this case manual deletions for zones no longer needed is one of the ways to reduce outstanding zones.
251
252When VMs are not terminated in a graceful fashion, certain resources such as ports and floating
253IP addresses may not be released properly by OpenStack. One "quick-nad-dirty" way to release
254these resources is to use the openstack CLI with the following commands::
255
256 (openstackcli) $ openstack port list |grep 'DOWN' |cut -b 3-38 |xargs openstack port delete
257 (openstackcli) $ openstack floating ip list |grep 'None' |cut -b 3-38 |xargs openstack floating ip delete
258
259
260Finally to deactivate from the virtual environment, run::
261
262 (openstackcli) $ deactivate
263
264