Create more VES stndDefined Examples
[oam.git] / solution / integration / README.md
1 # Service Management and Orchestration (SMO)
2
3 ##### Table of Contents
4 [Service Management and Orchestration (SMO)](#service-management-and-orchestration-smo)
5 - [Introduction](#introduction)
6 - [Overview](#overview)
7 - [Prerequisites](#prerequisites)
8 - [Usage](#usage)
9   - [Bring Up Solution](#bring-up-solution)
10   - [Log files and karaf console](#log-files-and-karaf-console)
11   - [Customizing Solution](#customizing-solution)
12   - [Verification Solution](#verification-solution)
13     - [Access to SDN-R UX](#access-to-sdn-r-ux)
14   - [Terminate solution](#terminate-solution)
15   - [Cleanup](#cleanup)
16   - [Troubleshooting](#troubleshooting)
17
18 ## Introduction
19
20 With respect to OAM the SMO implements the O1-interface consumers. According to the O-RAN OAM Architecture and the O-RAN OAM Interface Specification, the SMO implements a NetConf Client for configuration and a HTTP/REST/VES server for receiving all kind of events in a VES format.
21
22 The setup contains an OpenDaylight based NetConf client and a VES Collector.
23
24 ## Overview
25
26 This docker-compose file starts a pre-configured, self-contained SDN-R solution
27 for developer test or demo purposes
28
29   * **Identity**
30     ... representing an KeyCloak based identity service for centralized user
31     management. Please note that the implementation does not support IPv6.
32     Therefore, its own network is required called 'DMZ'.
33     In this configuration the external https port is 8463.
34
35   * **SDN-R** single node instance
36
37     ... representing the NetConf consumer on the Service Management and
38     Orchestration framework (SMO) for the O1 interface based on
39     ODL-Silicon/ONAP-Istanbul
40     SDN-R comes with is own web-portal the external port is 8463.
41
42   * **VES collector**
43
44     ... representing the VES (REST) provider at SMO for all kind of events. In this configuration the external https port is 8443.
45
46   * **DMaaP**
47     ... representing SMO DMaaP component, includes message-router
48
49   * **ONAP-Policy**
50     ... representing all the components of ONAP policy framework, in particular
51     the policy-apex-pdp which executes the apex policies deployed in the framework
52     when a certain event occurs.
53
54   * **Non-RT-RIC**
55     ... representing all the components of Non-RT-RIC, includes Non-RT-RIC Control Panel, Non-RT-RIC (Spring Cloud) Service Gateway, A1 Policy Management Services,
56     Enrichment Data Coordinator, Non-RT-RIC App Catalogue, "HelloWorld" O-RU Fronthaul Recovery use-case, Near-RT RIC A1 Simulator etc.
57
58 ## Prerequisites
59
60 ```
61 $ cat /etc/os-release | grep PRETTY_NAME
62 PRETTY_NAME="Ubuntu 20.04.2 LTS"
63
64 $ docker --version
65 Docker version 20.10.7, build 20.10.7-0ubuntu1~20.04.2
66
67 $ docker-compose version
68 docker-compose version 1.29.1, build c34c88b2
69 docker-py version: 5.0.0
70 CPython version: 3.7.10
71 OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019
72
73
74 $ git --version
75 git version 2.25.1
76
77 ```
78 Please modify the /etc/hosts of your system.
79
80 * <your-system>: is the hostname of the system, where the browser is started
81
82 * <deployment-system-ipv4>: is the IP address of the system where the solution will be deployed
83
84 For development purposes <your-system> and <deployment-system> may reference the same system.
85
86 ```
87 $ cat /etc/hosts
88 127.0.0.1                     localhost
89 127.0.1.1                     <your-system>
90 <deployment-system-ipv4>   sdnc-web <your-system>
91 <deployment-system-ipv4>   identity <your-system>
92 ```
93
94 It is beneficial (but not mandatory) adding the following line add the
95 end of your ~/.bashrc file. I will suppress warnings when python script
96 do not verify self signed certificates for HTTPS communication.
97 ```
98 export PYTHONWARNINGS="ignore:Unverified HTTPS request"
99 ```
100
101 Please ensure that you download and copy the required 3GPP OpenAPIs for VES-stndDefined
102 message validation into the folder './solution/integration/smo/oam/ves-collector/externalRepo'.
103
104 Please follow the instructions in ./solution/integration/smo/oam/ves-collector/externalRepo/3gpp/rep/sa5/MnS/blob/Rel16/OpenAPI/README.md.
105
106 The following tree shows the successfully tested folder structure. It combines different versions of the schemas ('Rel16' and 'SA88-Rel16') using 3GPP branch names.
107
108 ```
109 $ tree solution/integration/smo/oam/ves-collector/externalRepo/
110 solution/integration/smo/oam/ves-collector/externalRepo/
111 ├── 3gpp
112 │   └── rep
113 │       └── sa5
114 │           └── MnS
115 │               └── blob
116 │                   ├── Rel16
117 │                   │   └── OpenAPI
118 │                   │       ├── 5gcNrm.yaml
119 │                   │       ├── PerfMeasJobCtrlMnS.yaml
120 │                   │       ├── README.md
121 │                   │       ├── comDefs.yaml
122 │                   │       ├── coslaNrm.yaml
123 │                   │       ├── faultMnS.yaml
124 │                   │       ├── fileDataReportingMnS.yaml
125 │                   │       ├── genericNrm.yaml
126 │                   │       ├── heartbeatNtf.yaml
127 │                   │       ├── nrNrm.yaml
128 │                   │       ├── perfMnS.yaml
129 │                   │       ├── provMnS.yaml
130 │                   │       ├── sliceNrm.yaml
131 │                   │       └── streamingDataMnS.yaml
132 │                   └── SA88-Rel16
133 │                       └── OpenAPI
134 │                           ├── 5gcNrm.yaml
135 │                           ├── PerDataFileReportMnS.yaml
136 │                           ├── PerMeasJobCtlMnS.yaml
137 │                           ├── PerThresMonMnS.yaml
138 │                           ├── PerfDataStreamingMnS.yaml
139 │                           ├── README.md
140 │                           ├── comDefs.yaml
141 │                           ├── coslaNrm.yaml
142 │                           ├── faultMnS.yaml
143 │                           ├── genericNrm.yaml
144 │                           ├── heartbeatNtf.yaml
145 │                           ├── nrNrm.yaml
146 │                           ├── provMnS.yaml
147 │                           ├── sliceNrm.yaml
148 │                           └── streamingDataMnS.yaml
149 ```
150
151 ## Expected Folder Structure
152
153 ```
154 ├── network
155 │   ├── .env
156 │   ├── config.py
157 │   ├── docker-compose.yml
158 │   │
159 │   ├── ntsim-ng-o-du
160 │   └── ntsim-ng-o-ru
161 └── smo
162     ├── common
163     │   ├── .env
164     │   ├── docker-compose.yml
165     │   │
166     │   ├── dmaap
167     │   ├── docker
168     │   ├── identity
169     │   ├── kafka
170     │   ├── o-ran-sc-topology-service
171     │   └── zookeeper
172     ├── non-rt-ric
173     │   ├── docker-compose.yml
174     │   │
175     │   ├── test
176     │   ├── data
177     │   └── config
178     ├── oam
179     │   ├── docker-compose.yml
180     │   │
181     │   ├── sdnc-web
182     │   ├── sdnr
183     │   └── ves-collector
184     └── onap-policy
185         ├── docker-compose.yml
186         │
187         ├── config
188         └── wait_for_port.sh
189 ```
190
191 ## Usage
192
193 ### Bring Up Solution
194
195 #### Check (adjust if required) environment variables
196
197 ```
198 nano smo/common/.env
199 nano smo/non-rt-ric/.env
200 nano smo/oam/.env
201 nano network/.env
202 ```
203
204 The tested configuration uses the following external https ports:
205
206  * 8443 for the ves-collector
207  * 8453 for web access to ODLUX (SDNC_WEB_PORT)
208  * 8463 for the keyclock web administrator user interface.
209
210 #### Startup solution
211
212 Please note that it is necessary to configure first the identity service,
213 before starting further docker images.
214
215 The several docker-compose yml files must be started in the right order as listed below:
216
217 ```
218 docker-compose -f smo/common/docker-compose.yml up -d
219 python smo/common/identity/config.py
220 ```
221
222 The python script configure the users within the identity service (keycloak).
223 A system user (%USER) is also created with administration rights.
224
225 ```
226 docker-compose -f smo/onap-policy/docker-compose.yml up -d
227 docker-compose -f smo/oam/docker-compose.yml up -d
228 docker-compose -f smo/non-rt-ric/docker-compose.yml up -d
229 ```
230
231 In order to create/deploy the apex policy for O-RU closed loop recovery use case,
232 refer to the section named "Create/Deploy apex policy for O-RU & O-DU use case" in
233 this page:
234 https://wiki.o-ran-sc.org/pages/viewpage.action?pageId=35881325
235
236 Please note that the above instructions assume that the ToscaPolicy.json file
237 with default config needs to be deployed. However, when there is a need to update
238 the config (for example, to change the O-RU to O-DU mapping), a new ToscaPolicy.json
239 file needs to be created. Refer to the section named "Workflow for updating the policy config"
240 in this page:
241 https://wiki.o-ran-sc.org/pages/viewpage.action?pageId=35881325
242
243 Please wait about 2min until all the service are up and running.
244 If you see the login page (https://sdnc-web:8453) you are good to go and can start the (simulated) network.
245
246 ### populate data into Non-RT-RIC
247
248 Full instruction on how to run Non-RT-RIC can be found in this page:
249 <https://wiki.o-ran-sc.org/display/RICNR/Release+D>
250
251 When containers in Non-RT-RIC are all up, by default, there is no data running inside. Folder `non-rt-ric/data/` contains several scripts to populate data into Non-RT-RIC for test & demo purpose.
252
253 ```
254 bash prepareDmaapMsg.sh
255 ```
256
257 script `prepareDmaapMsg.sh` sends messages to DMaaP message router, then Non-RT-RIC policy-agent service polls messages from DMaaP, and creates policy instances accordingly.
258
259 ```
260 bash preparePmsData.sh
261 ```
262
263 script `preparePmsData.sh` sends http requests to policy-agent service, and creates policy instances accordingly.
264
265 ```
266 bash prepareEcsData.sh
267 ```
268
269 script `prepareIcsData.sh` sends http requests to ics service, and creates data accordingly.
270
271 Afterwards, open webpage:
272 <http://localhost:8182/>
273 Now we should see some data in the page.
274
275 ```
276 docker-compose -f network/docker-compose.yml up -d
277 ```
278
279 Usually the first ves:event gets lost. Please restart the O-DU docker container(s) to send a second ves:pnfRegistration.
280
281 ```
282 docker-compose -f network/docker-compose.yml restart ntsim-ng-o-du-1122
283 python network/config.py
284 ```
285
286 The python script configures the simulated O-DU and O-RU according to O-RAN hybrid architecture.
287
288 O-DU - NETCONF Call HOME and NETCONF notifications
289 O-RU - ves:pnfRegistration and ves:fault, ves:heartbeat
290
291
292 ![ves:pnfRegistration in ODLUX](docs/nstim-ng-connected-after-ves-pnf-registration-in-odlux.png "ves:pnfRegistration in ODLUX")
293
294 'True' indicated that the settings through SDN-R to the NETCONF server were
295 successful.
296
297 SDN-R reads the fault events from DMaaP and processes them.
298 Finally the fault events are visible in ODLUX.
299
300 ![ves:fault in ODLUX](docs/ves-fault-in-odlux.png "ves:fault in ODLUX")
301
302
303 ### Log files and karaf console
304
305 #### ODL karaf.logs
306
307 ```
308 docker exec -it sdnr tail -f /opt/opendaylight/data/log/karaf.log
309 ```
310
311 #### karaf console access (karaf:karaf)
312
313 ```
314 ssh karaf@localhost -p 8101
315 ```
316
317 #### ves-collector logs
318
319 ```
320 docker logs -f ves-collector
321 ```
322
323 #### onap-policy apex logs
324
325 ```
326 docker logs policy-apex-pdp
327 ```
328
329 #### Non-RT-RIC logs
330
331 ```
332 docker logs policy-agent
333 docker logs oru-app
334 docker logs ecs
335 ```
336
337 ### Customizing Solution
338
339 '.env' file contains customizing parameters
340
341 ### Verification Solution
342
343 #### Access to SDN-R ODLUX
344
345 ##### Login into SDN-R
346
347     https://sdnc-web:8453
348
349     User: admin // see .env file
350
351     Password: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
352
353 In case of trouble, please update the commands with your customized '.env' file.
354
355 #### Access to Topology Service
356
357 ```
358 curl -u admin:admin http://localhost:18181/rests/data/network-topology:network-topology/topology=topology-netconf/node=o-ran-sc-topology-service/yang-ext:mount/tapi-common:context/tapi-topology:topology-context
359 ```
360
361 #### Access to Wireshark
362
363 ```
364   http://localhost:3000
365 ```
366
367 Select the interfaces you would like to capture.
368 As first guess, please select the bridge interfaces.
369 ### Terminate solution
370
371 To stop all container please respect the following order
372
373 ```
374 docker-compose -f network/docker-compose.yml down
375 docker-compose -f smo/oam/docker-compose.yml down
376 docker-compose -f smo/onap-policy/docker-compose.yml down
377 docker-compose -f smo/non-rt-ric/docker-compose.yml down
378 docker-compose -f smo/common/docker-compose.yml down
379 ```
380
381 ### Cleanup
382
383 !!! be careful if other stopped containers are on the same system
384 ```
385 docker system prune -a -f
386 ```
387 ### Troubleshooting
388
389 In most cases the .env setting do not fit to the environment and need to be
390 adjusted.
391
392 Please make sure that the network settings to not overlap with other networks.
393
394 The commands ...
395 ```
396 docker ps -a
397 docker-compose ps
398
399 ## Prerequisites
400 # python3, tmux, libtmux
401 tmux new-session -n workspace -s integration
402
403 # within tmux session
404 python tmux-logging.py
405 ```
406 ... are your friends.
407
408 ![tmux logging](docs/tmux-logging.png "tmux logging")