1 O-Cloud O2 Service User Guide
2 =============================
4 This guide will introduce the process that make O2 interface work with
7 - Assume you have an O-Cloud O2 environment
11 export OAM_IP=<INF_OAM_IP>
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'
42 # export resource pool id
43 export resourcePoolId=`curl -X 'GET' "http://${OAM_IP}:30205/o2ims_infrastructureInventory/v1/resourcePools" -H 'accept: application/json' -H 'X-Fields: resourcePoolId' 2>/dev/null | jq .[].resourcePoolId | xargs echo`
45 echo ${resourcePoolId} # check the exported resource pool id
49 Resource type defined what type is the specified resource, like a
50 physical machine, memory, or CPU
52 Show all resource type
57 "http://${OAM_IP}:30205/o2ims_infrastructureInventory/v1/resourceTypes" \
58 -H 'accept: application/json'
62 Get the list of all resources, the value of *resourcePoolId* from
63 the result of resource pool interface
68 "http://${OAM_IP}:30205/o2ims_infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources" \
69 -H 'accept: application/json'
71 Get detail of one resource, need to export one specific resource
72 id that wants to check
77 "http://${OAM_IP}:30205/o2ims_infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources/${resourceId}" \
78 -H 'accept: application/json'
80 - Deployment manager services endpoint
82 The Deployment Manager Service (DMS) that related to this IMS
83 information you can use below API to check
88 "http://${OAM_IP}:30205/o2ims_infrastructureInventory/v1/deploymentManagers" \
89 -H 'accept: application/json'
91 - Provisioning O-Cloud with SMO endpoint configuration
93 Assume you have an SMO, then configure O-Cloud with SMO endpoint
94 address. This provisioning of O-Cloud will make a request from
95 O-Cloud to SMO, that make SMO know the O2 service is working.
97 It needs SMO to have an API like
98 “*http(s)://SMO_HOST:SMO_PORT/registration*”, which can accept JSON
104 'http://'${OAM_IP}':30205/provision/v1/smo-endpoint' \
105 -H 'accept: application/json' \
106 -H 'Content-Type: application/json' \
108 "endpoint": "http://<SMO_HOST>:<SMO_PORT>/registration"
111 - Subscribe to the O-Cloud resource change notification
113 Assume you have an SMO, and the SMO have an API can be receive
116 - Create subscription in O-Cloud IMS
121 "http://${OAM_IP}:30205/o2ims_infrastructureInventory/v1/subscriptions" \
122 -H 'accept: application/json' \
123 -H 'Content-Type: application/json' \
125 "callback": "http://SMO/address/to/callback",
126 "consumerSubscriptionId": "<ConsumerIdHelpSmoToIdentify>",
127 "filter": "<ResourceTypeNameSplitByComma,EmptyToGetAll>"
130 - Handle resource change notification
132 When the SMO callback API get the notification that the resource
133 of O-Cloud changing, use the URL to get the latest resource
134 information to update its database
136 - Orchestrate CNF in helm chart
138 On this sample, we prepare a firewall chart to test the
141 We need to do some preparation to make the helm repo work and include
142 our firewall chart inside of the repository.
144 Get the DMS Id in the O-Cloud, and set it into bash environment
148 curl --location --request GET "http://${OAM_IP}:30205/o2ims_infrastructureInventory/v1/deploymentManagers"
150 export dmsId=`curl --location --request GET "http://${OAM_IP}:30205/o2ims_infrastructureInventory/v1/deploymentManagers" 2>/dev/null | jq .[].deploymentManagerId | xargs echo`
152 echo ${dmsId} # check the exported DMS id
154 Using helm to deploy a chartmuseum to the INF
158 helm repo add chartmuseum https://chartmuseum.github.io/charts
160 helm pull chartmuseum/chartmuseum # download chartmuseum-3.4.0.tgz to local
161 tar zxvf chartmuseum-3.4.0.tgz
162 cat <<EOF>chartmuseum-override.yaml
171 helm install chartmuseumrepo chartmuseum/chartmuseum -f chartmuseum-override.yaml
175 Update the helm repo and add the chartmusem into the repository
179 helm repo add o2imsrepo http://${NODE_IP}:30330
182 Download the firewall chart and push it into the repository
186 git clone https://github.com/biny993/firewall-host-netdevice.git
187 tar -zcvf firewall-host-netdevice-1.0.0.tgz firewall-host-netdevice/
188 helm plugin install https://github.com/chartmuseum/helm-push.git
189 helm cm-push firewall-host-netdevice-1.0.0.tgz o2imsrepo
191 helm search repo firewall
193 Setup host net device over INF
197 ssh sysadmin@<INF OAM IP>
198 sudo ip link add name veth11 type veth peer name veth12
199 sudo ip link add name veth21 type veth peer name veth22
200 sudo ip link |grep veth
203 - Create NfDeploymentDescriptor
207 curl --location --request POST "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor" \
208 --header 'Content-Type: application/json' \
211 "description": "demo nf deployment descriptor",
212 "artifactRepoUrl": "http://'${NODE_IP}':30330",
213 "artifactName": "firewall-host-netdevice",
215 "{\n \"image\": {\n \"repository\": \"ubuntu\",\n \"tag\": 18.04,\n \"pullPolicy\": \"IfNotPresent\"\n },\n \"resources\": {\n \"cpu\": 2,\n \"memory\": \"2Gi\",\n \"hugepage\": \"0Mi\",\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}",
216 "outputParams": "{\"output1\": 100}"
219 curl --location --request GET "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor"
221 export descId=` curl -X 'GET' "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor" -H 'accept: application/json' -H 'X-Fields: id' 2>/dev/null | jq .[].id | xargs echo`
223 echo ${descId} # check the exported descriptor id
225 - Create NfDeployment
227 When you have an descriptor of deployment, you can create a
228 NfDeployment, it will trigger an event inside of the IMS/DMS, and
229 use the K8S API to create a real pod of the firewall sample
233 curl --location --request POST "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment" \
234 --header 'Content-Type: application/json' \
237 "description": "demo nf deployment",
238 "descriptorId": "'${descId}'",
239 "parentDeploymentId": ""
242 curl --location --request GET "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment"
244 - Check pods of the firewall sample
250 - Delete the deployment we just created
254 export NfDeploymentId=`curl --location --request GET "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment" 2>/dev/null | jq .[].id | xargs echo`
256 echo ${NfDeploymentId} # Check the exported deployment id
258 curl --location --request DELETE "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment/${NfDeploymentId}"