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 INF O2 Service User Guide
6 =========================
8 This guide will introduce the process that make INF O2 interface work with
11 - Assume you have an O2 service with INF platform environment
15 export OAM_IP=<INF_OAM_IP>
17 - Discover INF platform inventory
19 - INF platform auto discovery
21 After you installed the INF O2 service, it will automatically
22 discover the INF through the parameters that you give from the
23 “*o2service-override.yaml*”
25 Below command can get the INF platform information as O-Cloud
30 "http://${OAM_IP}:30205/o2ims_infrastructureInventory/v1/" \
31 -H 'accept: application/json'
35 One INF platform have one resource pool, all the resources that belong
36 to this INF platform will be organized into this resource pool
38 Get the resource pool information through this interface
43 "http://${OAM_IP}:30205/o2ims_infrastructureInventory/v1/resourcePools" \
44 -H 'accept: application/json'
46 # export resource pool id
47 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`
49 echo ${resourcePoolId} # check the exported resource pool id
53 Resource type defined what type is the specified resource, like a
54 physical machine, memory, or CPU
56 Show all resource type
61 "http://${OAM_IP}:30205/o2ims_infrastructureInventory/v1/resourceTypes" \
62 -H 'accept: application/json'
66 Get the list of all resources, the value of *resourcePoolId* from
67 the result of resource pool interface
72 "http://${OAM_IP}:30205/o2ims_infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources" \
73 -H 'accept: application/json'
75 Get detail of one resource, need to export one specific resource
76 id that wants to check
81 "http://${OAM_IP}:30205/o2ims_infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources/${resourceId}" \
82 -H 'accept: application/json'
84 - Deployment manager services endpoint
86 The Deployment Manager Service (DMS) that related to this IMS
87 information you can use below API to check
92 "http://${OAM_IP}:30205/o2ims_infrastructureInventory/v1/deploymentManagers" \
93 -H 'accept: application/json'
95 - Provisioning INF platform with SMO endpoint configuration
97 Assume you have an SMO, then configure INF platform with SMO endpoint
98 address. This provisioning of INF O2 service will make a request from
99 INF O2 service to SMO, that make SMO know the O2 service is working.
101 It needs SMO to have an API like
102 “*http(s)://SMO_HOST:SMO_PORT/registration*”, which can accept JSON
108 'http://'${OAM_IP}':30205/provision/v1/smo-endpoint' \
109 -H 'accept: application/json' \
110 -H 'Content-Type: application/json' \
112 "endpoint": "http://<SMO_HOST>:<SMO_PORT>/registration"
115 - Subscribe to the INF platform resource change notification
117 Assume you have an SMO, and the SMO have an API can be receive
120 - Create subscription in the INF O2 IMS
125 "http://${OAM_IP}:30205/o2ims_infrastructureInventory/v1/subscriptions" \
126 -H 'accept: application/json' \
127 -H 'Content-Type: application/json' \
129 "callback": "http://SMO/address/to/callback",
130 "consumerSubscriptionId": "<ConsumerIdHelpSmoToIdentify>",
131 "filter": "<ResourceTypeNameSplitByComma,EmptyToGetAll>"
134 - Handle resource change notification
136 When the SMO callback API get the notification that the resource
137 of INF platform changing, use the URL to get the latest resource
138 information to update its database
140 - Orchestrate CNF in helm chart
142 On this sample, we prepare a firewall chart to test the
145 We need to do some preparation to make the helm repo work and include
146 our firewall chart inside of the repository.
148 Get the DMS Id in the INF O2 service, and set it into bash environment
152 curl --location --request GET "http://${OAM_IP}:30205/o2ims_infrastructureInventory/v1/deploymentManagers"
154 export dmsId=`curl --location --request GET "http://${OAM_IP}:30205/o2ims_infrastructureInventory/v1/deploymentManagers" 2>/dev/null | jq .[].deploymentManagerId | xargs echo`
156 echo ${dmsId} # check the exported DMS id
158 Using helm to deploy a chartmuseum to the INF platform
162 helm repo add chartmuseum https://chartmuseum.github.io/charts
164 helm pull chartmuseum/chartmuseum # download chartmuseum-3.4.0.tgz to local
165 tar zxvf chartmuseum-3.4.0.tgz
166 cat <<EOF>chartmuseum-override.yaml
175 helm install chartmuseumrepo chartmuseum/chartmuseum -f chartmuseum-override.yaml
179 Update the helm repo and add the chartmusem into the repository
183 helm repo add o2imsrepo http://${NODE_IP}:30330
186 Download the firewall chart and push it into the repository
190 git clone https://github.com/biny993/firewall-host-netdevice.git
191 tar -zcvf firewall-host-netdevice-1.0.0.tgz firewall-host-netdevice/
192 helm plugin install https://github.com/chartmuseum/helm-push.git
193 helm cm-push firewall-host-netdevice-1.0.0.tgz o2imsrepo
195 helm search repo firewall
197 Setup host net device over INF node
201 ssh sysadmin@<INF OAM IP>
202 sudo ip link add name veth11 type veth peer name veth12
203 sudo ip link add name veth21 type veth peer name veth22
204 sudo ip link |grep veth
207 - Create NfDeploymentDescriptor on the INF O2 DMS
211 curl --location --request POST "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor" \
212 --header 'Content-Type: application/json' \
215 "description": "demo nf deployment descriptor",
216 "artifactRepoUrl": "http://'${NODE_IP}':30330",
217 "artifactName": "firewall-host-netdevice",
219 "{\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}",
220 "outputParams": "{\"output1\": 100}"
223 curl --location --request GET "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor"
225 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`
227 echo ${descId} # check the exported descriptor id
229 - Create NfDeployment on the INF O2 DMS
231 When you have an descriptor of deployment, you can create a
232 NfDeployment, it will trigger an event inside of the IMS/DMS, and
233 use the K8S API to create a real pod of the firewall sample
237 curl --location --request POST "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment" \
238 --header 'Content-Type: application/json' \
241 "description": "demo nf deployment",
242 "descriptorId": "'${descId}'",
243 "parentDeploymentId": ""
246 curl --location --request GET "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment"
248 - Check pods of the firewall sample
254 - Delete the deployment we just created
258 export NfDeploymentId=`curl --location --request GET "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment" 2>/dev/null | jq .[].id | xargs echo`
260 echo ${NfDeploymentId} # Check the exported deployment id
262 curl --location --request DELETE "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment/${NfDeploymentId}"