2ce93e805f900ab41b810ee73b68db2485b8d85a
[vfc/nfvo/driver/vnfm/svnfm.git] / nokiav2 / docs / integration.rst
1 Integrate ONAP with Nokia VNFM
2 ==============================
3
4 The following section describes how to integrate the Nokia Virtualized Network Function Manager (VNFM) into ONAP.
5
6 Prepare the VNFM
7 ----------------
8
9 * Start the VNFM.
10
11  - The VNFM must be able to communicate with the ONAP VF-C interface, the virtualized infrastructure manager (VIM) and the virtualized network function (VNF), so the VNFM must
12  have the correct network setup. The VNFM uses lifecycle notifications (LCNs) to notify the VF-C about the executed changes, therefore, the LCN zone of the
13  VNFM must be configured so that the VNFM is able to reach the VF-C LCN interface.
14
15 * Register driver in CBAM
16
17  - Using SSH, log in to the CloudBand Application Manager (CBAM) virtual machine as cbam user and determine the Keycloak
18   auto-generated admin password with the following command: ectl get /cbam/cluster/components/keycloak/admin_credentials/password
19
20  - Copy the printout of the command.
21
22  - Access the Keycloak login page with the following URL: https://<cbamIp>/auth/admin where <cbamIp> is the FQDN or IP
23  address assigned to CBAM node during instantiation. Optionally, it may contain a port, for example, cbam.mycompany.com:port or 1.2.3.4:port.
24
25    Result: The Keycloak Administration Console login page loads up.
26
27  - Log in to Keycloak with the 'admin' username and the auto-generated admin password you copied to clipboard, then change the auto-generated password and note the new password.
28
29    Result: You are logged in to the Keycloak Administration Console.
30
31  - Add a new client on Keycloak:
32
33   - From the Configure menu, select Clients.
34
35     - Result: The Clients pane appears.
36
37   - Click Create.
38
39     - Result: The Add Client pane appears.
40
41   - Set the Client ID to onapClientId and click Save. Note the Client ID which will be referred to as <clientId>.
42
43     - Result: The following notification appears: Success! The client has been created. The new client's profile page appears.
44
45   - Customize the following settings for the newly created client:
46
47     - Access Type: select confidential. Keycloak will generate a client secret that serves as a type of password for your client.
48
49     - Make sure the following settings are ON: Standard Flow Enabled, Direct Access Grants Enabled, Service Accounts Enabled, Authorization Enabled
50
51     - Type * in the Valid Redirect URIs field.
52
53     - Click Save.
54
55       - Result: The following notification appears: Success! Your changes have been saved to the client.
56
57   - Note the Client Secret which will be referred to as <clientSecret>:
58
59     - Select the Credentials tab.
60
61     - From the Client Authenticator drop-down list, select the Client ID and Secret and check the value of Secret.
62
63  - Add a new user on Keycloak:
64
65   - From the Manage menu, select Users.
66
67     - Result: The Users pane appears.
68
69   - Click Add user and define the parameters for the creation:
70
71     - Username: onap
72
73       - Note the username, it will be referred to as <onapUsername>.
74
75     - User Enabled: make sure it is On.
76
77   - Click Save.
78
79     - Result: The following notification appears: Success! The user has been created. The new user's profile page appears.
80
81   - Create a password for the user: select the Credentials tab on the user profile and set the password.
82
83     - Note: The user is prompted to change this password when logging in to CBAM for the first time.
84
85   - Assign the "user" role to the created user:
86
87     - Select the Role Mappings tab on the user profile.
88
89     - Select the "user" role from the Available Roles box, then click Add selected.
90
91  - Access the CBAM GUI login page with the following URL: https://<cbamIp> where <cbamIp> is the FQDN or IP address assigned to CBAM node during instantiation. Optionally, it may contain a port, for example, cbam.mycompany.com:port or 1.2.3.4:port.
92
93  - Log in to CBAM GUI using the created user.
94
95   - Change and note the password which will be referred to as <onapPassword>.
96
97  - Using SSH, add SSL certificates for all VIM connections or disable certificate verification as follows:
98
99   - For insecure connection (all certificates are automatically trusted)
100
101    - execute the below commands in the following order:
102
103 .. code-block:: console
104
105    sudo su -
106    ectl set /cbam/cluster/components/tlm/insecure_vim_connection true
107    ectl set /actions/reconfigure start
108    journalctl -fu cbam-reconfigure.service
109
110    - Wait for the "Started cbam-reconfigure.service." message.
111
112   - For secure connection : read the CBAM documentation.
113
114 Prepare /ets/hosts file on your laptop
115 --------------------------------------
116
117 Note: This is an optional step with which it is easier to copy paste URLs
118
119 * Using the OpenStack Horizon Dashboard, find the ONAP servers you have deployed and note their IP addresses.
120
121 * Depending on your operating system, use the respective method to prepare an /ets/hosts file to link the DNS servers to the corresponding IP addresses, see the table below:
122
123 +-------------------+---------------------------------+
124 | IP address        | DNS entry                       |
125 +===================+=================================+
126 | <fill IP address> | portal.api.simpledemo.onap.org  |
127 +-------------------+---------------------------------+
128 | <fill IP address> | policy.api.simpledemo.onap.org  |
129 +-------------------+---------------------------------+
130 | <fill IP address> | sdc.api.simpledemo.onap.org     |
131 +-------------------+---------------------------------+
132 | <fill IP address> | vid.api.simpledemo.onap.org     |
133 +-------------------+---------------------------------+
134 | <fill IP address> | aai.api.simpledemo.onap.org     |
135 +-------------------+---------------------------------+
136 | <fill IP address> | msb.api.simpledemo.onap.org     |
137 +-------------------+---------------------------------+
138 | <fill IP address> | robot.api.simpledemo.onap.org   |
139 +-------------------+---------------------------------+
140
141 Add the VNFM driver to ONAP
142 ---------------------------
143
144 - Locate and note the IP address of the MSB (MSB_IP) on the OpenStack Horizon Dashboard. Look at the VM instances of ONAP and find one with vm1-multi-service name. This is where the MSB is located.
145
146 - Create VIM in A&AI Note:
147
148   - The VIM may already exist.
149
150   - Repeat this step for all VIMs planned to be used.
151
152  - Go to http://msb.api.simpledemo.onap.org/iui/aai-esr-gui/extsys/vim/vimView.html
153
154    - Result: The ONAP platform opens.
155
156  - On the platform, click Register.
157
158    - Result: The registration form opens.
159
160  - Fill in the fields.
161
162    - Note: Cloud credentials are supplied by the VNF integrator.
163
164    - To obtain the value of the Auth URL field and the tenant id (which will be required later), follow these steps:
165      - Note: The actual steps depend on the OpenStack Dashboard version and vendor.
166      - Go to OpenStack Horizon Dashboard.
167      - Select the Project main tab.
168      - Select the API Access tab.
169      - Click View Credentials.
170      - Copy the value of Authentication URL and paste it in the Auth URL field.
171      - Note the value of Project ID: this is the <tenantId> which will be required later (Repeat this step for all tenants planned to be used within the VIM.)
172
173  - Click Save.
174
175    - Result: The driver has been successfully added.
176
177 - Create tenant
178
179   - Note:
180
181     - The tenant may already exist.
182
183     - Repeat this step for all tenants planned to be used within the VIM.
184
185  - Using a REST client of your choice, send a request to the following URL: https://aai.api.simpledemo.onap.org:8443/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/<cloudOwner>/<cloudRegion>/tenants/tenant/<tenantId>
186
187    - download the content of the request: `aai.create.tenant.request.json <sample/aai.create.tenant.request.json>`
188    - In the request URL and in the content of the request, substitute <tenantId>, <cloudRegion> and <cloudOwner> with the respective values.
189    - HTTP method: PUT
190    - Set the following values in the Header of the request:
191
192      - basic auth AAI:AAI
193      - X-FromAppId : any
194      - Content-type: application/json
195      - Accept: application/json
196
197 - Register the VNFM as an external system:
198
199  - Access the following URL: http://msb.api.simpledemo.onap.org/iui/aai-esr-gui/extsys/vnfm/vnfmView.html
200
201    - Result: The ONAP platform opens
202
203  - The VNFM has four end points. These end points must be configured in the external system configuration of the VNFM.
204
205   - Authentication endpoint: https://$CBAM_IP:443/auth/
206
207   - Life-cycle management endpoint: https://<cbamIp>:443/vnfm/lcm/v3/
208
209   - Life-cycle change notification endpoint: https://<cbamIp>:443/vnfm/lcn/v3/
210
211   - Catalog endpoint: https://<cbamIp>:443/api/catalog/adapter/
212
213  - On the platform, click Register.
214
215    - Result: The registration form opens.
216
217  - Fill in the fields as follows:
218
219    - Note: Cloud credentials are supplied by the VNF integrator.
220
221 +-----------------+------------------------------------------+
222 | key             | Value                                    |
223 +-----------------+------------------------------------------+
224 | Name            | CbamVnfm                                 |
225 +-----------------+------------------------------------------+
226 | type            | NokiaSVNFM                               |
227 +-----------------+------------------------------------------+
228 | Vendor          | Nokia                                    |
229 +-----------------+------------------------------------------+
230 | version         | v1                                       |
231 +-----------------+------------------------------------------+
232 | URL             | <authUrl>_<lcmUrl>_<lcnUrl>_<catalogUrl> |
233 +-----------------+------------------------------------------+
234 | VIM             | any                                      |
235 +-----------------+------------------------------------------+
236 | certificate URL |                                          |
237 +-----------------+------------------------------------------+
238 | Username        | <onapUsername>_<clientId>                |
239 +-----------------+------------------------------------------+
240 | Password        | <onapPassword>_<clientSecret>            |
241 +-----------------+------------------------------------------+
242
243  - Click Save.
244
245    - Result: The registration has been completed.
246
247  - Determine the UUID of the VNFM:
248
249    - Access the following URL: http://msb.api.simpledemo.onap.org:9518/api/aai-esr-server/v1/vnfms
250    - Look for the previously registered VNFM and note the value of <vnfmId>.
251
252
253 Configure the SVNFM driver (generic)
254 ------------------------------------
255
256 - Using SSH, download the CBAM SVNFM driver by executing the following command:
257   docker pull https://nexus.onap.org/content/sites/raw/onap/vfc/nfvo/svnfm/nokiav2:1.1.0-STAGING-latest
258
259 - Determine the IMAGE ID:
260
261  - Execute the following command: docker images
262  - Find the required image and note the IMAGE ID.
263
264 - Start the driver:
265
266  - Fill in the required values and execute the following:
267
268 .. code-block:: console
269
270    export MULTI_NODE_IP=<multiNodeIp>
271    export VNFM_ID=<vnfmId>
272    export IMAGE_ID=<imageId>
273    docker run --name vfc_nokia -p 8089:8089 -e "MSB_IP=$MULTI_NODE_IP" -e "CONFIGURE=kuku" -e "EXTERNAL_IP=$MULTI_NODE_IP" -e "VNFM_ID=$VNFM_ID" -d --stop-timeout 300 $IMAGE_ID
274
275 - Determine the identifier of the container:
276
277  - Execute the following command: docker ps
278  - Find the required container and note the CONTAINER ID (first column/first row on the list).
279
280 - Verify if the VNFM driver has been successfully started by executing the following commands:
281
282 .. code-block:: console
283
284   execute docker exec -it <containerId> /bin/bash
285   execute tail -f service.log
286
287   - Result: The SVNFM integration is successful if the end of the command output contains "Started NokiaSvnfmApplication".
288
289 - Verify if the SVNFM is registered into MSB:
290
291  - Go to http://msb.api.simpledemo.onap.org/msb
292  - Check if NokiaSVNFM micro service is present in the boxes.
293
294
295 Configure the SVNFM driver (ONAP demo environment)
296 --------------------------------------------------
297 This step is executed instead of the "Configure the SVNFM driver (generic)" in case of an ONAP demo environment.
298
299 - Configure the already running instance:
300
301  - Execute the following command: docker exec -it `docker ps | grep nokiav2 | awk '{print $1}'` /bin/bash
302
303  - Edit /service/application.properties:
304
305    - In this file, change the default values of the following keys to the correct values: vnfmId
306
307  - Restart the VNFM service
308
309    - Execute the following command: ps -ef | grep java |