1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. SPDX-License-Identifier: CC-BY-4.0
3 .. Copyright (C) 2021 Wind River Systems, Inc.
5 O-Cloud O2 Service User Guide
6 =============================
8 This guide will introduce the process that make O2 interface work with
11 - Assume you have an O-Cloud O2 environment
13 - Discover O-Cloud inventory
15 - O-Cloud auto discovery
17 After you installed the O-Cloud service, it will automatically
18 discover the INF through the parameters that you give from the
19 “*o2service-override.yaml*”
21 Below command can get the O-Cloud information
26 'http://<OAM IP>:30205/o2ims_infrastructureInventory/v1/' \
27 -H 'accept: application/json'
31 One O-Cloud have one resource pool, all the resources that belong
32 to this O-Cloud will be organized into this resource pool
34 Get the resource pool information through this interface
39 'http://<OAM IP>:30205/o2ims_infrastructureInventory/v1/resourcePools' \
40 -H 'accept: application/json'
44 Resource type defined what type is the specified resource, like a
45 physical machine, memory, or CPU
47 Show all resource type
52 'http://<OAM IP>:30205/o2ims_infrastructureInventory/v1/resourceTypes' \
53 -H 'accept: application/json'
57 Get the list of all resources, the value of *resourcePoolId* from
58 the result of resource pool interface
63 "http://<OAM IP>:30205/o2ims_infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources" \
64 -H 'accept: application/json'
66 Get detail of one resource
71 "http://<OAM IP>:30205/o2ims_infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources/${resourceId}" \
72 -H 'accept: application/json'
74 - Deployment manager services endpoint
76 The Deployment Manager Service (DMS) that related to this IMS
77 information you can use below API to check
82 'http://<OAM IP>:30205/o2ims_infrastructureInventory/v1/deploymentManagers' \
83 -H 'accept: application/json'
85 - Subscribe to the O-Cloud resource change notification
87 Assume you have a SMO, and the SMO have an API can be receive
90 - Create subscription in O-Cloud IMS
95 'http://<OAM IP>:30205/o2ims_infrastructureInventory/v1/subscriptions' \
96 -H 'accept: application/json' \
97 -H 'Content-Type: application/json' \
99 "callback": "http://SMO/address/to/callback",
100 "consumerSubscriptionId": "<ConsumerIdHelpSmoToIdentify>",
101 "filter": "<ResourceTypeNameSplitByComma,EmptyToGetAll>"
104 - Handle resource change notification
106 When the SMO callback API get the notification that the resource
107 of O-Cloud changing, use the URL to get the latest resource
108 information to update its database
110 - Orchestrate CNF in helm chart
112 On this sample, we prepare a firewall chart to test the
115 We need to do some preparation to make the helm repo work and include
116 our firewall chart inside of the repository.
118 Get the DMS Id in the O-Cloud, and set it into bash environment
122 curl --location --request GET 'http://<OAM IP>:30205/o2ims_infrastructureInventory/v1/deploymentManagers'
124 export dmsId=`curl --location --request GET 'http://<OAM IP>:30205/o2ims_infrastructureInventory/v1/deploymentManagers' 2>/dev/null | jq .[].deploymentManagerId | xargs echo`
126 Using helm to deploy a chartmuseum to the INF
130 helm pull chartmuseum/chartmuseum # download chartmuseum-3.4.0.tgz to local
131 tar zxvf chartmuseum-3.4.0.tgz
132 cat <<EOF>chartmuseum-override.yaml
141 helm install chartmuseumrepo chartmuseum/chartmuseum -f chartmuseum-override.yaml
145 Update the helm repo and add the chartmusem into the repository
149 helm repo add o2imsrepo http://${NODE_IP}:30330
152 Download the firewall chart and push it into the repository
156 git clone https://github.com/biny993/firewall-host-netdevice.git
157 tar -zcvf firewall-host-netdevice-1.0.0.tgz firewall-host-netdevice/
158 helm push firewall-host-netdevice-1.0.0.tgz o2imsrepo
160 helm search repo firewall
162 - Create NfDeploymentDescriptor
166 curl --location --request POST "http://<OAM IP>:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor" \
167 --header 'Content-Type: application/json' \
170 "description": "demo nf deployment descriptor",
171 "artifactRepoUrl": "http://${NODE_IP}:30330",
172 "artifactName": "firewall-host-netdevice",
174 "{\n \"image\": {\n \"repository\": \"ubuntu\",\n \"tag\": 18.04,\n \"pullPolicy\": \"IfNotPresent\"\n },\n \"resources\": {\n \"cpu\": 2,\n \"memory\": \"2Gi\",\n \"hugepage\": \"256Mi\",\n \"unprotectedNetPortVpg\": \"veth11\",\n \"unprotectedNetPortVfw\": \"veth12\",\n \"unprotectedNetCidr\": \"10.10.1.0/24\",\n \"unprotectedNetGwIp\": \"10.10.1.1\",\n \"protectedNetPortVfw\": \"veth21\",\n \"protectedNetPortVsn\": \"veth22\",\n \"protectedNetCidr\": \"10.10.2.0/24\",\n \"protectedNetGwIp\": \"10.10.2.1\",\n \"vfwPrivateIp0\": \"10.10.1.1\",\n \"vfwPrivateIp1\": \"10.10.2.1\",\n \"vpgPrivateIp0\": \"10.10.1.2\",\n \"vsnPrivateIp0\": \"10.10.2.2\"\n }\n}",
175 "outputParams": "{\"output1\": 100}"
178 curl --location --request GET "http://<OAM IP>:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor"
180 - Create NfDeployment
182 When you have an descriptor of deployment, you can create a
183 NfDeployment, it will trigger an event inside of the IMS/DMS, and
184 use the K8S API to create a real pod of the firewall sample
188 curl --location --request POST "http://<OAM IP>:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment" \
189 --header 'Content-Type: application/json' \
192 "description": "demo nf deployment",
193 "descriptorId": "<Descriptor ID>",
194 "parentDeploymentId": ""
197 curl --location --request GET "http://<OAM IP>:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment"
199 - Check pods of the firewall sample
205 - Delete the deployment we just created
209 export NfDeploymentId=`curl --location --request GET 'http://<OAM IP>:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment' 2>/dev/null | jq .[].id | xargs echo`
211 curl --location --request DELETE "http://<OAM IP>:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment/${NfDeploymentId}"