1 # Copyright 2019 Huawei Technologies Co., Ltd.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 open_cli_schema_version: 1.0
16 name: vnf-tosca-provision
18 ONAP TOSCA VNF validation using ONAP CLI and Open Command Platform (OCOMP)
20 This command runs in 5 mode:
21 1. setup: Create requires Vendor, Service Subscription and VNF cloud in ONAP
22 2. standup: From the given VSP csar, VNF csar and NS csar, it creates VF Model, NS Model and NS service
23 3. cleanup: Remove those entries provided in onap-objects parameter
24 4. provision:Run setup -> standup
25 5. validate: Run setup -> standup -> cleanup
27 On every execution, it reports the ONAP managed object's ids in result onap-objects attribute. so
28 if requires, these attribute value could be passed in input parameter onap-objects on subsequent
29 executions to avoid recreation of these ONA managed objects
33 1. Setup the OCOMP profile to configure the ONAP service URL and creadentials as given below
35 a. Run command 'oclip' to go to OCOMP interactive mode
37 b. Type 'use onap-dublin' to choose the onap-dublin product
39 c. Type 'profile onap-dublin' to create or to use existing onap-dublin profile
41 d. Set following entries:
42 set sdc.onboarding:host-url=http://159.138.8.8:30280
43 set sdc.onboarding:host-username=cs0008
44 set sdc.onboarding:host-password=demo123456!
45 set sdc.catalog:host-url=http://159.138.8.8:30205
46 set sdc.catalog:host-password=demo123456\!
47 set sdc.catalog:host-username=cs0008
48 set sdc.catalog:service-model-approve:host-username=gv0001
49 set sdc.catalog:service-model-distribute:host-username=op0001
50 set sdc.catalog:service-model-test-start:host-username=jm0007
51 set sdc.catalog:service-model-test-accept:host-username=jm0007
52 set sdc.catalog:service-model-add-artifact:host-username=ocomp
53 set sdc.catalog:vf-model-add-artifact:host-username=ocomp
54 set aai:host-url=https://159.138.8.8:30233
55 set aai:host-username=AAI
56 set aai:host-password=AAI
57 set vfc:host-url=http://159.138.8.8:30280
58 set multicloud:host-url=http://159.138.8.8:30280
61 By default, SDC onboarding service does not provide node port, which is available to access from external ONAP network.
62 so to enable for external access, register the SDC onboarding service into MSB and use MSB url for sdc.onboarding:host-url.
64 oclip --product onap-dublin microservice-create --host-url http://159.138.8.8:30280 --service-name sdcob --service-version v1.0 --service-url /onboarding-api/v1.0 --path /onboarding-api/v1.0 --node-ip 172.16.1.0 --node-port 8081
66 oclip --product onap-dublin microservice-create --host-url http://159.138.8.8:30280 --service-name sdcobs --service-version v1.0 --service-url /onboarding-api/v1.0 --path /onboarding-api/v1.0 --node-ip 172.16.1.0 --node-port 8445 --enable-ssl
68 Find out SDC onboarding service IP and port details as given here:
69 [root@onap-dublin-vfw-93996-50c1z ~]# kubectl get pods -n onap -o wide | grep sdc-onboarding-be
70 dev-sdc-sdc-onboarding-be-5564b877c8-vpwr5 2/2 Running 0 29d 172.16.1.0 192.168.2.163 <none> <none>
71 dev-sdc-sdc-onboarding-be-cassandra-init-mtvz6 0/1 Completed 0 29d 172.16.0.220 192.168.2.163 <none> <none>
72 [root@onap-dublin-vfw-93996-50c1z ~]#
74 Note down the IP address for sdc-onboarding-be 172.16.1.0
76 [root@onap-dublin-vfw-93996-50c1z ~]# kubectl get services -n onap -o wide | grep sdc-onboarding-be
77 sdc-onboarding-be ClusterIP 10.247.198.92 <none> 8445/TCP,8081/TCP 29d app=sdc-onboarding-be,release=dev-sdc
78 [root@onap-dublin-vfw-93996-50c1z ~]#
80 Note down the port for sdc-onboarding-be 8445 8081
82 Similarly, other service IP and Port could be discovered like above, in case not know earlier :)
84 This profile would be used while running the command with ONAP setup configured in it, as below
85 oclip --profile onap-dublin vnf-tosca-provision .....
87 e. Verify these details once by typing 'set'
89 f. Exit from the interactive console by typing 'exit'
92 oclip --product onap-dublin --profile onap-dublin sdc-consumer-create --consumer-name ocomp
94 3. Update the cloud and vnfm driver details in the configuration file $OPEN_CLI_HOME/conf/vnf-tosca-provision.json
98 service: vnf-validation
99 author: ONAP VTP Team kanagaraj.manickam@huawei.com
103 description: Configuration file path
106 long_option: config-json
107 default_value: $s{env:OPEN_CLI_HOME}/conf/vnf-tosca-provision.json
110 description: Path to the ONAP vendor service product (VSP) for the VNF to provision
116 description: Path to the TOSCA CSAR for the VNF to provision
119 long_option: vnf-csar
122 description: Path to the TOSCA CSAR for the NS service to provision
129 description: VNFM driver to use. One of gvnfmdriver or hwvnfmdriver
132 long_option: vnfm-driver
135 description: Existing ONAP object ids to use instead of creating them while running this task
138 long_option: onap-objects
142 description: setup or standup or cleanup or provision or validate
147 default_value: checkup
149 description: VNF Name
152 long_option: vnf-name
154 - name: vnf-vendor-name
155 description: VNF Vendor Name
158 long_option: vnf-vendor-name
164 description: ONAP VNF instance id
168 description: Onap VNF status
172 description: Onap NS service instance id
176 description: Onap NS status
180 description: VNFM driver used
184 description: ONAP object used
187 - name: vnf-vendor-name
188 description: VNF Vendor Name
192 description: VNF Name
197 - python $s{env:OPEN_CLI_HOME}/script/vnf-tosca-provision.py --vendor-name ${vnf-vendor-name} --vnf-name ${vnf-name} --mode ${mode} --result-json $s{tmp:result.json:onap-objects} --conf ${config-json} --vsp ${vsp} --vnf-csar ${vnf-csar} --ns-csar ${ns-csar} --vnfm-driver ${vnfm-driver}
201 output: $s{tmp:result.json}
204 vnf-status: $o{$.vnf_status}
205 ns-id: $o{$.ns_instance_id}
206 ns-status: $o{$.ns_instance_status}
207 vnfm-driver: ${vnfm-driver}
208 vnf-name: ${vnf-name}
209 vnf-vendor-name: ${vnf-vendor-name}