CCVPN Closed Loop Fow
![](/download/attachments/38114271/image2018-6-28_11-50-39.png?version=1&modificationDate=1532911498000&api=v2)
- SDC/CLAMP Portal design and activate policy.
- SDC/CLAMP config and activate the policy.
- SDC/CLAMP distribute the DCAE config.
- SDC/CLMAP distribute the alarm correlation rules to Holmes.
- 3rd party SOTN controller report link down alarm to DCAE
- DCAE will do data cleaning and filtering for the alarms
- DCAEk keep track the datas.
- Holmes do analysis for the alarms.
- Holmes notify the reroute event.
- Policy matching the reroute rules.
- Policy call SO to delete the old services and create the new services. For the creation flow, a variable route will be recalculated.
CLAMP
Currently collector’s are not deployed on-demand, they are pre-deployed in DCAE and used by all the mS and all control loops. So the
collector’s, currently, are not deployed via CLAMP and there is no cloudify blueprint available to do so anyway. The collector box you see
in CLAMP GUI is just a virtual box to show the control loop flow, in reality there is no configuration made by CLAMP for the collector (at
least at this stage of ONAP, it might change in the future).
DCAE
DCAE Flow
![](/download/thumbnails/38114271/image2018-7-26_17-39-16.png?version=1&modificationDate=1532911618000&api=v2)
- RestConf Collector (RC)subscribes for remote failure alarm to SOTN Controller (SC)
- RC requests to set up a long term tunnel with the 3rd party SC
- SC responses with OK upon successful tunnel setting
- SC pushes service route status data to the collector
- RC receives alarm data, converts it into JSON format and publishes on DMAAP with topic of ROUTE_ALARM_OUTPUT
- UVA consumes the alarm message
- UVA requests the RestConf2VES mapping
- UVA converts json alarm into VES event
- UVA publishes the VES event on DMAAP for further correlation
APIs to SOTN Controller (Restconf)
Subscribe Notification
Functionality
Collector (Client) and SOTN Controller establishes subscription relationship.
Method
POST
Request-URL
/restconf/operations/ietf-subscribed-notifications:establish-subscription
Request-Body
{
"ietf-subscribed-notifications:input": {
"encoding": "encode-json"
}
}
Response-Body
{
"ietf-subscribed-notifications:output": {
"identifier": "1"
}
}
Establish Long Term Connectivity
Functionality
Collector establishes long term connectivity with SOTN Controller and the controller will continuously Push the subscribed notification over.
Method
GET
Request-URL
/restconf/streams/yang-push-json
Request-Body
(TBD)
Response-Body
{
"ietf-notification:notification": {
"eventTime": {eventTime},
"ietf-yang-push: push-change-update ": {
"subscription-id ": {subscription-id },
" datastore-changes ": {
"ietf-yang-patch:yang-patch": {
"patch-id": {patch-id},
"edit": [
{
"edit-id" : {edit-id },
"operation" : {operation },
"target" : {target },
"value": {value}
}
]
}
}
}
}
}
Restconf Notification
This is the Service Down Alarm message example from SOTN Controller.
"ietf-network-topology:link":{
{
"link-id": "teNodeId/0.5.0.12/telinkId/1",
"external-domain" :
{
"remote-nodeid": "x.x.x.x",
"remote-tp": y
},
"source": {
"source-node" : "0.5.0.12",
"source-tp" : "1"
}
"ietf-te-topology:te" : {
"oper-status": "down",
"te-link-attributes": {
"max-link-bandwidth" : {
"te-bandwidth" : "1000000"
},
"max-resv-link-bandwith" : {
"te-bandwidth" : "1000000"
},
... ...
}
Route Alarm Message
This is the message definition at output of Restconf collector to DMAAP with topic of RESTCONF_ALARM_TOPIC.
{
“service_status”: {
“external_domain”: {
“remote-nodeid” : “ example-remote-nodeid”,
“remote-tpid” : “ example-remote-tpid”
},
“source”? {“source-tpid”: “example-source-tpid”},
“oper-status”? “down”,
“mapping-id” : “restconf2ves-001,
“service-instance-id”: service-instance-01
}
}
VES MAPPER
The Restconf2VES.xml could be uploaded to DCAE at the closed loop deployment from DCAE Designer. For now, it will be manually uploaded to the mapper at the closed loop instantiation.
Mapping XML
UVA subscribes RESTCONF_ALARM_TOPIC on DMAAP.
Route Down Alarm
{
"event": {
"commonEventHeader": {
"sourceId": "example-sotn-controller-id-val-51834", // The value should be the same as what you set to the VM you just mocked.
"startEpochMicrosec": 1413378172000000,
"eventId": "ab305d54-85b4-a31b-7db2-fb6b977766",
"sequence": 0,
"domain": "fault",
"lastEpochMicrosec": 1413378172000033,
"eventName": "Fault_Route_Failure",
"sourceName": "example-SOTN-Controller-name-val-5470", // The value should be the same as what you set to the VM you just mocked.
"priority": "High",
"version": 3.0,
"reportingEntityName": "Domain_Contorller"
},
"faultFields": {
"eventSeverity": "CRITICAL",
"alarmCondition": "Route_Down",
"faultFieldsVersion": 2.0,
"specificProblem": "Fault_SOTN_Service_Failure",
"alarmAdditionalInformation": [{
"name": "service-instancec-id",
"value": "service-instance-01"
},
{
"name": "remote-nodeId", // ... might not be needed
"value": "example-node-id"
}
]
"eventSourceType": "other",
"vfStatus": "Active"
}
}
}
These alarms are published to the unauthenticated.SEC_FAULT_OUTPUT topic of DMaaP.
DCAE Blueprint
HOLMES (WIP)
CCVPN Close Loop requires Holmes to correlate route down alarms from SOTN Controllers from different sites. (Refer to this page on Holmes installation,)
In Phase 1, for the minimum, two of the above defined Route_Down_Alarm will be correlated within time window of 15 - 30, for instance, milliseconds. (Refer to this page as examples.)
Rule Creation
{
"ruleName": "CCVPN",
"loopControlName": "ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c55b",
"description": "This rule is designed for the correlation analysis for the CCVPN use case.",
"content": "package org.onap.holmes.droolsRule;\n\nimport org.onap.holmes.common.dmaap.DmaapService;\nimport org.onap.holmes.common.api.stat.VesAlarm;\nimport org.onap.holmes.common.aai.CorrelationUtil;\nimport org.onap.holmes.common.dmaap.entity.PolicyMsg;\nimport org.onap.holmes.common.dropwizard.ioc.utils.ServiceLocatorHolder;\nimport org.onap.holmes.common.utils.DroolsLog;\n \n\nrule \"Relation_analysis_Rule\"\nsalience 200\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 0,\n $sourceId: sourceId, sourceId != null && !sourceId.equals(\"\"),\n\t\t\t$sourceName: sourceName, sourceName != null && !sourceName.equals(\"\"),\n\t\t\t$startEpochMicrosec: startEpochMicrosec,\n specificProblem in (\"Fault_SOTN_Service_Failure\"),\n $eventId: eventId)\n $child : VesAlarm( eventId != $eventId, parentId == null,\n specificProblem in (\"Fault_SOTN_Service_Failure\"),\n startEpochMicrosec < $startEpochMicrosec + 60000 && startEpochMicrosec > $startEpochMicrosec - 60000 )\n then\n\t\t$child.setParentId($root.getEventId());\n\t\tupdate($child);\n\t\t\nend\n\nrule \"root_has_child_handle_Rule\"\nsalience 150\nno-loop true\n\twhen\n\t\t$root : VesAlarm(alarmIsCleared == 0, rootFlag == 0, $eventId: eventId)\n\t\t$child : VesAlarm(eventId != $eventId, parentId == $eventId)\n\tthen\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, $child, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\t$root.setRootFlag(1);\n\t\tupdate($root);\nend\n\nrule \"root_no_child_handle_Rule\"\nsalience 100\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 0, rootFlag == 0,\n sourceId != null && !sourceId.equals(\"\"),\n\t\t\tsourceName != null && !sourceName.equals(\"\"),\n specificProblem in (\"Fault_SOTN_Service_Failure\"))\n then\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\t$root.setRootFlag(1);\n\t\tupdate($root);\nend\n\nrule \"root_cleared_handle_Rule\"\nsalience 100\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 1, rootFlag == 1)\n then\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\tretract($root);\nend\n\nrule \"child_handle_Rule\"\nsalience 100\nno-loop true\n when\n $child : VesAlarm(alarmIsCleared == 1, rootFlag == 0)\n then\n\t\tretract($child);\nend",
"enabled": 1
}
To illustrate, the content field in the above rule is presented as readable format in the following. We need to convert it to valid json string when uploading to Holmes.
package org.onap.holmes.droolsRule;
import org.onap.holmes.common.dmaap.DmaapService;
import org.onap.holmes.common.api.stat.VesAlarm;
import org.onap.holmes.common.aai.CorrelationUtil;
import org.onap.holmes.common.dmaap.entity.PolicyMsg;
import org.onap.holmes.common.dropwizard.ioc.utils.ServiceLocatorHolder;
import org.onap.holmes.common.utils.DroolsLog;
rule "Relation_analysis_Rule"
salience 200
no-loop true
when
$root : VesAlarm(alarmIsCleared == 0,
$sourceId: sourceId, sourceId != null && !sourceId.equals(""),
$sourceName: sourceName, sourceName != null && !sourceName.equals(""),
$startEpochMicrosec: startEpochMicrosec,
specificProblem in ("Fault_SOTN_Service_Failure"),
$eventId: eventId)
$child : VesAlarm( eventId != $eventId, parentId == null,
specificProblem in ("Fault_SOTN_Service_Failure"),
startEpochMicrosec < $startEpochMicrosec + 200 && startEpochMicrosec > $startEpochMicrosec - 200 )
then
$child.setParentId($root.getEventId());
update($child);
end
rule "root_has_child_handle_Rule"
salience 150
no-loop true
when
$root : VesAlarm(alarmIsCleared == 0, rootFlag == 0, $eventId: eventId)
$child : VesAlarm(eventId != $eventId, parentId == $eventId)
then
DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
PolicyMsg policyMsg = dmaapService.getPolicyMsg($root, $child, "org.onap.holmes.droolsRule");
dmaapService.publishPolicyMsg(policyMsg, "unauthenticated.DCAE_CL_OUTPUT");
$root.setRootFlag(1);
update($root);
end
rule "root_no_child_handle_Rule"
salience 100
no-loop true
when
$root : VesAlarm(alarmIsCleared == 0, rootFlag == 0,
sourceId != null && !sourceId.equals(""),
sourceName != null && !sourceName.equals(""),
specificProblem in ("Fault_SOTN_Service_Failure"))
then
DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
PolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, "org.onap.holmes.droolsRule");
dmaapService.publishPolicyMsg(policyMsg, "unauthenticated.DCAE_CL_OUTPUT");
$root.setRootFlag(1);
update($root);
nend
rule "root_cleared_handle_Rule"
salience 100
no-loop true
when
$root : VesAlarm(alarmIsCleared == 1, rootFlag == 1)
then
DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
PolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, "org.onap.holmes.droolsRule");
dmaapService.publishPolicyMsg(policyMsg, "unauthenticated.DCAE_CL_OUTPUT");
retract($root);
end
rule "child_handle_Rule"
salience 100
no-loop true
when
$child : VesAlarm(alarmIsCleared == 1, rootFlag == 0)
then
retract($child);
end
Rule Execution
After the correlation is done successfully, there should be a corresponding control loop event defined in the following section published on the unauthenticated.DCAE_CL_OUTPUT topic of DMaaP.
POLICY
Policy Creation
controlLoop:
version: 2.0.0
controlLoopName: ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c55b
trigger_policy: unique-policy-id-16-deleteSOTNService, unique-policy-id-17-createSOTNService
timeout: 3600
abatement: false
policies:
- id: unique-policy-id-16-deleteSOTNService
name: Delete SOTN Service
description:
actor: SO
recipe: DeleteE2EService
target:
type: VM
retry: 3
timeout: 1200
success: final_success
failure: final_failure
failure_timeout: final_failure_timeout
failure_retries: final_failure_retries
failure_exception: final_failure_exception
failure_guard: final_failure_guard
- id: unique-policy-id-17-createSOTNService
name: Create SOTN Service
description:
actor: SO
recipe: CreateE2EService
target:
type: VM
retry: 3
timeout: 1200
success: final_success
failure: final_failure
failure_timeout: final_failure_timeout
failure_retries: final_failure_retries
failure_exception: final_failure_exception
failure_guard: final_failure_guard
{
"closedLoopEventClient": "DCAE.HolmesInstance",
"policyVersion": "1.0.0.5",
"policyName": "CCVPN",
"policyScope": "service=SOTNService,type=SampleType,closedLoopControlName=CL-CCVPN-d925ed73-8231-4d02-9545-db4e101f88f8",
"target_type": "VM",
"AAI": {
"service-instance.service-instance-id" : "TBD
},
"closedLoopAlarmStart": 1484677482204798,
"closedLoopEventStatus": "ONSET",
"closedLoopControlName": "ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c55b",
"version": "1.0.2",
"target": "vserver.vserver-name",
"requestID": "97964e10-686e-4790-8c45-bdfa61df770f",
"from": "DCAE"
}
Policy Engine subscribes the unauthenticated.DCAE_CL_OUTPUT on DMAAP.
APIs