CM handling guide

The goal

To be able to handle CM event in SDN-R you have to create locally VES Collector image containing schema files that will be needed for CM validation. Then you will be able to send the CM event and persist it to the Elasticsearch or MariaDB database. The choice of database will depend on your configuration.

Create custom VES-collector

Get current VES-collector project

Clone it from the repository

To make it possible for VES-collector to handle CM messages there are required some changes in the project.

Copy files from 3GPP OpenAPI and paste them to the proper directory in the project

List of required files
ves/etc/externalRepo/3gpp/rep/sa5/MnS/blob/Rel16/OpenAPI$ ls comDefs.yaml faultMnS.yaml fileDataReportingMnS.yaml heartbeatNtf.yaml perfMnS.yaml provMnS.yaml

Edit provMns.yaml file

Remove few references from components → schemas → Resource

provMns.yaml diff
user@computer:~/ves_files$ diff provMns_old.yaml provMns_new.yaml 415,419d414 < - anyOf: < - $ref: 'genericNrm.yaml#/components/schemas/resources-genericNrm' < - $ref: 'nrNrm.yaml#/components/schemas/resources-nrNrm' < - $ref: '5gcNrm.yaml#/components/schemas/resources-5gcNrm' < - $ref: 'sliceNrm.yaml#/components/schemas/resources-sliceNrm'

 Update schema-map.json file 

ves/etc/externalRepo/schema-map.json 
[ { "publicURL": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS.yaml", "localURL": "3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS.yaml" }, { "publicURL": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/heartbeatNtf.yaml", "localURL": "3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/heartbeatNtf.yaml" }, { "publicURL": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/PerDataFileReportMnS.yaml", "localURL": "3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/PerDataFileReportMnS.yaml" }, { "publicURL": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/provMnS.yaml", "localURL": "3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/provMnS.yaml" }, { "publicURL": "https://forge.3gpp.org/rep/sa5/MnS/blob/Rel16/OpenAPI/faultMnS.yaml", "localURL": "3gpp/rep/sa5/MnS/blob/Rel16/OpenAPI/faultMnS.yaml" }, { "publicURL": "https://forge.3gpp.org/rep/sa5/MnS/blob/Rel16/OpenAPI/heartbeatNtf.yaml", "localURL": "3gpp/rep/sa5/MnS/blob/Rel16/OpenAPI/heartbeatNtf.yaml" }, { "publicURL": "https://forge.3gpp.org/rep/sa5/MnS/blob/Rel16/OpenAPI/fileDataReportingMnS.yaml", "localURL": "3gpp/rep/sa5/MnS/blob/Rel16/OpenAPI/fileDataReportingMnS.yaml" }, { "publicURL": "https://forge.3gpp.org/rep/sa5/MnS/blob/Rel16/OpenAPI/perfMnS.yaml", "localURL": "3gpp/rep/sa5/MnS/blob/Rel16/OpenAPI/perfMnS.yaml" }, { "publicURL": "https://forge.3gpp.org/rep/sa5/MnS/blob/Rel16/OpenAPI/provMnS.yaml", "localURL": "3gpp/rep/sa5/MnS/blob/Rel16/OpenAPI/provMnS.yaml" } ]

Build project and create docker image

Use below command:

Build command

If tests are failing use different branch or skip them:

Build without tests

In the docker images there should be a new image:

nexus3.onap.org:10003/onap/org.onap.dcaegen2.collectors.ves.vescollector:latest

Update oam project to use new VES-collector

To add new VES-collector and connect it with the SDN-R use OAM project

Swap VES-collector image

In directory oam/solution/dev of OAM project edit VES Collector configuration in .env file change image to newly created one.

.env file change

Edit collector.properties file

Find in OAM project file oam/solution/dev/ves-collector/collector.properties and make change like below

collector.properties diff

Send CM event

To verify if everything is correct send sample CM message:

Sample CM

Using below command, where "cm.json" points to proper CM message.

Send CM command



To check if it works check SDN-R logs.

Print SDN-R logs



You should see there:

CM log

If you don't see such message in the logs try to send CM (or fault or pnf) several times more.

Database

A couple of months ago SDN-R migrate from Elasticsearch to MariaDB. Currently it supports both stores, depending on provided configuration. Our implementation support both scenarios. 

Elasticsearch

The default database for SDN-R is Elasticsearch. To check if the CM event has been persisted correctly in the database, do the following steps:

  1. In project  OAM project go to oam/solution/dev and in docker-compose.yaml in persistence service add ports mapping:

      Also in the sdnr service change:



    2. Run docker-compose.

    3. Run the following commands:

  • get all Elasticsearch indexes

  • displaying the cmlog index

MariaDB

To change your database configuration to MariaDB follow the steps in Migration to MariaDB paragraph.

Migration to MariaDB

  1. In project  OAM project go to oam/solution/dev and in docker-compose.yaml add the following configuration:

  • in services add

  • add new code changes to sdnr service

      2. In the same folder in the .env file add the following configuration:

You have to specify MariaDB version from ranges 10.2.7 to 10.6.8. The range of currently supported MariaDB versions can be found in the project ccsdk/features in path: sdnr/wt/data-provider/setup/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/data/Release.java.

      3. Go to oam/solution/dev/sdnr directory and create new file: dataprovider.properties that contains:

      4. In the same location change file permissions for dataprovider.properties and mountpoint-registrar.properties to chmod 777.

     5. Go back to oam/solution/dev and run docker-compose with command:

     6. Init MariaDB databases in sdnr container. Log in to sdnr bash with command:

     7. Set SDNRDBURL:

     8. Run Data Migration Tool with command:

 Note that you can have different version of sdnr-wt-data-provider-setup project. For more information about Data Migration Tool.

     9. Scale sdnr container with commands:

      10. Log in to MariaDB container with command:

     11. Now you can use sdnrdb database and perform SQL operation. To check if the CM event has been persisted correctly in the database, use the following commands:

Switch to Elasticsearch

If you want to get back to Elasticsearch configuration do the following steps:

     1. In dataprovider.properties change dbType to:

     2. In docker-compose.yaml uncomment SDNRDBURL line:

     3. Run docker-compose.