How-To: Register a VIM/Cloud Instance to ONAP
See : https://onap.readthedocs.io/en/latest/guides/onap-user/cloud_site/index.html
Following is maybe obsolete...
When a VIM/Cloud instance is used to deploy an ONAP instance, it will be registered to that ONAP instance by default. However, it is somehow tricky to add additional VIM/Cloud instance to ONAP instance with Amsterdam Release. This page is trying to share the practice to do so and the goal is to allow users deploy VNF/VF-Modules to the additional VIM/Cloud instance.
There are 3 places to store information of a VIM/Cloud instance: A&AI, SO, Robot. And it is very important to associate the VIM/Cloud instance with subscriber's service subscription, otherwise you will not able to deploy the subscriber's VNF/VF-Modules to that VIM/Cloud instance .
Prerequisite: Complex object and Subscribe object are created in the AAI
Complex object in A&AI represent the physical location of a VIM/Cloud instance, there are one-to-many association between them, so creating the complex object is out of scope of this practice. But I would like to share the POSTMAN script to do create complex named clli2 for your reference:
Create a Complex Object
PUT /aai/v11/cloud-infrastructure/complexes/complex/clli2 HTTP/1.1
Host: <AAI_VM1_IP>:8443
X-TransactionId: 9999
X-FromAppId: jimmy-postman
Real-Time: true
Authorization: Basic QUFJOkFBSQ==
Content-Type: application/json
Accept: application/json
Cache-Control: no-cache
Postman-Token: 734b5a2e-2a89-1cd3-596d-d69904bcda0a
{
"physical-location-id": "clli2",
"data-center-code": "example-data-center-code-val-6667",
"complex-name": "clli2",
"identity-url": "example-identity-url-val-28399",
"physical-location-type": "example-physical-location-type-val-28399",
"street1": "example-street1-val-28399",
"street2": "example-street2-val-28399",
"city": "example-city-val-28399",
"state": "example-state-val-28399",
"postal-code": "example-postal-code-val-28399",
"country": "example-country-val-28399",
"region": "example-region-val-28399",
"latitude": "1111",
"longitude": "2222",
"elevation": "example-elevation-val-28399",
"lata": "example-lata-val-28399"
}
Subscriber registration and subscription to service is out of scope of this practice, a default subscriber "Demonstration" and service subscriptions are populated by Robot service.
Here are the commands to find out subscribers and their subscriptions.
List subscribers
curl -X GET \
https://<AAI_VM1_IP>:8443/aai/v11/business/customers \
-H 'accept: application/json' \
-H 'authorization: Basic QUFJOkFBSQ==' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: eb104518-1ce2-5fc8-a475-97890dbc36e0' \
-H 'real-time: true' \
-H 'x-fromappid: jimmy-postman' \
-H 'x-transactionid: 9999'
List subscriptions of a subscriber
curl -X GET \
'https://<AAI_VM1_IP>:8443/aai/v11/business/customers/customer/Demonstration?depth=all' \
-H 'accept: application/json' \
-H 'authorization: Basic QUFJOkFBSQ==' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: 87a35cc3-5411-1f0c-3caa-21c11f83b79a' \
-H 'real-time: true' \
-H 'x-fromappid: jimmy-postman' \
-H 'x-transactionid: 9999'
1, Register VIM/Cloud instance into A&AI
The VIM/Cloud instance are represented as a cloud region object in A&AI. This representation will be used by VID,APPC, VFC, DCAEgen2, MultiCloud,etc.
Assuming you have a OpenStack ocata instance with Region ID is RegionTwo, Registering it into A&AI basically refers to following actions:
Action 1: create a cloud region object
There are at least 2 approaches to create a cloud region object: Post curl commands to A&AI directly, or utilize ESR VIM registration portal.
Approach 1: curl commands to A&AI
e.g. Create a OpenStack Ocata instance as a cloud region identified by "CloudOwner/RegionTwo" into AAI,
Create a Cloud Region Object
Approach 2: utilize ESR VIM registration portal
open the portal by url: http://<multi-service VM IP>/iui/aai-esr-gui/extsys/vim/vimView.html
Click the "register button", the registration portal will show up.
Caveat: approach 2 which utilizes ESR VIM register portal will trigger MultiCloud to discover resources of VIM/Cloud instance and populate them into AAI. Right now with Amsterdam Release, it supports OpenStack ocata, Wind River Titanium Cloud, and VMware VIO. More options will be available in future releases.
Action 2: associate this cloud region object with a complex object
This association will be important for ONAP Beijing Release when OOF needs to find out the location approximity of different cloud regions.
Associate cloud region with complex "clli2"
Action 3: associate this cloud region object with a subscriber's service subscription
With this association, this cloud region will be populated into list of selection for deploying VNF/VF-Modules from VID.
e.g. associate the cloud region "CloudOwner/RegionTwo" with subscriber "Demonstration" which subscribe to service "vFWCL"
Associate cloud region with a subscriber's subscription
2, Register VIM/Cloud instance into SO
SO does not utilize the cloud region representation in A&AI. It stores information of the VIM/Cloud instances inside of the container as configuration file. So to add a VIM/Cloud instance to SO, you need attach to the SO service container and then update the configuration file "/etc/mso/config.d/cloud_config.json" accordingly.
Below is the template for adding a new cloud site and the associate identity service.
Add the VIM/Cloud info by updating cloud_sites
## check the new config:
http://<so-vm-ip>:8080/networks/rest/cloud/showConfig
3, Change Robot service to operate with the VIM/Cloud instance
By default the Robot service supports the pre-populated cloud region of which the cloud-owner is "CloudOwner" and cloud-region-id is specified via the parameters "openstack_region" for deploying this ONAP instance. All cloud region information can be found at "/share/config/vm_properties.py" .
Robot service supports the hacking operations to populate subscribers, service models, and preload VNF data, bridge heat instance into AAI, as well as APPC mount. Most of operation are tightly coupled with the default cloud region. So if you would like to perform such hacking operations with additional cloud region, you'd better to launch another robot VM with corresponding cloud region parameters in order to get expected results.
Please refer to the template additional_robot.zip to create additional robot for new cloud region
Hint: Take care of following parameters which should reflect the new cloud region information, while others reflect the cloud region where ONAP runs
parameters reflecting info of new cloud region
Launch robot VM by heat template:
Launch additional robot VM for new cloud region
To verify if the new robot service works well, you could check the ONAP service health from the new robot VM.