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 4 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. validate: Run setup -> standup -> cleanup
26 On every execution, it reports the ONAP managed object's ids in result onap-objects attribute. so
27 if requires, these attribute value could be passed in input parameter onap-objects on subsequent
28 executions to avoid recreation of these ONA managed objects
32 1. Setup the OCOMP profile to configure the ONAP service URL and creadentials as given below
34 a. Run command 'oclip' to go to OCOMP interactive mode
36 b. Type 'use onap-dublin' to choose the onap-dublin product
38 c. Type 'profile onap-dublin' to create or to use existing onap-dublin profile
40 d. Set following entries:
41 set sdc.onboarding:host-url=https://159.138.8.8:30280
42 set sdc.onboarding:host-username=cs0008
43 set sdc.onboarding:host-password=demo123456!
44 set sdc.catalog:host-url=https://159.138.8.8:30205
45 set sdc.catalog:host-password=demo123456\!
46 set sdc.catalog:host-username=cs0008
47 set sdc.catalog:service-model-approve:host-username=gv0001
48 set sdc.catalog:service-model-distribute:host-username=op0001
49 set sdc.catalog:service-model-test-start:host-username=jm0007
50 set sdc.catalog:service-model-test-accept:host-username=jm0007
51 set sdc.catalog:service-model-add-artifact:host-username=ocomp
52 set sdc.catalog:vf-model-add-artifact:host-username=ocomp
53 set aai:host-url=https://159.138.8.8:30233
54 set aai:host-username=AAI
55 set aai:host-password=AAI
56 set vfc:host-url=http://159.138.8.8:30280
57 set multicloud:host-url=http://159.138.8.8:30280
60 By default, SDC onboarding service does not provide node port, which is available to access from external ONAP network.
61 so to enable for external access, register the SDC onboarding service into MSB and use MSB url for sdc.onboarding:host-url.
63 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
65 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
67 Find out SDC onboarding service IP and port details as given here:
68 [root@onap-dublin-vfw-93996-50c1z ~]# kubectl get pods -n onap -o wide | grep sdc-onboarding-be
69 dev-sdc-sdc-onboarding-be-5564b877c8-vpwr5 2/2 Running 0 29d 172.16.1.0 192.168.2.163 <none> <none>
70 dev-sdc-sdc-onboarding-be-cassandra-init-mtvz6 0/1 Completed 0 29d 172.16.0.220 192.168.2.163 <none> <none>
71 [root@onap-dublin-vfw-93996-50c1z ~]#
73 Note down the IP address for sdc-onboarding-be 172.16.1.0
75 [root@onap-dublin-vfw-93996-50c1z ~]# kubectl get services -n onap -o wide | grep sdc-onboarding-be
76 sdc-onboarding-be ClusterIP 10.247.198.92 <none> 8445/TCP,8081/TCP 29d app=sdc-onboarding-be,release=dev-sdc
77 [root@onap-dublin-vfw-93996-50c1z ~]#
79 Note down the port for sdc-onboarding-be 8445 8081
81 Similarly, other service IP and Port could be discovered like above, in case not know earlier :)
83 This profile would be used while running the command with ONAP setup configured in it, as below
84 oclip --profile onap-dublin vnf-tosca-provision .....
86 e. Verify these details once by typing 'set'
88 e. Exit from the interactive console by typing 'exit'
91 oclip --product onap-dublin --profile onap-dublin sdc-consumer-create --consumer-name ocomp
93 3. Update the cloud and vnfm driver details in the configuration file $OPEN_CLI_HOME/conf/vnf-tosca-provision.json
97 service: vnf-validation
98 author: ONAP VTP Team kanagaraj.manickam@huawei.com
102 description: Configuration file path
105 long_option: config-json
106 default_value: $s{env:OPEN_CLI_HOME}/conf/vnf-tosca-provision.json
109 description: Path to the ONAP vendor service product (VSP) for the VNF to provision
115 description: Path to the TOSCA CSAR for the VNF to provision
118 long_option: vnf-csar
121 description: Path to the TOSCA CSAR for the NS service to provision
128 description: VNFM driver to use. One of gvnfmdriver or hwvnfmdriver
131 long_option: vnfm-driver
134 description: Existing ONAP object ids to use instead of creating them while running this task
137 long_option: onap-objects
141 description: setup or standup or cleanup
146 default_value: validate
148 description: VNF Name
151 long_option: vnf-name
153 - name: vnf-vendor-name
154 description: VNF Vendor Name
157 long_option: vnf-vendor-name
163 description: ONAP VNF instance id
167 description: Onap VNF status
171 description: Onap NS service instance id
175 description: Onap NS status
179 description: VNFM driver used
183 description: ONAP object used
186 - name: vnf-vendor-name
187 description: VNF Vendor Name
191 description: VNF Name
196 - 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}
200 output: $s{tmp:result.json}
203 vnf-status: $o{$.vnf_status}
204 ns-id: $o{$.ns_instance_id}
205 ns-status: $o{$.ns_instance_status}
206 vnfm-driver: ${vnfm-driver}
207 vnf-name: ${vnf-name}
208 vnf-vendor-name: ${vnf-vendor-name}