Installation of Amsterdam Controller and vCPE Policy¶
Contents
This article explains how to install the Amsterdam policy controller and the Amsterdam policies on a raw ONAP Policy Framework installation running in Docker.
To build a raw Policy Framework installation, please follow either of the HowTo articles below prior to using this HowTo:
You should have the ONAP Policy Framework running in Docker and started the Policy Framework with docker-compose.
Test that the ONAP Policy Framework is up and is empty¶
Step 1: Run the command below.
curl --silent --user @1b3rt:31nst31n -X GET http://localhost:9696/policy/pdp/engine/controllers/amsterdam | python -m json.tool
You should get a response similar to the following:
{ "error": "amsterdam not found" }
Install the Amsterdam policy controller¶
Step 1: Log onto the Drools PDP.
docker exec -it drools bash
You now have a shell open in the Drools PDP container running in docker
Step 2: Create a temporary directory for controller installation
mkdir /tmp/apps-controlloop cd /tmp/apps-controlloop
Step 3: Download the latest controller from Nexus (1.2.0 at the time of writing)
wget https://nexus.onap.org/content/repositories/releases/org/onap/policy/drools-applications/controlloop/packages/apps-controlloop/1.2.0/apps-controlloop-1.2.0.zip
Step 4: Unzip the controller
unzip apps-controlloop-1.2.0.zip
Step 5: Stop the policy engine
policy stop
Step 6: Install the controller by running the controller installation script
./apps-controlloop-installer
Step 7: Install the controlloop-utils Drools PDP feature to allow standalone execution of control loop policies
features install controlloop-utils features enable controlloop-utils
Step 8: Start the policy engine
policy start
- Step 9: Check if the Amsterdam controller is loaded
curl --silent --user @1b3rt:31nst31n -X GET http://localhost:9696/policy/pdp/engine/controllers/amsterdam | python -m json.tool
You should get a response similar to the following:
1{ 2 "alive": true, 3 "drools": { 4 "alive": false, 5 "artifactId": "NO-ARTIFACT-ID", 6 "brained": false, 7 "canonicalSessionNames": [], 8 "container": null, 9 "groupId": "NO-GROUP-ID", 10 "locked": false, 11 "recentSinkEvents": [], 12 "recentSourceEvents": [], 13 "sessionNames": [], 14 "version": "NO-VERSION" 15 }, 16 "locked": false, 17 "name": "amsterdam", 18 "topicSinks": [ 19 { 20 "alive": true, 21 "allowSelfSignedCerts": false, 22 "apiKey": "", 23 "apiSecret": "", 24 "locked": false, 25 "partitionKey": "ea44d32e-e2e6-4a77-862b-aa33437179ed", 26 "recentEvents": [], 27 "servers": [ 28 "vm1.mr.simpledemo.openecomp.org" 29 ], 30 "topic": "APPC-CL", 31 "topicCommInfrastructure": "UEB", 32 "useHttps": false 33 }, 34 { 35 "alive": true, 36 "allowSelfSignedCerts": false, 37 "apiKey": "", 38 "apiSecret": "", 39 "locked": false, 40 "partitionKey": "47769d22-03c8-4993-9f67-fe326a491b23", 41 "recentEvents": [], 42 "servers": [ 43 "vm1.mr.simpledemo.openecomp.org" 44 ], 45 "topic": "APPC-LCM-READ", 46 "topicCommInfrastructure": "UEB", 47 "useHttps": false 48 }, 49 { 50 "alive": true, 51 "allowSelfSignedCerts": false, 52 "apiKey": "", 53 "apiSecret": "", 54 "locked": false, 55 "partitionKey": "c33ca5ca-6ebd-47d7-a495-5a54f8a2a15a", 56 "recentEvents": [], 57 "servers": [ 58 "vm1.mr.simpledemo.openecomp.org" 59 ], 60 "topic": "POLICY-CL-MGT", 61 "topicCommInfrastructure": "UEB", 62 "useHttps": false 63 } 64 ], 65 "topicSources": [ 66 { 67 "alive": true, 68 "allowSelfSignedCerts": false, 69 "apiKey": "", 70 "apiSecret": "", 71 "consumerGroup": "6dcfdfb8-7c54-4dbd-9337-e4f1883083fb", 72 "consumerInstance": "drools", 73 "fetchLimit": 100, 74 "fetchTimeout": 15000, 75 "locked": false, 76 "recentEvents": [], 77 "servers": [ 78 "vm1.mr.simpledemo.openecomp.org" 79 ], 80 "topic": "unauthenticated.DCAE_CL_OUTPUT", 81 "topicCommInfrastructure": "UEB", 82 "useHttps": false 83 }, 84 { 85 "alive": true, 86 "allowSelfSignedCerts": false, 87 "apiKey": "", 88 "apiSecret": "", 89 "consumerGroup": "4f558331-3d32-494b-b7dc-4d5a509dda0d", 90 "consumerInstance": "drools", 91 "fetchLimit": 100, 92 "fetchTimeout": 15000, 93 "locked": false, 94 "recentEvents": [], 95 "servers": [ 96 "vm1.mr.simpledemo.openecomp.org" 97 ], 98 "topic": "APPC-CL", 99 "topicCommInfrastructure": "UEB", 100 "useHttps": false 101 }, 102 { 103 "alive": true, 104 "allowSelfSignedCerts": false, 105 "apiKey": "", 106 "apiSecret": "", 107 "consumerGroup": "1e3edc1f-afa6-4ae5-907f-a7118ad7a0d2", 108 "consumerInstance": "drools", 109 "fetchLimit": 100, 110 "fetchTimeout": 15000, 111 "locked": false, 112 "recentEvents": [], 113 "servers": [ 114 "vm1.mr.simpledemo.openecomp.org" 115 ], 116 "topic": "APPC-LCM-WRITE", 117 "topicCommInfrastructure": "UEB", 118 "useHttps": false 119 } 120 ] 121}
Install the Amsterdam vCPE Policy¶
We now install the Amsterdam policies for the vCPE, vFirewall, vDNS & VOLTE use cases.
Step 1: Log onto (or remain logged onto) the Drools PDP.
docker exec -it drools bash
You now have a shell open in the Drools PDP container running in docker
Step 2: Check that the Amsterdam policies are not loaded by querying for Drools facts
curl --silent --user @1b3rt:31nst31n -X GET http://localhost:9696/policy/pdp/engine/controllers/amsterdam/drools/facts/amsterdam | python -m json.tool
Expect the response {} indicating no policies are loaded.
Step 3: Create a temporary directory for policy installation
mkdir /tmp/basex-controlloop cd /tmp/basex-controlloop
Step 4: Extract the policies from the control loop zip file previously downloaded from Nexus and expanded in steps 3 and 4 above.
tar zxvf /tmp/apps-controlloop/basex-controlloop-1.2.0.tar.gz
Step 5: Install the Amsterdam policy rules, the script asks for a number of input parameters, accept the default for all parameters
bin/create-cl-amsterdam # - Type Y when asked for confirmation of parameters # - Accept /tmp as the install directory # - Type Y to agree to creation of a Maven Artifact
- Step 6: Maven artifact creation now proceeds. After some minutes, confirmation is requested for deployment of rules into Maven.
# - Type Y to deploy the rules.
The rules are deployed into Maven. Expect the rule deployment process to take a number of minutes, perhaps 10 minutes.
Step 7: Copy the Amsterdam properties file into the Drools PDP configuration directory. This file configures the Drools PDP with the Amsterdam policies
cp /tmp/amsterdam/amsterdam-controller.properties /opt/app/policy/config
Step 8: Stop and start the Drools PDP
policy stop policy start
Step 9: Now verify that the Amsterdam policies are loaded, there should be a fact in the Drools PDP
curl --silent --user @1b3rt:31nst31n -X GET http://localhost:9696/policy/pdp/engine/controllers/amsterdam/drools/facts/amsterdam | python -m json.tool
Expect the response:
{ "org.onap.policy.controlloop.Params": 1 }
Execute the vCPE Use Case Manually¶
- You can now run the vCPE Policy use case manually using the HowTos below:
Note
You should check that the topic names you use match those in the Amsterdam configuration file /opt/app/policy/config/amsterdam-controller.properties.
You should ensure that you change to the directory /tmp/amsterdam prior to running those HowTos
End of Document