Overview
The PM Subscription Handler (PMSH) is a micro service written in Python, which allows for the definition and unlocking of PM subscriptions on one or more network function (NF) instances.
Architecture Diagram
Artifacts
Deployment Prerequisite/dependencies
The following components must be up and running to successfully deploy PMSH
- DCAE Platform
- SDC
- CLAMP
- POLICY
- A&AI (Should have at least 1 PNF registered)
Deployment Steps
In the Frankfurt release, there is a workaround required in order to deploy the PM Subscription Handler. The monitoring policy for the microservice needs to be manually inserted into CONSUL. This requires two steps:
1. The CONSUL service is no longer exposed in the Frankfurt release, this needs to be exposed in order to be accessible outside the k8s cluster.
kubectl expose svc -n onap consul-server --name=x-consul-server --type=NodePort
2. Insert the monitoring policy into CONSUL
curl -X PUT \ http://<k8s-node-ip>:<consul-port>/v1/kv/dcae-pmsh:policy \ -H 'Content-Type: application/json' \ -d '{ "subscription": { "subscriptionName": "test-subscription", "administrativeState": "LOCKED", "fileBasedGP": 15, "fileLocation": "/pm/pm.xml", "nfFilter": { "swVersions": [ "1.0.0" ], "nfNames": [ "^pnf.*" ] }, "measurementGroups": [{ "measurementGroup": { "measurementTypes": [{ "measurementType": "countera" }, { "measurementType": "counterb" } ], "managedObjectDNsBasic": [{ "DN": "dna" }, { "DN": "dnb" } ] } }, { "measurementGroup": { "measurementTypes": [{ "measurementType": "counterc" }, { "measurementType": "counterd" } ], "managedObjectDNsBasic": [{ "DN": "dnc" }, { "DN": "dnd" } ] } } ] } }'
Deployment of PMSH can then be done using Dashboard UI/Cloudify UI or via CLI. Below steps are based on CLI.
- Transfer blueprint component file in DCAE bootstrap POD under /blueprints directory
- Transfer blueprint component inputs file in DCAE bootstrap POD under / directory
- Log-in to the DCAE bootstrap POD's main container
Validate blueprint
Validate Blueprintcfy blueprints validate /blueprints/k8s-pmsh.yaml
Verify Plugin versions in target Cloudify instance match to blueprint imports
Verify Plugin versioncfy plugins list
If the version of plugin used are different, update the blueprint import to match.
Deploy Service
Upload and deploy blueprintcfy install -b pmsh -d pmsh -i /k8s-pmsh-inputs.yaml /blueprints/k8s-pmsh.yaml
To un-deploy
Uninstall running component and delete deployment
Uninstall componentcfy uninstall pmsh
Delete blueprint
Delete blueprintcfy blueprints delete pmsh
Initial Validation
After deployment, verify if PMSH pod is running correctly
root@k8s-rancher:~# kubectl get pods -n onap | egrep "pmsh" dep-dcae-pmsh-6b58cbc7f5-lm92g 2/2 Running 0 149m
We can curl message router to verify that PMSH has published an event to it's configured topic. By default this is unauthenticated.DCAE_CL_OUTPUT
curl -k https://message-router:3905/events/unauthenticated.DCAE_CL_OUTPUT/1/1
If PMSH is working correctly we should see an event published to message router
["{\"nfName\":\"pnf500\",\"policyName\":\"pmsh-operational-policy\",\"changeType\":\"CREATE\",\"subscription\":{\"administrativeState\":\"LOCKED\",\"subscriptionName\":\"test-subscription\",\"measurementGroups\":[{\"measurementGroup\":{\"measurementTypes\":[{\"measurementType\":\"countera\"},{\"measurementType\":\"counterb\"}],\"managedObjectDNsBasic\":[{\"DN\":\"dna\"},{\"DN\":\"dnb\"}]}},{\"measurementGroup\":{\"measurementTypes\":[{\"measurementType\":\"counterc\"},{\"measurementType\":\"counterd\"}],\"managedObjectDNsBasic\":[{\"DN\":\"dnc\"},{\"DN\":\"dnd\"}]}}],\"fileBasedGP\":15,\"fileLocation\":\"/pm/pm.xml\"},\"closedLoopControlName\":\"pmsh-control-loop\"}"]
And then check the logs to see if it can connect to DMaaP, polling for events.
Functional tests
Given that the steps above were used to configure the PMSH monitoring policy with administrativeState = LOCKED. The subscription has not yet been "activated" on the network function.
Activate an inactive subscription
If the subscription is in a LOCKED state (administrativeState=LOCKED) we can reconfigure PMSH to activate the subscription:
curl -X PUT \ http://<k8s-node-ip>:<consul-port>/v1/kv/dcae-pmsh:policy \ -H 'Content-Type: application/json' \ -d '{ "subscription": { "subscriptionName": "test-subscription", "administrativeState": "UNLOCKED", "fileBasedGP": 15, "fileLocation": "/pm/pm.xml", "nfFilter": { "swVersions": [ "1.0.0" ], "nfNames": [ "^pnf.*" ] }, "measurementGroups": [{ "measurementGroup": { "measurementTypes": [{ "measurementType": "countera" }, { "measurementType": "counterb" } ], "managedObjectDNsBasic": [{ "DN": "dna" }, { "DN": "dnb" } ] } }, { "measurementGroup": { "measurementTypes": [{ "measurementType": "counterc" }, { "measurementType": "counterd" } ], "managedObjectDNsBasic": [{ "DN": "dnc" }, { "DN": "dnd" } ] } } ] } }'
We should then be able to see a CREATE event sent to message router:
curl -k https://message-router:3905/events/unauthenticated.DCAE_CL_OUTPUT/1/1
If PMSH is working correctly we should see a CREATE event sent to message router:
["{\"nfName\":\"pnf500\",\"policyName\":\"pmsh-operational-policy\",\"changeType\":\"CREATE\",\"subscription\":{\"administrativeState\":\"LOCKED\",\"subscriptionName\":\"test-subscription\",\"measurementGroups\":[{\"measurementGroup\":{\"measurementTypes\":[{\"measurementType\":\"countera\"},{\"measurementType\":\"counterb\"}],\"managedObjectDNsBasic\":[{\"DN\":\"dna\"},{\"DN\":\"dnb\"}]}},{\"measurementGroup\":{\"measurementTypes\":[{\"measurementType\":\"counterc\"},{\"measurementType\":\"counterd\"}],\"managedObjectDNsBasic\":[{\"DN\":\"dnc\"},{\"DN\":\"dnd\"}]}}],\"fileBasedGP\":15,\"fileLocation\":\"/pm/pm.xml\"},\"closedLoopControlName\":\"pmsh-control-loop\"}"]
Deactivate an active subscription
If the subscription is in an UNLOCKED state (administrativeState=UNLOCKED) we can reconfigure PMSH to deactivate the subscription:
curl -X PUT \ http://<k8s-node-ip>:<consul-port>/v1/kv/dcae-pmsh:policy \ -H 'Content-Type: application/json' \ -d '{ "subscription": { "subscriptionName": "test-subscription", "administrativeState": "LOCKED", "fileBasedGP": 15, "fileLocation": "/pm/pm.xml", "nfFilter": { "swVersions": [ "1.0.0" ], "nfNames": [ "^pnf.*" ] }, "measurementGroups": [{ "measurementGroup": { "measurementTypes": [{ "measurementType": "countera" }, { "measurementType": "counterb" } ], "managedObjectDNsBasic": [{ "DN": "dna" }, { "DN": "dnb" } ] } }, { "measurementGroup": { "measurementTypes": [{ "measurementType": "counterc" }, { "measurementType": "counterd" } ], "managedObjectDNsBasic": [{ "DN": "dnc" }, { "DN": "dnd" } ] } } ] } }'
We should then be able to see a DELETE event sent to message router:
curl -k https://message-router:3905/events/unauthenticated.DCAE_CL_OUTPUT/1/1
If PMSH is working correctly we should see a DELETE event sent to message router:
["{\"nfName\":\"pnf500\",\"policyName\":\"pmsh-operational-policy\",\"changeType\":\"DELETE\",\"subscription\":{\"administrativeState\":\"LOCKED\",\"subscriptionName\":\"test-subscription\",\"measurementGroups\":[{\"measurementGroup\":{\"measurementTypes\":[{\"measurementType\":\"countera\"},{\"measurementType\":\"counterb\"}],\"managedObjectDNsBasic\":[{\"DN\":\"dna\"},{\"DN\":\"dnb\"}]}},{\"measurementGroup\":{\"measurementTypes\":[{\"measurementType\":\"counterc\"},{\"measurementType\":\"counterd\"}],\"managedObjectDNsBasic\":[{\"DN\":\"dnc\"},{\"DN\":\"dnd\"}]}}],\"fileBasedGP\":15,\"fileLocation\":\"/pm/pm.xml\"},\"closedLoopControlName\":\"pmsh-control-loop\"}"]
Dynamic Configuration Update
As the PMSH service periodically polls Consul KV using configbindingService API's - the run time configuration of PMSH service can be updated dynamically without having to redeploy/restart the service. The updates to the configuration can be triggered either from Policy (or CLAMP) or made directly in Consul.
Locate the service name by executing into PMSH Service pod and getting env HOSTNAME value
root@k8s-rancher:~# kubectl exec -it -n onap dep-s78f36f2daf0843518f2e25184769eb8b-dcae-pmsh-servithzx2 /bin/bash Defaulting container name to s78f36f2daf0843518f2e25184769eb8b-dcae-pmsh-service. Use 'kubectl describe pod/dep-s78f36f2daf0843518f2e25184769eb8b-dcae-pmsh-servithzx2 -n onap' to see all of the containers in this pod. misshtbt@s78f36f2daf0843518f2e25184769eb8b-dcae-pmsh-service:~/bin$ env | grep HOSTNAME HOSTNAME=s78f36f2daf0843518f2e25184769eb8b-dcae-pmsh-service
Change the configuration for Service in KV-store through UI
http://<k8s-node-ip>:<consul-ip>/ui/#/dc1/kv/
Consul Snapshot <>