Welcome to O-RAN SC SMO O2 Documentation¶
..please write your project overview ..please delete this content after editing
SMO O2 Overview¶
This repository is for the implementation, installation, and use of the O2 interface of SMO. It uses the OpenStack Tacker to implement the O2 interface.
OpenStack Tacker¶
See below for an overview of OpenStack Tacker.
Developer-Guide¶
Testing¶
API conformance test with ETSI NFV-TST¶
ETSI NFV-TST 010 specifies the method of the conformance test for APIs specified by NFV specifications. ETSI NFV-TST provides test suites called ‘api-tests’ based on ETSI NFV-TST 010 specification. The following steps are the procedure of API conformance test according to the specification by using Xtesting.
Xtesting environment setup
Check out code from smo-o2 repository into /tmp/ directory in your local machine.
$ cd /tmp $ git clone https://gerrit.o-ran-sc.org/r/smo/o2
Create a virtual environment for xtesting in ‘~/tacker/tacker/tests/’ directory.
$ cd ~/tacker/tacker/tests $ mkdir xtesting $ cd xtesting $ virtualenv xtesting-py3 -p python3
Activate the virtual environment.
$ . xtesting-py3/bin/activate
Install Xtesting package.
$ pip install xtesting
Copy ‘requirements.txt’ from ‘/tmp/o2/tacker/tacker/tests/xtesting/’ to the current directory and install it.
$ cp /tmp/o2/tacker/tacker/tests/xtesting/requirements.txt . $ pip install -r requirements.txt
Check out ‘api-tests’ repository in ETSI NFV into the current directory.
$ git clone https://forge.etsi.org/rep/nfv/api-tests.git
Copy the directories and file under ‘/tmp/o2/tacker/tacker/tests/xtesting/’ to the location under the current directory.
$ cp -r /tmp/o2/tacker/tacker/tests/xtesting/api-tests/SOL003/CNFDeployment ./api-tests/SOL003 $ cp -r /tmp/o2/tacker/tacker/tests/xtesting/api-tests/SOL003/cnflcm ./api-tests/SOL003 $ cp -r /tmp/o2/tacker/tacker/tests/xtesting/api-tests/SOL005/CNFPrecondition ./api-tests/SOL005 $ mkdir jsons $ cp ./api-tests/SOL003/cnflcm/jsons/inst.json ./jsons/instantiateVnfRequest.json
Copy ‘testcases.yaml’ file from ‘/tmp/o2/tacker/tacker/tests/xtesting/’ directory to the location under the current directory.
$ cp /tmp/o2/tacker/tacker/tests/xtesting/testcases.yaml ./xtesting-py3/lib/python3.8/site-packages/xtesting/ci/
Note
If user is working in other directory than ‘/opt/stack/’, then the path specified in ‘suites’ parameter in ‘testcases.yaml’ needs to be updated to the actual one.
Give permissions to ‘api-tests’ directory.
$ sudo chmod -R 775 api-tests
Update ‘VNFM_SCHEMA’, ‘VNFM_PORT’, ‘VNFM_HOST’, ‘PODS_SCHEMA’, ‘PODS_PORT’ and ‘PODS_HOST’ variables in below files with appropriate Request Type (http or https), Port and Host.
$ vi api-tests/SOL003/CNFDeployment/environment/variables.txt
Copy necessary files under api-tests directory into the designated location.
$ cp ./api-tests/SOL003/VNFLifecycleManagement-API/jsons/createVnfRequest.json ./jsons $ cp ./api-tests/SOL003/VNFLifecycleManagement-API/jsons/healVnfRequest.json ./jsons $ mkdir schemas $ cp ./api-tests/SOL003/VNFLifecycleManagement-API/schemas/vnfInstance.schema.json ./schemas
Modify robot files under api-tests directory as below.
$ vi api-tests/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot
E.g: Part of file content
(Omitted) POST Create a new vnfInstance Log Create VNF instance by POST to /vnf_instances Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Run Keyword If ${check_descriptors} == 1 PARSE the Descriptor File ${template}= Get File jsons/createVnfRequest.json ${body}= Format String ${template} vnfdId=${vnfdId} vnfProvider=${Provider} vnfProductName=${Product_Name} vnfSoftwareVersion=${Software_Version} vnfdVersion= ${Descriptor_Version} Post ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} ${res_body}= Get From Dictionary ${outputResponse} body # Add this line ${vnfInstanceId}= Get From Dictionary ${res_body} id # Add this line Set Global Variable ${vnfInstanceId} # Add this line Run Process api-tests/SOL003/cnflcm/update_variable.sh ${vnfInstanceId} shell=yes # Add this line GET multiple vnfInstances Log Query VNF The GET method queries information about multiple VNF instances. (Omitted)
Note
This change is for holding variable between test cases.
$ vi api-tests/SOL003/VNFLifecycleManagement-API/VNFInstances.robot
E.g: Part of file content
(Omitted) POST Create a new vnfInstance [Documentation] Test ID: 7.3.1.1.1 ... Test title: POST Create a new vnfInstance ... Test objective: The objective is to create a new VNF instance resource ... Pre-conditions: none ... Reference: Clause 5.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v2.8.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: VNF instance created POST Create a new vnfInstance Check HTTP Response Status Code Is 201 Check HTTP Response Body Json Schema Is vnfInstance *** comment *** # Add this line GET information about multiple VNF instances [Documentation] Test ID: 7.3.1.1.2 (Omitted)
Note
This change is for avoiding running unnecessary test cases.
Preconditioning for test execution
If there is no ‘nfv_user’ and ‘nfv’ project, create them in your local environment.
$ source ${devstack_dir}/openrc admin admin $ openstack project create --domain default nfv $ openstack user create --domain default --project nfv --password devstack nfv_user $ openstack role add --project nfv --user nfv_user admin
Register Kubernetes VIM and create an executable environment for Helm CLI from steps mentioned in below link.
Install ‘dos2unix’ and ‘jq’.
$ sudo apt-get install dos2unix $ sudo apt install jq
Execute script ‘packageTest.sh’ for package creation and uploading.
$ cd ~/tacker/tacker/tests/xtesting/api-tests/SOL005/CNFPrecondition $ ./packageTest.sh ../../SOL003/VNFLifecycleManagement-API/environment/variables.txt
Get ‘vimId’ and change it in the file ‘instantiateVnfRequest.json’ as below.
$ openstack vim list -c "ID"
E.g: Output of command
+--------------------------------------+ | ID | +--------------------------------------+ | 08260b52-c3f6-47a9-bb1f-cec1f0d3956a | +--------------------------------------+
$ vi ~/tacker/tacker/tests/xtesting/jsons/instantiateVnfRequest.json
E.g: Content of file
{ "flavourId": "helmchart", "additionalParams": { "namespace": "default", "use_helm": "true", "using_helm_install_param": [ { "exthelmchart": "false", "helmchartfile_path": "Files/kubernetes/localhelm-0.1.0.tgz", "helmreleasename": "tacker-test-vdu" } ], "helm_replica_values": { "vdu1_aspect": "replicaCount" }, "vdu_mapping": { "VDU1": { "kind": "Deployment", "name": "tacker-test-vdu-localhelm", "helmreleasename": "tacker-test-vdu" } } }, "vimConnectionInfo": [ { "id": "742f1fc7-7f00-417d-85a6-d4e788353181", "vimId": "d7a811a3-e3fb-41a1-a4e2-4dce2209bcfe", # Update value here "vimType": "kubernetes" } ] }
Start kubectl proxy.
$ kubectl proxy --port=8080 &
Testing steps
Verify Vnflcm Create and Instantiate.
$ cd ~/tacker/tacker/tests/xtesting/ $ . xtesting-py3/bin/activate $ sudo xtesting-py3/bin/run_tests -t cnf-instantiate
Verify Heal
$ cd ~/tacker/tacker/tests/xtesting/ $ . xtesting-py3/bin/activate $ sudo xtesting-py3/bin/run_tests -t cnf-heal-validation
Verify getting all pods and getting specific pod.
$ cd ~/tacker/tacker/tests/xtesting/ $ . xtesting-py3/bin/activate $ sudo xtesting-py3/bin/run_tests -t cnf-deployments-validation
E.g: Output of command
2022-12-05 05:10:13,908 - xtesting.core.robotframework - INFO - ============================================================================== IndividualCnfLcmOperationOccurrence ============================================================================== Get All Pods :: Test ID: 7.3.1.12.7 Test title: Get All Pods Test ... | PASS | ------------------------------------------------------------------------------ Get Specific Pod :: Test ID: 7.3.1.12.8 Test title: Get Specific P... | PASS | ------------------------------------------------------------------------------ IndividualCnfLcmOperationOccurrence | PASS | 2 tests, 2 passed, 0 failed ============================================================================== Output: /var/lib/xtesting/results/cnf-deployments-validation/output.xml 2022-12-05 05:10:13,913 - xtesting.core.robotframework - INFO - Results were successfully parsed 2022-12-05 05:10:13,968 - xtesting.core.robotframework - INFO - Results were successfully generated 2022-12-05 05:10:13,969 - xtesting.ci.run_tests - INFO - Test result: +-------------------------------+-----------------+------------------+----------------+ | TEST CASE | PROJECT | DURATION | RESULT | +-------------------------------+-----------------+------------------+----------------+ | cnf-deployments-validation | smo | 00:01 | PASS | +-------------------------------+-----------------+------------------+----------------+
For Re-testing, user must delete all the VNF instances and packages created in the above test. An example of steps is below.
$ grep -nu "vnfInstanceId" ~/tacker/tacker/tests/xtesting/api-tests/SOL003/VNFLifecycleManagement-API/environment/variables.txt | awk '{print $2}' 6fc3539c-e602-4afa-8e13-962fb5a7d81f $ openstack vnflcm terminate 6fc3539c-e602-4afa-8e13-962fb5a7d81f $ openstack vnflcm delete 6fc3539c-e602-4afa-8e13-962fb5a7d81f $ grep -nu "{vnfPkgId}" ~/tacker/tacker/tests/xtesting/api-tests/SOL003/VNFLifecycleManagement-API/environment/variables.txt | awk '{print $2}' 718b9054-2a7a-4489-a893-f2b2b1794825 $ openstack vnf package update --operational-state DISABLED 718b9054-2a7a-4489-a893-f2b2b1794825 $ openstack vnf package delete 718b9054-2a7a-4489-a893-f2b2b1794825
Note
In current test, the package name and namespace mentioned in deployment file for “Get Specific Pod” test are “vdu2” and “default”. If any update in the package with respect to name and namespace, then the name and namespace variables in the file ‘~/tacker/tacker/tests/xtesting/api-tests/SOL003/CNFDeployment/environment/variables.txt’ need to be updated accordingly.
Release-Notes¶
This document provides the release notes for releases related to SMO O2.
Version history¶
Date |
Ver. |
Author |
Comment |
2022-07-21 |
1.0 |
Toshiaki Takahashi |
First Release |
2022-12-23 |
2.0 |
Toshiaki Takahashi |
G-Release |
Summary¶
G-release:
The G release was targeted towards implementation of the O2 interface for VM-base VNF and testing with NFV API compliant test code.
F-release(First Release):
The F release was targeted towards implementation of the O2 interface itself and getting an initial implementation in place. The OpenStack Tacker is used to implement the O2 interface.
Release Data¶
Project |
SMO O2 |
Repo/commit-ID |
Repo: smo/o2 |
Release designation |
|
Release date |
2022-12-23 |
Purpose of the delivery |
Feature Additions¶
JIRA BACK-LOG:
JIRA REFERENCE |
SLOGAN |
SMO-77 |
TST010 API Conformance |
SMO-78 |
Release Artifact |
SMO-79 |
Alignment with ETSI NFV SOL014 for VM-base VNF |
SMO-82 |
Update INFO.yaml |
SMO-84 |
Add license info in smo/o2 repo |
Bug Corrections¶
JIRA TICKETS:
JIRA REFERENCE |
SLOGAN |
Deliverables¶
Software Deliverables¶
Documentation Deliverables¶
Known Limitations, Issues and Workarounds¶
System Limitations¶
Known Issues¶
JIRA TICKETS:
JIRA REFERENCE |
SLOGAN |
Workarounds¶
References¶
Installation Guide¶
Abstract¶
This document describes how to install the software for SMO O2, it’s dependencies and required system resources.
Version history
Date |
Ver. |
Author |
Comment |
20XX-XX-XX |
0.1.0 |
First draft |
|
0.1.1 |
|||
1.0 |
Introduction¶
This document describes the supported software and hardware configurations for the reference component as well as providing guidelines on how to install and configure such reference system.
The audience of this document is assumed to have good knowledge in RAN network nd Linux system.
Preface¶
Tacker Preface¶
Before starting the installation of Tacker, make sure git is installed on the system.
Hardware Requirements¶
Tacker Hardware Requirements¶
Following minimum hardware requirements must be met for installation of Tacker:
HW Aspect |
Requirement |
# of servers |
1 |
CPU |
4 |
RAM |
16G |
Disk |
80G |
NICs |
1 |
Software Installation and Deployment¶
Tacker Installation¶
This section describes the installation of the Tacker installation on the reference hardware.
Installation Using Install Script
The install script can be retrieved from smo-o2 repository:
$ git clone https://gerrit.o-ran-sc.org/r/smo/o2
Usage:
$ cd o2/tacker/scripts $ ./install.sh <HOST_IP> <HOST_IP>: You should set host IP for API endpoint of Tacker.
This script installs the Tacker via Devstack (Standalone mode). It uses the latest repositories (Devstack and Tacker).
If you want to use other version, you have to change the URL.
e.g.:
git clone https://opendev.org/openstack-dev/devstack -b stable/yoga wget https://opendev.org/openstack/tacker/raw/branch/stable/yoga/devstack/local.conf.standalone
Manual Installation
See the following documents.
References¶
User Guide¶
This is the user guide of OSC SMO O2.
Description¶
Feature Introduction¶
Tacker¶
An example of the procedure how to deploy VNF or CNF by using Tacker is shown on the following pages. If you want to see the other procedure, please refer to Tacker User Guide
V1 API¶
How to deploy VNF Deployment¶
This user guide shows how to deploy VNF (Virtualized Network Function) via Tacker. See the ETSI NFV-SOL VNF Deployment for the original procedure.
Note
This document focuses on some operations. See the Tacker Use Case Guide or API Reference for other operations.
Prerequisites¶
Credentials Setting¶
To use Tacker CLI, you need to configure the credentials, please change the username
and projectname
to be executed according to your environment.
$ source ${devstack_dir}/openrc admin admin
If you want to access Tacker via API, you need to get auth token by following procedure below.
# Create request body for issuing access token.
$ vi get_token.json
$ cat get_token.json
{
"auth": {
"identity": {
"methods": ["password"],
"password": {
"user": {
"domain": {
"name": "Default"
},
"name": "admin",
"password": "devstack"
}
}
},
"scope": {
"project": {
"domain": {
"name":"Default"
},
"name":"admin"
}
}
}
}
# Issue auth token for accessing via API.
$ curl -i -X POST -H "Content-Type: application/json" -d @./get_token.json http://192.168.121.170/identity/v3/auth/tokens
HTTP/1.1 201 CREATED
Date: Wed, 12 Apr 2023 07:22:44 GMT
Server: Apache/2.4.41 (Ubuntu)
Content-Type: application/json
Content-Length: 7469
X-Subject-Token: gAAAAABkNlxENR1WGpfgAe8g2Z4z5lCtwCsfUs5GTsg9mvYTMbG7S8HPIZep0vAGUnoPTj0_IYgMP-W1Y0vCDmWFQH7CSq1XWv3qNMd4aFnclk5sHuP1s0JtHSls7IQMM6zbn-FBYUSWTc9d783OSxYKXWqf3qo-CfFjPwrkmNzfkzgtlogkeA4
Vary: X-Auth-Token
x-openstack-request-id: req-e94aa763-9578-424b-affb-7ccab80db72c
Connection: close
{"token": {"methods": ["password"], "user": {"domain": {"id": "default", "name": "Default"}, "id": "3e2f3db203e347bfa2197f8fdd038f39", "name": "admin", "password_expires_at": null}, "audit_ids": ["1pgGosVvR4azhw29woKvDw"], "expires_at": "2023-04-12T08:22:44.000000Z", "issued_at": "2023-04-12T07:22:44.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "5af8bd4dd4ed4285ab1d45a95833cc67", "name": "admin"}, "is_domain": false, "roles": [{"id": "a039c220711049e0b77eac89a1504a81", "name": "reader"}, {"id": "57051bcc1fc24eb4875852a8ab32eae7", "name": "member"}, {"id": "029ea703a2534199a412b18cc5bfa31d", "name": "admin"}], "catalog": [{"endpoints": [{"id": "29307c3ec2f94553acbd7682e32602ba", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:8989/v2", "region": "RegionOne"}, {"id": "45e5c5f2d4ce4841a980e29e6d3713f7", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170:8989/v2", "region": "RegionOne"}, {"id": "8d79900575e3490cb71ad6fe5ff0697c", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170:8989/v2", "region": "RegionOne"}], "id": "00c00313624d4c74aeaa55285e2c553d", "type": "workflowv2", "name": "mistral"}, {"endpoints": [{"id": "aafc7809d8a943d39d20490442ed87fa", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/compute/v2/5af8bd4dd4ed4285ab1d45a95833cc67", "region": "RegionOne"}], "id": "131f57b38d7e4874a18446ab50f3f37b", "type": "compute_legacy", "name": "nova_legacy"}, {"endpoints": [{"id": "e1cd2199468a4486a4df2ffe884b9026", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:12347/v1", "region": "RegionOne"}], "id": "4dc58229363a4e5fa3d863357554678b", "type": "maintenance", "name": "fenix"}, {"endpoints": [], "id": "53b114aa4c2b4cf7b642ef99e767e58c", "type": "kuryr-kubernetes", "name": "kuryr-kubernetes"}, {"endpoints": [{"id": "1156b12e11a04ac2ab4a674976e8bb3e", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170/metric", "region": "RegionOne"}, {"id": "191a35e87d824e72819c28790d6dac8d", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170/metric", "region": "RegionOne"}, {"id": "99016e127b7d4f8483636f5531d994c9", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/metric", "region": "RegionOne"}], "id": "5d483e864b484f76a46266dc5640386b", "type": "metric", "name": "gnocchi"}, {"endpoints": [{"id": "d5ce793eee434288901795720538f811", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/volume/v3/5af8bd4dd4ed4285ab1d45a95833cc67", "region": "RegionOne"}], "id": "5e5f3dc6efa545569f67f453a05ac234", "type": "block-storage", "name": "cinder"}, {"endpoints": [{"id": "6ed501fde45047fe9a3684cc791df953", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/load-balancer", "region": "RegionOne"}], "id": "8b06952a46f3448f9e88daccee3212a9", "type": "load-balancer", "name": "octavia"}, {"endpoints": [{"id": "548133af931b4c0ea8d015dbb67d4388", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170/identity", "region": "RegionOne"}, {"id": "58f0b35802f442f4997318017a37cae9", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170/identity", "region": "RegionOne"}, {"id": "c062a6ce0ab54ee699b863b38e15c50a", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/identity", "region": "RegionOne"}], "id": "8ee29bc9aa6d4ddda69f7810b0c52ff5", "type": "identity", "name": "keystone"}, {"endpoints": [{"id": "7fdd1dac28874280928e6c9313b4a415", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/heat-api-cfn/v1", "region": "RegionOne"}], "id": "9605cce5cdad422f8934c891ac840fa7", "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"id": "53ed393173944da3bfac9d482907b65e", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170:9890/", "region": "RegionOne"}, {"id": "d6891cda1327453aa28155fd18e8596e", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170:9890/", "region": "RegionOne"}, {"id": "fef7c489ad544e708d9c85e4a801e344", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:9890/", "region": "RegionOne"}], "id": "a2c67888fc7a4f55a4001cd807293daf", "type": "nfv-orchestration", "name": "tacker"}, {"endpoints": [{"id": "413321647af94f2fb948e59c76bc2b87", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/placement", "region": "RegionOne"}], "id": "aa649b2a9f8644a184fd6857400328ab", "type": "placement", "name": "placement"}, {"endpoints": [{"id": "671a41088c4841d18c58db9ac8a97314", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:9696/networking", "region": "RegionOne"}], "id": "b1abe9867d07457dbc7c84f37906300a", "type": "network", "name": "neutron"}, {"endpoints": [{"id": "ba3d670defb748a1b23a4697a7998fb7", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/volume/v3/5af8bd4dd4ed4285ab1d45a95833cc67", "region": "RegionOne"}], "id": "b481211f6e5742f1913148ab157259ee", "type": "volumev3", "name": "cinderv3"}, {"endpoints": [{"id": "7eca8bcad7df40cda721a960a838f908", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/heat-api/v1/5af8bd4dd4ed4285ab1d45a95833cc67", "region": "RegionOne"}], "id": "c7c437d0564f428db112516273ca2c0b", "type": "orchestration", "name": "heat"}, {"endpoints": [{"id": "2be3a59b29c04cf7a359ec8b973d334a", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170/key-manager", "region": "RegionOne"}, {"id": "4258ac8e29084b5a82a48e55b2189284", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170/key-manager", "region": "RegionOne"}, {"id": "d463ed0ea12a4b44974b9239d2c14a49", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/key-manager", "region": "RegionOne"}], "id": "d411db3bd28a44f7b7c0ae53d3f5bb7b", "type": "key-manager", "name": "barbican"}, {"endpoints": [{"id": "05dea080ccc8493b9aa6a22bfe9d7b2b", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/compute/v2.1", "region": "RegionOne"}], "id": "d69f1f3988ee4809a9bb496f4f312bbd", "type": "compute", "name": "nova"}, {"endpoints": [{"id": "86e8d9e1998b4b9caf503dc58fc1297a", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/reservation/v1", "region": "RegionOne"}], "id": "d81b4911762a4c419f3816c36adcdac1", "type": "reservation", "name": "blazar"}, {"endpoints": [{"id": "0b0195a6580d48bf94eed97a35603756", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170:8042", "region": "RegionOne"}, {"id": "67d676a732bb4c67abcdc5f433e5b3aa", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:8042", "region": "RegionOne"}, {"id": "f753f73beed8463fa3f594c29911c332", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170:8042", "region": "RegionOne"}], "id": "ddd00c0c78b448438bb925776fdbb350", "type": "alarming", "name": "aodh"}, {"endpoints": [{"id": "a39c85e31b3446239f958cc96c634216", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/image", "region": "RegionOne"}], "id": "fe0a0e3590fa4fa69f395bcdc47f1241", "type": "image", "name": "glance"}]}}
# Set ``X-Subject-Token`` to environment variables as ``TOKEN``.
$ TOKEN=gAAAAABkNlxENR1WGpfgAe8g2Z4z5lCtwCsfUs5GTsg9mvYTMbG7S8HPIZep0vAGUnoPTj0_IYgMP-W1Y0vCDmWFQH7CSq1XWv3qNMd4aFnclk5sHuP1s0JtHSls7IQMM6zbn-FBYUSWTc9d783OSxYKXWqf3qo-CfFjPwrkmNzfkzgtlogkeA4
VIM¶
Register OpenStack VIM (Virtualized Infrastructure Manager) by following procedure below.
Prepare VIM config file, please change the parameters to suit your environment.
Sample config file:
$ cat vim_config.yaml auth_url: 'http://192.168.121.170/identity' username: 'admin' password: 'devstack' project_name: 'admin' project_domain_name: 'Default' user_domain_name: 'Default' cert_verify: 'False'
Register VIM to Tacker by running following command.
via CLI command:
$ openstack vim register --config-file vim_config.yaml vim-openstack
via API:
$ TACKER_ENDPOINT=http://192.168.121.170:9890 $ OS_ENDPOINT=https://192.168.121.170/identity $ curl -g -i -X POST ${TACKER_ENDPOINT}/v1.0/vims \ -H "Accept: application/json" -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" \ -d '{"vim": {"auth_url": "'${OS_ENDPOINT}'", "type": "openstack", "vim_project": {"name": "admin", "project_domain_name": "Default"}, "auth_cred": {"username": "admin", "password": "devstack", "user_domain_name": "Default", "cert_verify": "False"}, "name": "vim-openstack", "is_default": false}}'
Check the registered VIM status is
REACHABLE
.via CLI command:
$ openstack vim list +--------------------------------------+----------------+----------------------------------+------------+------------+-----------+ | ID | Name | Tenant_id | Type | Is Default | Status | +--------------------------------------+----------------+----------------------------------+------------+------------+-----------+ | d8d886e4-fd98-4493-81e2-0e2b9991d629 | vim-openstack | a51290751e094e608ad1e5e251b8cd39 | openstack | True | REACHABLE | +--------------------------------------+----------------+----------------------------------+------------+------------+-----------+
via API:
$ curl -g -X GET ${TACKER_ENDPOINT}/v1.0/vims \ -H "Accept: application/json" -H "X-Auth-Token: $TOKEN" \ | jq -r '.vims[] | .id + ": " + .status' d8d886e4-fd98-4493-81e2-0e2b9991d629: REACHABLE
VNF Package¶
Create and upload the VNF Package that you want to deploy by following procedure below.
Prepare VNF Package. The sample VNF Package used in this guide is stored in
o2/tacker/samples/packages/vnf
directory.$ git clone https://gerrit.o-ran-sc.org/r/smo/o2 $ cd o2/tacker/samples/packages/vnf $ ls BaseHOT Definitions Files input_param.json TOSCA-Metadata UserData $ wget -P Files/images https://opendev.org/openstack/tacker/raw/branch/master/tacker/tests/etc/samples/etsi/nfv/common/Files/images/cirros-0.5.2-x86_64-disk.img $ zip sample_vnf_package.zip -r BaseHOT/ Definitions/ Files/ TOSCA-Metadata/ UserData/
About details to prepare VNF Package, please refer to Prepare VNF Package.
Create and Upload VNF Package.
via CLI command:
$ openstack vnf package create +-------------------+-------------------------------------------------------------------------------------------------+ | Field | Value | +-------------------+-------------------------------------------------------------------------------------------------+ | ID | 9f10134f-90ae-4e71-bfdc-de6593552de8 | | Links | { | | | "self": { | | | "href": "/vnfpkgm/v1/vnf_packages/9f10134f-90ae-4e71-bfdc-de6593552de8" | | | }, | | | "packageContent": { | | | "href": "/vnfpkgm/v1/vnf_packages/9f10134f-90ae-4e71-bfdc-de6593552de8/package_content" | | | } | | | } | | Onboarding State | CREATED | | Operational State | DISABLED | | Usage State | NOT_IN_USE | | User Defined Data | {} | +-------------------+-------------------------------------------------------------------------------------------------+ $ openstack vnf package upload --path sample_vnf_package.zip 9f10134f-90ae-4e71-bfdc-de6593552de8 Upload request for VNF package 9f10134f-90ae-4e71-bfdc-de6593552de8 has been accepted.
via API:
$ VNFP_ID=$(curl -s -X POST ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" -d '{}' | jq -r '.id') $ VNFP_CONTENTS=./sample_vnf_package.zip $ curl -i -X PUT ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages/$VNFP_ID/package_content \ -H "Content-type: application/zip" -H "X-Auth-Token:$TOKEN" -H "Accept:application/zip" \ -F vnf_package_content=@${VNFP_CONTENTS}
Deployment Procedure¶
Create¶
Create a VNF Instance by specifying the VNFD ID. The VNFD ID is the value defined in the VNFD file and can be found in the openstack vnf package show command.
via CLI command:
$ openstack vnflcm create b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 +-----------------------------+------------------------------------------------------------------------------------------------------------------+ | Field | Value | +-----------------------------+------------------------------------------------------------------------------------------------------------------+ | ID | fba5bda0-0b52-4d80-bffb-709200baf1e3 | | Instantiation State | NOT_INSTANTIATED | | Links | { | | | "self": { | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/fba5bda0-0b52-4d80-bffb-709200baf1e3" | | | }, | | | "instantiate": { | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/fba5bda0-0b52-4d80-bffb-709200baf1e3/instantiate" | | | } | | | } | | VNF Configurable Properties | | | VNF Instance Description | None | | VNF Instance Name | vnf-fba5bda0-0b52-4d80-bffb-709200baf1e3 | | VNF Product Name | Sample VNF | | VNF Provider | Company | | VNF Software Version | 1.0 | | VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 | | VNFD Version | 1.0 | | vnfPkgId | | +-----------------------------+------------------------------------------------------------------------------------------------------------------+
via API:
$ VNFD_ID=$(curl -s -X GET ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages/$VNFP_ID \ -H "X-Auth-Token:$TOKEN" | jq -r '.vnfdId') $ VNF_INST_ID=$(curl -sS -X POST ${TACKER_ENDPOINT}/vnflcm/v1/vnf_instances \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" \ -d '{ "vnfdId": "'$VNFD_ID'"}' | jq -r '.id')
Instantiate¶
Instantiate a VNF by specifying the ID of the created VNF Instance and a file path of input parameters.
Note
Please change the parameters in input_param.json
to suit your environment.
$ cat input_param.json
{
"flavourId": "simple",
"extVirtualLinks": [
{
"id": "test1",
"resourceId": "0e1cc46a-6808-4738-8b84-9e99a775c9eb",
"extCps": [
{
"cpdId": "CP1",
"cpConfig": [
{
"cpProtocolData": [
{
"layerProtocol": "IP_OVER_ETHERNET",
"ipOverEthernet": {
"ipAddresses": [
{
"type": "IPV4",
"numDynamicAddresses": 1,
"subnetId": "309614e6-4aab-4424-977f-fd9c8dfe493e"
}
]
}
}
]
}
]
}
]
}
],
"vimConnectionInfo": [
{
"id": "e24f9796-a8e9-4cb0-85ce-5920dcddafa1",
"vimId": "d8d886e4-fd98-4493-81e2-0e2b9991d629",
"vimType": "openstack"
}
],
"additionalParams": {
"lcm-operation-user-data": "./UserData/lcm_user_data.py",
"lcm-operation-user-data-class": "SampleUserData"
}
}
via CLI command:
$ openstack vnflcm instantiate b0915924-7e04-4c16-b229-d3dfcc366eee input_param.json Instantiate request for VNF Instance b0915924-7e04-4c16-b229-d3dfcc366eee has been accepted.
via API:
$ curl -i -X POST ${TACKER_ENDPOINT}/vnflcm/v1/vnf_instances/$VNF_INST_ID/instantiate \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" \ -d @./input_param.json
You can verify that the deployment was successful in the following ways:
Verify that the VNF Instance displayed by openstack vnflcm show command is as follows:
Instantiation State
becameINSTANTIATED
.Deployed resource information is stored in
vnfcResourceInfo
ofInstantiated Vnf Info
.via CLI command:
$ openstack vnflcm show fba5bda0-0b52-4d80-bffb-709200baf1e3 +-----------------------------+----------------------------------------------------------------------------------------------------------------------+ | Field | Value | +-----------------------------+----------------------------------------------------------------------------------------------------------------------+ | ID | fba5bda0-0b52-4d80-bffb-709200baf1e3 | | Instantiated Vnf Info | { | | | "flavourId": "simple", | | | "vnfState": "STARTED", | | | "extCpInfo": [ | | | { | | | "id": "4e9cda91-f625-4790-8efb-273b3fbd03a1", | | | "cpdId": "CP1", | | | "extLinkPortId": null, | | | "associatedVnfcCpId": "65676b39-1e80-435f-997d-217963d25298", | | | "cpProtocolInfo": [ | | | { | | | "layerProtocol": "IP_OVER_ETHERNET", | | | "ipOverEthernet": { | | | "macAddress": null, | | | "ipAddresses": [ | | | { | | | "type": "IPV4", | | | "subnetId": "309614e6-4aab-4424-977f-fd9c8dfe493e", | | | "isDynamic": true, | | | "addresses": [] | | | } | | | ] | | | } | | | } | | | ] | | | } | | | ], | | | "extVirtualLinkInfo": [ | | | { | | | "id": "test1", | | | "resourceHandle": { | | | "vimConnectionId": null, | | | "resourceId": "0e1cc46a-6808-4738-8b84-9e99a775c9eb", | | | "vimLevelResourceType": null | | | } | | | } | | | ], | | | "vnfcResourceInfo": [ | | | { | | | "id": "65676b39-1e80-435f-997d-217963d25298", | | | "vduId": "VDU1", | | | "computeResource": { | | | "vimConnectionId": "d8d886e4-fd98-4493-81e2-0e2b9991d629", | | | "resourceId": "0f0ee6b9-cf6c-41c7-a36c-78d41fcba99c", | | | "vimLevelResourceType": "OS::Nova::Server" | | | }, | | | "storageResourceIds": [], | | | "vnfcCpInfo": [ | | | { | | | "id": "a3da58ce-039d-42ee-9569-a0e2a9adf9bb", | | | "cpdId": "CP1", | | | "vnfExtCpId": null, | | | "vnfLinkPortId": "d61dcdf1-d5c6-4add-8b0f-0095b00908cd", | | | "cpProtocolInfo": [ | | | { | | | "layerProtocol": "IP_OVER_ETHERNET", | | | "ipOverEthernet": { | | | "macAddress": null, | | | "ipAddresses": [ | | | { | | | "type": "IPV4", | | | "subnetId": "309614e6-4aab-4424-977f-fd9c8dfe493e", | | | "isDynamic": true, | | | "addresses": [] | | | } | | | ] | | | } | | | } | | | ] | | | } | | | ] | | | } | | | ], | | | "vnfVirtualLinkResourceInfo": [ | | | { | | | "id": "006531d5-7bb9-472d-9243-7dd415ca9839", | | | "vnfVirtualLinkDescId": "internalVL1", | | | "networkResource": { | | | "vimConnectionId": null, | | | "resourceId": "", | | | "vimLevelResourceType": null | | | }, | | | "vnfLinkPorts": [ | | | { | | | "id": "11d2a97d-884d-4943-9539-bc6c8e4e9e2b", | | | "resourceHandle": { | | | "vimConnectionId": "d8d886e4-fd98-4493-81e2-0e2b9991d629", | | | "resourceId": "601c9ce5-91df-4636-9fc3-0ae979781d9a", | | | "vimLevelResourceType": "OS::Neutron::Port" | | | }, | | | "cpInstanceId": "a3da58ce-039d-42ee-9569-a0e2a9adf9bb" | | | } | | | ] | | | }, | | | { | | | "id": "3a9607a4-0d5a-42da-aca3-2c471544ee86", | | | "vnfVirtualLinkDescId": "test1", | | | "networkResource": { | | | "vimConnectionId": null, | | | "resourceId": "0e1cc46a-6808-4738-8b84-9e99a775c9eb", | | | "vimLevelResourceType": "OS::Neutron::Net" | | | }, | | | "vnfLinkPorts": [ | | | { | | | "id": "d61dcdf1-d5c6-4add-8b0f-0095b00908cd", | | | "resourceHandle": { | | | "vimConnectionId": null, | | | "resourceId": "", | | | "vimLevelResourceType": null | | | }, | | | "cpInstanceId": "a3da58ce-039d-42ee-9569-a0e2a9adf9bb" | | | } | | | ] | | | } | | | ], | | | "vnfcInfo": [ | | | { | | | "id": "341f2d8c-b53f-4d4b-b7f2-2f1726355803", | | | "vduId": "VDU1", | | | "vnfcState": "STARTED" | | | } | | | ], | | | "additionalParams": { | | | "lcm-operation-user-data": "./UserData/lcm_user_data.py", | | | "lcm-operation-user-data-class": "SampleUserData" | | | } | | | } | | Instantiation State | INSTANTIATED | | Links | { | | | "self": { | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/fba5bda0-0b52-4d80-bffb-709200baf1e3" | | | }, | | | "terminate": { | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/fba5bda0-0b52-4d80-bffb-709200baf1e3/terminate" | | | }, | | | "heal": { | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/fba5bda0-0b52-4d80-bffb-709200baf1e3/heal" | | | }, | | | "changeExtConn": { | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/fba5bda0-0b52-4d80-bffb-709200baf1e3/change_ext_conn" | | | } | | | } | | VIM Connection Info | [ | | | { | | | "id": "e24f9796-a8e9-4cb0-85ce-5920dcddafa1", | | | "vimId": "d8d886e4-fd98-4493-81e2-0e2b9991d629", | | | "vimType": "openstack", | | | "interfaceInfo": {}, | | | "accessInfo": {}, | | | "extra": {} | | | } | | | ] | | VNF Configurable Properties | | | VNF Instance Description | None | | VNF Instance Name | vnf-fba5bda0-0b52-4d80-bffb-709200baf1e3 | | VNF Product Name | Sample VNF | | VNF Provider | Company | | VNF Software Version | 1.0 | | VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 | | VNFD Version | 1.0 | | vnfPkgId | | +-----------------------------+----------------------------------------------------------------------------------------------------------------------+
via API:
$ curl -X GET ${TACKER_ENDPOINT}/vnflcm/v1/vnf_instances/$VNF_INST_ID \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" \ | jq -r '{ instantiationState: .instantiationState, vnfcResourceInfo: .instantiatedVnfInfo.vnfcResourceInfo }' { "instantiationState": "INSTANTIATED", "vnfcResourceInfo": [ { "id": "df202937-2bb8-40a9-8be0-a8aa5e2ec0ae", "vduId": "VDU1", "computeResource": { "vimConnectionId": "d8d886e4-fd98-4493-81e2-0e2b9991d629", "resourceId": "0f0ee6b9-cf6c-41c7-a36c-78d41fcba99c", "vimLevelResourceType": "OS::Nova::Server" }, "storageResourceIds": [], "vnfcCpInfo": [ { "id": "a3da58ce-039d-42ee-9569-a0e2a9adf9bb", "cpdId": "CP1", "vnfExtCpId": null, "vnfLinkPortId": "d61dcdf1-d5c6-4add-8b0f-0095b00908cd", "cpProtocolInfo": [ { "layerProtocol": "IP_OVER_ETHERNET", "ipOverEthernet": { "macAddress": null, "ipAddresses": [ { "type": "IPV4", "subnetId": "309614e6-4aab-4424-977f-fd9c8dfe493e", "isDynamic": true, "addresses": [] } ] } } ] } ] } ] }
Verify the VM created successfully by openstack stack list/show command or OpenStack Dashboard.
Terminate¶
Terminate a VNF by specifying the VNF Instance ID.
via CLI command:
$ openstack vnflcm terminate fba5bda0-0b52-4d80-bffb-709200baf1e3 Terminate request for VNF Instance 'fba5bda0-0b52-4d80-bffb-709200baf1e3' has been accepted.
via API:
$ curl -i -X POST ${TACKER_ENDPOINT}/vnflcm/v1/vnf_instances/$VNF_INST_ID/terminate \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" \ -d '{"terminationType": "FORCEFUL"}'
How to deploy CNF Deployment¶
This user guide shows how to deploy CNF (Container Network Function) using Helm via Tacker. See the ETSI NFV-SOL CNF Deployment by Helm chart for the original procedure.
Note
This document focuses on some operations. See the Tacker Use Case Guide or API Reference for other operations.
Prerequisites¶
Credentials Setting¶
To use Tacker CLI, you need to configure the credentials, please change the username
and projectname
to be executed according to your environment.
$ source ${devstack_dir}/openrc admin admin
If you want to access Tacker via API, you need to get auth token by following procedure below.
# Create request body for issuing access token.
$ vi get_token.json
$ cat get_token.json
{
"auth": {
"identity": {
"methods": ["password"],
"password": {
"user": {
"domain": {
"name": "Default"
},
"name": "admin",
"password": "devstack"
}
}
},
"scope": {
"project": {
"domain": {
"name":"Default"
},
"name":"admin"
}
}
}
}
# Issue auth token for accessing via API.
$ curl -i -X POST -H "Content-Type: application/json" -d @./get_token.json http://192.168.121.170/identity/v3/auth/tokens
HTTP/1.1 201 CREATED
Date: Wed, 12 Apr 2023 07:22:44 GMT
Server: Apache/2.4.41 (Ubuntu)
Content-Type: application/json
Content-Length: 7469
X-Subject-Token: gAAAAABkNlxENR1WGpfgAe8g2Z4z5lCtwCsfUs5GTsg9mvYTMbG7S8HPIZep0vAGUnoPTj0_IYgMP-W1Y0vCDmWFQH7CSq1XWv3qNMd4aFnclk5sHuP1s0JtHSls7IQMM6zbn-FBYUSWTc9d783OSxYKXWqf3qo-CfFjPwrkmNzfkzgtlogkeA4
Vary: X-Auth-Token
x-openstack-request-id: req-e94aa763-9578-424b-affb-7ccab80db72c
Connection: close
{"token": {"methods": ["password"], "user": {"domain": {"id": "default", "name": "Default"}, "id": "3e2f3db203e347bfa2197f8fdd038f39", "name": "admin", "password_expires_at": null}, "audit_ids": ["1pgGosVvR4azhw29woKvDw"], "expires_at": "2023-04-12T08:22:44.000000Z", "issued_at": "2023-04-12T07:22:44.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "5af8bd4dd4ed4285ab1d45a95833cc67", "name": "admin"}, "is_domain": false, "roles": [{"id": "a039c220711049e0b77eac89a1504a81", "name": "reader"}, {"id": "57051bcc1fc24eb4875852a8ab32eae7", "name": "member"}, {"id": "029ea703a2534199a412b18cc5bfa31d", "name": "admin"}], "catalog": [{"endpoints": [{"id": "29307c3ec2f94553acbd7682e32602ba", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:8989/v2", "region": "RegionOne"}, {"id": "45e5c5f2d4ce4841a980e29e6d3713f7", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170:8989/v2", "region": "RegionOne"}, {"id": "8d79900575e3490cb71ad6fe5ff0697c", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170:8989/v2", "region": "RegionOne"}], "id": "00c00313624d4c74aeaa55285e2c553d", "type": "workflowv2", "name": "mistral"}, {"endpoints": [{"id": "aafc7809d8a943d39d20490442ed87fa", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/compute/v2/5af8bd4dd4ed4285ab1d45a95833cc67", "region": "RegionOne"}], "id": "131f57b38d7e4874a18446ab50f3f37b", "type": "compute_legacy", "name": "nova_legacy"}, {"endpoints": [{"id": "e1cd2199468a4486a4df2ffe884b9026", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:12347/v1", "region": "RegionOne"}], "id": "4dc58229363a4e5fa3d863357554678b", "type": "maintenance", "name": "fenix"}, {"endpoints": [], "id": "53b114aa4c2b4cf7b642ef99e767e58c", "type": "kuryr-kubernetes", "name": "kuryr-kubernetes"}, {"endpoints": [{"id": "1156b12e11a04ac2ab4a674976e8bb3e", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170/metric", "region": "RegionOne"}, {"id": "191a35e87d824e72819c28790d6dac8d", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170/metric", "region": "RegionOne"}, {"id": "99016e127b7d4f8483636f5531d994c9", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/metric", "region": "RegionOne"}], "id": "5d483e864b484f76a46266dc5640386b", "type": "metric", "name": "gnocchi"}, {"endpoints": [{"id": "d5ce793eee434288901795720538f811", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/volume/v3/5af8bd4dd4ed4285ab1d45a95833cc67", "region": "RegionOne"}], "id": "5e5f3dc6efa545569f67f453a05ac234", "type": "block-storage", "name": "cinder"}, {"endpoints": [{"id": "6ed501fde45047fe9a3684cc791df953", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/load-balancer", "region": "RegionOne"}], "id": "8b06952a46f3448f9e88daccee3212a9", "type": "load-balancer", "name": "octavia"}, {"endpoints": [{"id": "548133af931b4c0ea8d015dbb67d4388", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170/identity", "region": "RegionOne"}, {"id": "58f0b35802f442f4997318017a37cae9", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170/identity", "region": "RegionOne"}, {"id": "c062a6ce0ab54ee699b863b38e15c50a", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/identity", "region": "RegionOne"}], "id": "8ee29bc9aa6d4ddda69f7810b0c52ff5", "type": "identity", "name": "keystone"}, {"endpoints": [{"id": "7fdd1dac28874280928e6c9313b4a415", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/heat-api-cfn/v1", "region": "RegionOne"}], "id": "9605cce5cdad422f8934c891ac840fa7", "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"id": "53ed393173944da3bfac9d482907b65e", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170:9890/", "region": "RegionOne"}, {"id": "d6891cda1327453aa28155fd18e8596e", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170:9890/", "region": "RegionOne"}, {"id": "fef7c489ad544e708d9c85e4a801e344", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:9890/", "region": "RegionOne"}], "id": "a2c67888fc7a4f55a4001cd807293daf", "type": "nfv-orchestration", "name": "tacker"}, {"endpoints": [{"id": "413321647af94f2fb948e59c76bc2b87", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/placement", "region": "RegionOne"}], "id": "aa649b2a9f8644a184fd6857400328ab", "type": "placement", "name": "placement"}, {"endpoints": [{"id": "671a41088c4841d18c58db9ac8a97314", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:9696/networking", "region": "RegionOne"}], "id": "b1abe9867d07457dbc7c84f37906300a", "type": "network", "name": "neutron"}, {"endpoints": [{"id": "ba3d670defb748a1b23a4697a7998fb7", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/volume/v3/5af8bd4dd4ed4285ab1d45a95833cc67", "region": "RegionOne"}], "id": "b481211f6e5742f1913148ab157259ee", "type": "volumev3", "name": "cinderv3"}, {"endpoints": [{"id": "7eca8bcad7df40cda721a960a838f908", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/heat-api/v1/5af8bd4dd4ed4285ab1d45a95833cc67", "region": "RegionOne"}], "id": "c7c437d0564f428db112516273ca2c0b", "type": "orchestration", "name": "heat"}, {"endpoints": [{"id": "2be3a59b29c04cf7a359ec8b973d334a", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170/key-manager", "region": "RegionOne"}, {"id": "4258ac8e29084b5a82a48e55b2189284", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170/key-manager", "region": "RegionOne"}, {"id": "d463ed0ea12a4b44974b9239d2c14a49", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/key-manager", "region": "RegionOne"}], "id": "d411db3bd28a44f7b7c0ae53d3f5bb7b", "type": "key-manager", "name": "barbican"}, {"endpoints": [{"id": "05dea080ccc8493b9aa6a22bfe9d7b2b", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/compute/v2.1", "region": "RegionOne"}], "id": "d69f1f3988ee4809a9bb496f4f312bbd", "type": "compute", "name": "nova"}, {"endpoints": [{"id": "86e8d9e1998b4b9caf503dc58fc1297a", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/reservation/v1", "region": "RegionOne"}], "id": "d81b4911762a4c419f3816c36adcdac1", "type": "reservation", "name": "blazar"}, {"endpoints": [{"id": "0b0195a6580d48bf94eed97a35603756", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170:8042", "region": "RegionOne"}, {"id": "67d676a732bb4c67abcdc5f433e5b3aa", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:8042", "region": "RegionOne"}, {"id": "f753f73beed8463fa3f594c29911c332", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170:8042", "region": "RegionOne"}], "id": "ddd00c0c78b448438bb925776fdbb350", "type": "alarming", "name": "aodh"}, {"endpoints": [{"id": "a39c85e31b3446239f958cc96c634216", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/image", "region": "RegionOne"}], "id": "fe0a0e3590fa4fa69f395bcdc47f1241", "type": "image", "name": "glance"}]}}
# Set ``X-Subject-Token`` to environment variables as ``TOKEN``.
$ TOKEN=gAAAAABkNlxENR1WGpfgAe8g2Z4z5lCtwCsfUs5GTsg9mvYTMbG7S8HPIZep0vAGUnoPTj0_IYgMP-W1Y0vCDmWFQH7CSq1XWv3qNMd4aFnclk5sHuP1s0JtHSls7IQMM6zbn-FBYUSWTc9d783OSxYKXWqf3qo-CfFjPwrkmNzfkzgtlogkeA4
VIM¶
Register Kubernetes VIM (Virtualized Infrastructure Manager) by following procedure below.
Prepare VIM config file, please change the parameters to suit your environment. If you get bearer_token via INF O2 service, follow the “Use Kubernetes Control Client through O2 DMS profile” section of INF O2 Service Userguide.
Sample config file:
$ cat vim_config_k8s.yaml auth_url: "https://192.168.121.170:6443" project_name: "default" bearer_token: "eyJhbGciOiJSUzI1NiIsImtpZCI6InZQOGs5bjhKdExWVkZiRU5reVZRdEtBS0pnYXJFemROcElKNFpIdEFtMXMifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJhZG1pbi11c2VyLXRva2VuLTk4am1qIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6ImFkbWluLXVzZXIiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiIzZWJkZmEzZi0wMTA1LTRhN2YtODFjZS1kYjg5ODcxYTBiMDYiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6a3ViZS1zeXN0ZW06YWRtaW4tdXNlciJ9.df_mV4RbsRN6oOS2KnkaKid0cJBAvdpautWnK67R0y8PRSm79Vc02NbUCmai0M4QiIF9gKhqtM0OYB5vZYJJng9vkcSNVWFUv6hA4Tvjw8FnEcGWe7TnWE2q-ZywJYiZNHvToRIgP5EH5UuLACEXu8KeeG56LxL3T2qNsUenUYLYaT6EciwKiy5SaEk3H1BB0zvSff0d_6sPvGCtY4xL_Q1pqqdgeL2lwC7tcivwEyRy3rMp1FBRrWOVdyeybww0XiNfEnYOjFyVSI4ED2n2msIdz_2JoHAnphGO7nslpn3MmkO-K1Mnhk7EKiR0kgHboGXwQlcnjW4Cje77PjumPg" type: "kubernetes"
Register VIM to Tacker by running following command.
via CLI command:
$ openstack vim register --config-file vim_config_k8s.yaml vim-kubernetes
via API:
$ TACKER_ENDPOINT=http://192.168.121.170:9890 $ K8S_ENDPOINT=https://192.168.121.170:6443 $ K8S_TOKEN=eyJhbGciOiJSUzI1NiIsImtpZCI6InZQOGs5bjhKdExWVkZiRU5reVZRdEtBS0pnYXJFemROcElKNFpIdEFtMXMifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJhZG1pbi11c2VyLXRva2VuLTk4am1qIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6ImFkbWluLXVzZXIiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiIzZWJkZmEzZi0wMTA1LTRhN2YtODFjZS1kYjg5ODcxYTBiMDYiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6a3ViZS1zeXN0ZW06YWRtaW4tdXNlciJ9.df_mV4RbsRN6oOS2KnkaKid0cJBAvdpautWnK67R0y8PRSm79Vc02NbUCmai0M4QiIF9gKhqtM0OYB5vZYJJng9vkcSNVWFUv6hA4Tvjw8FnEcGWe7TnWE2q-ZywJYiZNHvToRIgP5EH5UuLACEXu8KeeG56LxL3T2qNsUenUYLYaT6EciwKiy5SaEk3H1BB0zvSff0d_6sPvGCtY4xL_Q1pqqdgeL2lwC7tcivwEyRy3rMp1FBRrWOVdyeybww0XiNfEnYOjFyVSI4ED2n2msIdz_2JoHAnphGO7nslpn3MmkO-K1Mnhk7EKiR0kgHboGXwQlcnjW4Cje77PjumPg $ curl -g -i -X POST ${TACKER_ENDPOINT}/v1.0/vims \ -H "Accept: application/json" -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" \ -d '{"vim": {"auth_url": "'${K8S_ENDPOINT}'", "type": "kubernetes", "vim_project": {"name": "default"}, "auth_cred": {"bearer_token": "'$K8S_TOKEN'"}, "name": "vim-kubernetes", "is_default": true}}'
Check the registered VIM status is
REACHABLE
.via CLI command:
$ openstack vim list +--------------------------------------+----------------+----------------------------------+------------+------------+-----------+ | ID | Name | Tenant_id | Type | Is Default | Status | +--------------------------------------+----------------+----------------------------------+------------+------------+-----------+ | 5a5815fa-bf1d-41f4-a824-3e39bbdcebd0 | vim-kubernetes | a51290751e094e608ad1e5e251b8cd39 | kubernetes | True | REACHABLE | +--------------------------------------+----------------+----------------------------------+------------+------------+-----------+
via API:
$ curl -g -X GET ${TACKER_ENDPOINT}/v1.0/vims \ -H "Accept: application/json" -H "X-Auth-Token: $TOKEN" \ | jq -r '.vims[] | .id + ": " + .status' 5a5815fa-bf1d-41f4-a824-3e39bbdcebd0: REACHABLE
Helm Environment¶
Create an executable environment for Helm CLI by following procedure below.
Install Helm.
$ HELM_VERSION="3.10.3" # Change to version that is compatible with your cluster $ wget -P /tmp https://get.helm.sh/helm-v$HELM_VERSION-linux-amd64.tar.gz $ tar zxf /tmp/helm-v$HELM_VERSION-linux-amd64.tar.gz -C /tmp $ sudo mv /tmp/linux-amd64/helm /usr/local/bin/helm
Create directory to store Helm chart.
$ HELM_CHART_DIR="/var/tacker/helm" $ sudo mkdir -p $HELM_CHART_DIR
Update Helm Connection Information to VIM DB.
$ mysql mysql> use tacker; mysql> update vims set extra=json_object( 'helm_info', '{"masternode_ip": ["127.0.0.1"], "masternode_username": "stack", "masternode_password": "******"}') where id="5a5815fa-bf1d-41f4-a824-3e39bbdcebd0"; mysql> exit
Note
The specified user must meet the following criteria: * User can run Helm CLI commands via SSH. * User can access to masternode_ip via ssh with password. * User can execute sudo mkdir/chown/rm command without password.
VNF Package¶
Create and upload the VNF Package that you want to deploy by following procedure below.
Prepare VNF Package. The sample VNF Package used in this guide is stored in
o2/tacker/samples/packages/cnf
directory.$ git clone https://gerrit.o-ran-sc.org/r/smo/o2 $ cd o2/tacker/samples/packages/cnf $ ls Definitions Files input_param.json TOSCA-Metadata $ zip sample_cnf_package.zip -r Definitions/ Files/ TOSCA-Metadata/
About details to prepare VNF Package, please refer to Prepare VNF Package.
Create and Upload VNF Package.
via CLI command:
$ openstack vnf package create +-------------------+-------------------------------------------------------------------------------------------------+ | Field | Value | +-------------------+-------------------------------------------------------------------------------------------------+ | ID | 1efcf585-3fea-4813-88dd-bbc93692b51a | | Links | { | | | "self": { | | | "href": "/vnfpkgm/v1/vnf_packages/1efcf585-3fea-4813-88dd-bbc93692b51a" | | | }, | | | "packageContent": { | | | "href": "/vnfpkgm/v1/vnf_packages/1efcf585-3fea-4813-88dd-bbc93692b51a/package_content" | | | } | | | } | | Onboarding State | CREATED | | Operational State | DISABLED | | Usage State | NOT_IN_USE | | User Defined Data | {} | +-------------------+-------------------------------------------------------------------------------------------------+ $ openstack vnf package upload --path sample_cnf_package.zip 1efcf585-3fea-4813-88dd-bbc93692b51a Upload request for VNF package 1efcf585-3fea-4813-88dd-bbc93692b51a has been accepted.
via API:
$ VNFP_ID=$(curl -s -X POST ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" -d '{}' | jq -r '.id') $ VNFP_CONTENTS=./sample_cnf_package.zip $ curl -i -X PUT ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages/$VNFP_ID/package_content \ -H "Content-type: application/zip" -H "X-Auth-Token:$TOKEN" -H "Accept:application/zip" \ -F vnf_package_content=@${VNFP_CONTENTS}
Deployment Procedure¶
Create¶
Create a VNF Instance by specifying the VNFD ID. The VNFD ID is the value defined in the VNFD file and can be found in the openstack vnf package show command.
via CLI command:
$ openstack vnflcm create 37391b92-a1d9-44e5-855a-83644cdc3265 +-----------------------------+------------------------------------------------------------------------------------------------------------------+ | Field | Value | +-----------------------------+------------------------------------------------------------------------------------------------------------------+ | ID | b0915924-7e04-4c16-b229-d3dfcc366eee | | Instantiation State | NOT_INSTANTIATED | | Links | { | | | "self": { | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/b0915924-7e04-4c16-b229-d3dfcc366eee" | | | }, | | | "instantiate": { | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/b0915924-7e04-4c16-b229-d3dfcc366eee/instantiate" | | | } | | | } | | VNF Configurable Properties | | | VNF Instance Description | None | | VNF Instance Name | vnf-b0915924-7e04-4c16-b229-d3dfcc366eee | | VNF Product Name | Sample CNF | | VNF Provider | Company | | VNF Software Version | 1.0 | | VNFD ID | 37391b92-a1d9-44e5-855a-83644cdc3265 | | VNFD Version | 1.0 | | vnfPkgId | | +-----------------------------+------------------------------------------------------------------------------------------------------------------+
via API:
$ VNFD_ID=$(curl -s -X GET ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages/$VNFP_ID \ -H "X-Auth-Token:$TOKEN" | jq -r '.vnfdId') $ VNF_INST_ID=$(curl -sS -X POST ${TACKER_ENDPOINT}/vnflcm/v1/vnf_instances \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" \ -d '{ "vnfdId": "'$VNFD_ID'"}' | jq -r '.id')
Instantiate¶
Instantiate a VNF by specifying the ID of the created VNF Instance and a file path of input parameters.
$ cat input_param.json
{
"flavourId": "helmchart",
"additionalParams": {
"namespace": "default",
"use_helm": "true",
"using_helm_install_param": [
{
"exthelmchart": "false",
"helmchartfile_path": "Files/kubernetes/localhelm-0.1.0.tgz",
"helmreleasename": "tacker-test-vdu"
}
],
"helm_replica_values": {
"vdu1_aspect": "replicaCount"
}
},
"vimConnectionInfo": [
{
"id": "742f1fc7-7f00-417d-85a6-d4e788353181",
"vimId": "5a5815fa-bf1d-41f4-a824-3e39bbdcebd0",
"vimType": "kubernetes"
}
]
}
via CLI command:
$ openstack vnflcm instantiate b0915924-7e04-4c16-b229-d3dfcc366eee input_param.json Instantiate request for VNF Instance b0915924-7e04-4c16-b229-d3dfcc366eee has been accepted.
via API:
$ curl -i -X POST ${TACKER_ENDPOINT}/vnflcm/v1/vnf_instances/$VNF_INST_ID/instantiate \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" \ -d @./input_param.json
You can verify that the deployment was successful in the following ways:
Verify that the VNF Instance displayed by the command is as follows:
Instantiation State
becameINSTANTIATED
.Deployed resource information is stored in
vnfcResourceInfo
ofInstantiated Vnf Info
.via CLI command:
$ openstack vnflcm show b0915924-7e04-4c16-b229-d3dfcc366eee +-----------------------------+----------------------------------------------------------------------------------------------------------------------+ | Field | Value | +-----------------------------+----------------------------------------------------------------------------------------------------------------------+ | ID | b0915924-7e04-4c16-b229-d3dfcc366eee | | Instantiated Vnf Info | { | | | "flavourId": "helmchart", | | | "vnfState": "STARTED", | | | "scaleStatus": [ | | | { | | | "aspectId": "vdu1_aspect", | | | "scaleLevel": 0 | | | } | | | ], | | | "extCpInfo": [], | | | "vnfcResourceInfo": [ | | | { | | | "id": "df202937-2bb8-40a9-8be0-a8aa5e2ec0ae", | | | "vduId": "VDU1", | | | "computeResource": { | | | "vimConnectionId": null, | | | "resourceId": "tacker-test-vdu-localhelm-7b5489f949-fzmc5", | | | "vimLevelResourceType": "Deployment" | | | }, | | | "storageResourceIds": [] | | | } | | | ], | | | "additionalParams": { | | | "useHelm": "true", | | | "namespace": "default", | | | "helmReplicaValues": { | | | "vdu1Aspect": "replicaCount" | | | }, | | | "usingHelmInstallParam": [ | | | { | | | "exthelmchart": "false", | | | "helmreleasename": "tacker-test-vdu", | | | "helmchartfilePath": "Files/kubernetes/localhelm-0.1.0.tgz" | | | } | | | ] | | | } | | | } | | Instantiation State | INSTANTIATED | | Links | { | | | "self": { | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/b0915924-7e04-4c16-b229-d3dfcc366eee" | | | }, | | | "terminate": { | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/b0915924-7e04-4c16-b229-d3dfcc366eee/terminate" | | | }, | | | "heal": { | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/b0915924-7e04-4c16-b229-d3dfcc366eee/heal" | | | }, | | | "changeExtConn": { | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/b0915924-7e04-4c16-b229-d3dfcc366eee/change_ext_conn" | | | } | | | } | | VIM Connection Info | [ | | | { | | | "id": "742f1fc7-7f00-417d-85a6-d4e788353181", | | | "vimId": "5a5815fa-bf1d-41f4-a824-3e39bbdcebd0", | | | "vimType": "kubernetes", | | | "interfaceInfo": {}, | | | "accessInfo": {}, | | | "extra": {} | | | } | | | ] | | VNF Configurable Properties | | | VNF Instance Description | None | | VNF Instance Name | vnf-b0915924-7e04-4c16-b229-d3dfcc366eee | | VNF Product Name | Sample CNF | | VNF Provider | Company | | VNF Software Version | 1.0 | | VNFD ID | 37391b92-a1d9-44e5-855a-83644cdc3265 | | VNFD Version | 1.0 | | metadata | namespace=default | | vnfPkgId | | +-----------------------------+----------------------------------------------------------------------------------------------------------------------+
via API:
$ curl -X GET ${TACKER_ENDPOINT}/vnflcm/v1/vnf_instances/$VNF_INST_ID \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" \ | jq -r '{ instantiationState: .instantiationState, vnfcResourceInfo: .instantiatedVnfInfo.vnfcResourceInfo }' { "instantiationState": "INSTANTIATED", "vnfcResourceInfo": [ { "id": "df202937-2bb8-40a9-8be0-a8aa5e2ec0ae", "vduId": "VDU1", "computeResource": { "vimConnectionId": null, "resourceId": "tacker-test-vdu-localhelm-7b5489f949-fzmc5", "vimLevelResourceType": "Deployment" }, "storageResourceIds": [] } ] }
Verify the CNF resources that were actually created as follows:
$ kubectl get deployment NAME READY UP-TO-DATE AVAILABLE AGE tacker-test-vdu-localhelm 1/1 1 1 20s $ kubectl get pod NAME READY STATUS RESTARTS AGE tacker-test-vdu-localhelm-7b5489f949-fzmc5 1/1 Running 0 24s $ helm list NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION tacker-test-vdu default 1 2022-06-29 14:54:32.20990033 +0000 UTC deployed localhelm-0.1.0 1.16.0
Terminate¶
Terminate a VNF by specifying the VNF Instance ID.
via CLI command:
$ openstack vnflcm terminate b0915924-7e04-4c16-b229-d3dfcc366eee Terminate request for VNF Instance 'b0915924-7e04-4c16-b229-d3dfcc366eee' has been accepted.
via API:
$ curl -i -X POST ${TACKER_ENDPOINT}/vnflcm/v1/vnf_instances/$VNF_INST_ID/terminate \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" \ -d '{"terminationType": "FORCEFUL"}'
V2 API¶
How to deploy VNF Deployment (V2 API)¶
This user guide shows how to deploy VNF (Virtualized Network Function) via Tacker. See the ETSI NFV-SOL VNF Deployment for the original procedure.
Note
This document focuses on some operations. See the Tacker Use Case Guide or API Reference for other operations.
Prerequisites¶
Credentials Setting¶
To use Tacker CLI, you need to configure the credentials, please change the username
and projectname
to be executed according to your environment.
$ source ${devstack_dir}/openrc admin admin
If you want to access Tacker via API, you need to get auth token by following procedure below.
# Create request body for issuing access token.
$ vi get_token.json
$ cat get_token.json
{
"auth": {
"identity": {
"methods": ["password"],
"password": {
"user": {
"domain": {
"name": "Default"
},
"name": "admin",
"password": "devstack"
}
}
},
"scope": {
"project": {
"domain": {
"name":"Default"
},
"name":"admin"
}
}
}
}
# Issue auth token for accessing via API.
$ curl -i -X POST -H "Content-Type: application/json" -d @./get_token.json http://192.168.121.170/identity/v3/auth/tokens
HTTP/1.1 201 CREATED
Date: Wed, 12 Apr 2023 07:22:44 GMT
Server: Apache/2.4.41 (Ubuntu)
Content-Type: application/json
Content-Length: 7469
X-Subject-Token: gAAAAABkNlxENR1WGpfgAe8g2Z4z5lCtwCsfUs5GTsg9mvYTMbG7S8HPIZep0vAGUnoPTj0_IYgMP-W1Y0vCDmWFQH7CSq1XWv3qNMd4aFnclk5sHuP1s0JtHSls7IQMM6zbn-FBYUSWTc9d783OSxYKXWqf3qo-CfFjPwrkmNzfkzgtlogkeA4
Vary: X-Auth-Token
x-openstack-request-id: req-e94aa763-9578-424b-affb-7ccab80db72c
Connection: close
{"token": {"methods": ["password"], "user": {"domain": {"id": "default", "name": "Default"}, "id": "3e2f3db203e347bfa2197f8fdd038f39", "name": "admin", "password_expires_at": null}, "audit_ids": ["1pgGosVvR4azhw29woKvDw"], "expires_at": "2023-04-12T08:22:44.000000Z", "issued_at": "2023-04-12T07:22:44.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "5af8bd4dd4ed4285ab1d45a95833cc67", "name": "admin"}, "is_domain": false, "roles": [{"id": "a039c220711049e0b77eac89a1504a81", "name": "reader"}, {"id": "57051bcc1fc24eb4875852a8ab32eae7", "name": "member"}, {"id": "029ea703a2534199a412b18cc5bfa31d", "name": "admin"}], "catalog": [{"endpoints": [{"id": "29307c3ec2f94553acbd7682e32602ba", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:8989/v2", "region": "RegionOne"}, {"id": "45e5c5f2d4ce4841a980e29e6d3713f7", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170:8989/v2", "region": "RegionOne"}, {"id": "8d79900575e3490cb71ad6fe5ff0697c", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170:8989/v2", "region": "RegionOne"}], "id": "00c00313624d4c74aeaa55285e2c553d", "type": "workflowv2", "name": "mistral"}, {"endpoints": [{"id": "aafc7809d8a943d39d20490442ed87fa", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/compute/v2/5af8bd4dd4ed4285ab1d45a95833cc67", "region": "RegionOne"}], "id": "131f57b38d7e4874a18446ab50f3f37b", "type": "compute_legacy", "name": "nova_legacy"}, {"endpoints": [{"id": "e1cd2199468a4486a4df2ffe884b9026", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:12347/v1", "region": "RegionOne"}], "id": "4dc58229363a4e5fa3d863357554678b", "type": "maintenance", "name": "fenix"}, {"endpoints": [], "id": "53b114aa4c2b4cf7b642ef99e767e58c", "type": "kuryr-kubernetes", "name": "kuryr-kubernetes"}, {"endpoints": [{"id": "1156b12e11a04ac2ab4a674976e8bb3e", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170/metric", "region": "RegionOne"}, {"id": "191a35e87d824e72819c28790d6dac8d", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170/metric", "region": "RegionOne"}, {"id": "99016e127b7d4f8483636f5531d994c9", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/metric", "region": "RegionOne"}], "id": "5d483e864b484f76a46266dc5640386b", "type": "metric", "name": "gnocchi"}, {"endpoints": [{"id": "d5ce793eee434288901795720538f811", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/volume/v3/5af8bd4dd4ed4285ab1d45a95833cc67", "region": "RegionOne"}], "id": "5e5f3dc6efa545569f67f453a05ac234", "type": "block-storage", "name": "cinder"}, {"endpoints": [{"id": "6ed501fde45047fe9a3684cc791df953", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/load-balancer", "region": "RegionOne"}], "id": "8b06952a46f3448f9e88daccee3212a9", "type": "load-balancer", "name": "octavia"}, {"endpoints": [{"id": "548133af931b4c0ea8d015dbb67d4388", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170/identity", "region": "RegionOne"}, {"id": "58f0b35802f442f4997318017a37cae9", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170/identity", "region": "RegionOne"}, {"id": "c062a6ce0ab54ee699b863b38e15c50a", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/identity", "region": "RegionOne"}], "id": "8ee29bc9aa6d4ddda69f7810b0c52ff5", "type": "identity", "name": "keystone"}, {"endpoints": [{"id": "7fdd1dac28874280928e6c9313b4a415", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/heat-api-cfn/v1", "region": "RegionOne"}], "id": "9605cce5cdad422f8934c891ac840fa7", "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"id": "53ed393173944da3bfac9d482907b65e", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170:9890/", "region": "RegionOne"}, {"id": "d6891cda1327453aa28155fd18e8596e", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170:9890/", "region": "RegionOne"}, {"id": "fef7c489ad544e708d9c85e4a801e344", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:9890/", "region": "RegionOne"}], "id": "a2c67888fc7a4f55a4001cd807293daf", "type": "nfv-orchestration", "name": "tacker"}, {"endpoints": [{"id": "413321647af94f2fb948e59c76bc2b87", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/placement", "region": "RegionOne"}], "id": "aa649b2a9f8644a184fd6857400328ab", "type": "placement", "name": "placement"}, {"endpoints": [{"id": "671a41088c4841d18c58db9ac8a97314", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:9696/networking", "region": "RegionOne"}], "id": "b1abe9867d07457dbc7c84f37906300a", "type": "network", "name": "neutron"}, {"endpoints": [{"id": "ba3d670defb748a1b23a4697a7998fb7", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/volume/v3/5af8bd4dd4ed4285ab1d45a95833cc67", "region": "RegionOne"}], "id": "b481211f6e5742f1913148ab157259ee", "type": "volumev3", "name": "cinderv3"}, {"endpoints": [{"id": "7eca8bcad7df40cda721a960a838f908", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/heat-api/v1/5af8bd4dd4ed4285ab1d45a95833cc67", "region": "RegionOne"}], "id": "c7c437d0564f428db112516273ca2c0b", "type": "orchestration", "name": "heat"}, {"endpoints": [{"id": "2be3a59b29c04cf7a359ec8b973d334a", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170/key-manager", "region": "RegionOne"}, {"id": "4258ac8e29084b5a82a48e55b2189284", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170/key-manager", "region": "RegionOne"}, {"id": "d463ed0ea12a4b44974b9239d2c14a49", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/key-manager", "region": "RegionOne"}], "id": "d411db3bd28a44f7b7c0ae53d3f5bb7b", "type": "key-manager", "name": "barbican"}, {"endpoints": [{"id": "05dea080ccc8493b9aa6a22bfe9d7b2b", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/compute/v2.1", "region": "RegionOne"}], "id": "d69f1f3988ee4809a9bb496f4f312bbd", "type": "compute", "name": "nova"}, {"endpoints": [{"id": "86e8d9e1998b4b9caf503dc58fc1297a", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/reservation/v1", "region": "RegionOne"}], "id": "d81b4911762a4c419f3816c36adcdac1", "type": "reservation", "name": "blazar"}, {"endpoints": [{"id": "0b0195a6580d48bf94eed97a35603756", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170:8042", "region": "RegionOne"}, {"id": "67d676a732bb4c67abcdc5f433e5b3aa", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:8042", "region": "RegionOne"}, {"id": "f753f73beed8463fa3f594c29911c332", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170:8042", "region": "RegionOne"}], "id": "ddd00c0c78b448438bb925776fdbb350", "type": "alarming", "name": "aodh"}, {"endpoints": [{"id": "a39c85e31b3446239f958cc96c634216", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/image", "region": "RegionOne"}], "id": "fe0a0e3590fa4fa69f395bcdc47f1241", "type": "image", "name": "glance"}]}}
# Set ``X-Subject-Token`` to environment variables as ``TOKEN``.
$ TOKEN=gAAAAABkNlxENR1WGpfgAe8g2Z4z5lCtwCsfUs5GTsg9mvYTMbG7S8HPIZep0vAGUnoPTj0_IYgMP-W1Y0vCDmWFQH7CSq1XWv3qNMd4aFnclk5sHuP1s0JtHSls7IQMM6zbn-FBYUSWTc9d783OSxYKXWqf3qo-CfFjPwrkmNzfkzgtlogkeA4
VNF Package¶
Create and upload the VNF Package that you want to deploy by following procedure below.
Prepare VNF Package. The sample VNF Package used in this guide is stored in
o2/tacker/samples/packages/vnf_v2
directory.$ git clone https://gerrit.o-ran-sc.org/r/smo/o2 $ cd o2/tacker/samples/packages/vnf_v2 $ ls BaseHOT Definitions input_param.json Scripts TOSCA-Metadata $ zip sample_vnf_package_v2.zip -r BaseHOT/ Definitions/ Scripts/ TOSCA-Metadata/
About details to prepare VNF Package, please refer to Prepare VNF Package.
Create and Upload VNF Package.
via CLI command:
$ openstack vnf package create +-------------------+-------------------------------------------------------------------------------------------------+ | Field | Value | +-------------------+-------------------------------------------------------------------------------------------------+ | ID | 18e7b0ec-d006-4b84-8bc5-84f85cfbfff9 | | Links | { | | | "self": { | | | "href": "/vnfpkgm/v1/vnf_packages/18e7b0ec-d006-4b84-8bc5-84f85cfbfff9" | | | }, | | | "packageContent": { | | | "href": "/vnfpkgm/v1/vnf_packages/18e7b0ec-d006-4b84-8bc5-84f85cfbfff9/package_content" | | | } | | | } | | Onboarding State | CREATED | | Operational State | DISABLED | | Usage State | NOT_IN_USE | | User Defined Data | {} | +-------------------+-------------------------------------------------------------------------------------------------+ $ openstack vnf package upload --path sample_vnf_package_v2.zip 18e7b0ec-d006-4b84-8bc5-84f85cfbfff9 Upload request for VNF package 18e7b0ec-d006-4b84-8bc5-84f85cfbfff9 has been accepted.
via API:
$ TACKER_ENDPOINT=http://192.168.121.170:9890 $ VNFP_ID=$(curl -s -X POST ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" -d '{}' | jq -r '.id') $ VNFP_CONTENTS=./sample_vnf_package_v2.zip $ curl -i -X PUT ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages/$VNFP_ID/package_content \ -H "Content-type: application/zip" -H "X-Auth-Token:$TOKEN" -H "Accept:application/zip" \ -F vnf_package_content=@${VNFP_CONTENTS}
Deployment Procedure¶
Create¶
Create a VNF Instance by specifying the VNFD ID. The VNFD ID is the value defined in the VNFD file and can be found in the openstack vnf package show command.
via CLI command:
$ openstack vnflcm create e9214953-47d5-45bd-91d1-502accfbe967 --os-tacker-api-version 2 +-----------------------------+------------------------------------------------------------------------------------------------------------------+ | Field | Value | +-----------------------------+------------------------------------------------------------------------------------------------------------------+ | ID | ae844932-730a-4063-ad1d-7e3f7f9d82d1 | | Instantiation State | NOT_INSTANTIATED | | Links | { | | | "self": { | | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/ae844932-730a-4063-ad1d-7e3f7f9d82d1" | | | }, | | | "instantiate": { | | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/ae844932-730a-4063-ad1d-7e3f7f9d82d1/instantiate" | | | } | | | } | | VNF Configurable Properties | | | VNF Instance Description | | | VNF Instance Name | | | VNF Product Name | Sample VNF | | VNF Provider | Company | | VNF Software Version | 1.0 | | VNFD ID | e9214953-47d5-45bd-91d1-502accfbe967 | | VNFD Version | 1.0 | +-----------------------------+------------------------------------------------------------------------------------------------------------------+
via API:
$ VNFD_ID=$(curl -s -X GET ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages/$VNFP_ID \ -H "X-Auth-Token:$TOKEN" | jq -r '.vnfdId') $ VNF_INST_ID=$(curl -sS -X POST ${TACKER_ENDPOINT}/vnflcm/v2/vnf_instances \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" -H "Version: 2.0.0" \ -d '{ "vnfdId": "'$VNFD_ID'"}' | jq -r '.id')
Instantiate¶
Instantiate a VNF by specifying the ID of the created VNF Instance and a file path of input parameters. V2 API allows you to insert VIM connection information directly into the instantiate input parameters.
Note
Please change the parameters in input_param.json
to suit your environment.
$ cat input_param.json
{
"flavourId": "simple",
"vimConnectionInfo": {
"vim1": {
"accessInfo": {
"username": "admin",
"password": "devstack",
"project": "admin",
"projectDomain": "Default",
"region": "RegionOne",
"userDomain": "Default"
},
"interfaceInfo": {
"endpoint": "http://192.168.121.170/identity"
},
"vimId": "defb2f96-5670-4bef-8036-27bf61267fc1",
"vimType": "ETSINFV.OPENSTACK_KEYSTONE.V_3"
}
}
}
via CLI command:
$ openstack vnflcm instantiate ae844932-730a-4063-ad1d-7e3f7f9d82d1 input_param.json --os-tacker-api-version 2 Instantiate request for VNF Instance ae844932-730a-4063-ad1d-7e3f7f9d82d1 has been accepted.
via API:
$ curl -i -X POST ${TACKER_ENDPOINT}/vnflcm/v2/vnf_instances/$VNF_INST_ID/instantiate \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" -H "Version: 2.0.0" \ -d @./input_param.json
You can verify that the deployment was successful in the following ways:
Verify that the VNF Instance displayed by openstack vnflcm show command is as follows:
Instantiation State
becameINSTANTIATED
.Deployed resource information is stored in
vnfcResourceInfo
ofInstantiated Vnf Info
.via CLI command:
$ openstack vnflcm show ae844932-730a-4063-ad1d-7e3f7f9d82d1 --os-tacker-api-version 2 +-----------------------------+----------------------------------------------------------------------------------------------------------------------+ | Field | Value | +-----------------------------+----------------------------------------------------------------------------------------------------------------------+ | ID | ae844932-730a-4063-ad1d-7e3f7f9d82d1 | | Instantiated Vnf Info | { | | | "flavourId": "simple", | | | "vnfState": "STARTED", | | | "scaleStatus": [ | | | { | | | "aspectId": "VDU1_scale", | | | "scaleLevel": 0 | | | } | | | ], | | | "maxScaleLevels": [ | | | { | | | "aspectId": "VDU1_scale", | | | "scaleLevel": 2 | | | } | | | ], | | | "vnfcResourceInfo": [ | | | { | | | "id": "5f201bdf-671b-4ba8-9c19-35eb9717ea9d", | | | "vduId": "VDU1", | | | "computeResource": { | | | "vimConnectionId": "defb2f96-5670-4bef-8036-27bf61267fc1", | | | "resourceId": "5f201bdf-671b-4ba8-9c19-35eb9717ea9d", | | | "vimLevelResourceType": "OS::Nova::Server" | | | }, | | | "vnfcCpInfo": [ | | | { | | | "id": "VDU1_CP1-5f201bdf-671b-4ba8-9c19-35eb9717ea9d", | | | "cpdId": "VDU1_CP1", | | | "vnfLinkPortId": "09a8a6ab-9a43-4d3a-9cf8-92b18dd74d17" | | | } | | | ], | | | "metadata": { | | | "creation_time": "2023-04-07T09:49:22Z", | | | "stack_id": "vnf-ae844932-730a-4063-ad1d-7e3f7f9d82d1-VDU1_scale_group-4qhp7z3cangj-mc4dbvvk73vc- | | | edjhilnlkdww/de2707cf-f222-4c97-9c29-33404a50df94", | | | "parent_stack_id": "vnf- | | | ae844932-730a-4063-ad1d-7e3f7f9d82d1-VDU1_scale_group-4qhp7z3cangj/3eecd59f-5476-47f5-8135-62debac7499b", | | | "parent_resource_name": "mc4dbvvk73vc", | | | "flavor": "m1.tiny", | | | "image-VDU1": "cirros-0.5.2-x86_64-disk" | | | } | | | }, | | | { | | | "id": "9fcd21b5-301b-44e2-bb25-6bbffee99c26", | | | "vduId": "VDU2", | | | "computeResource": { | | | "vimConnectionId": "defb2f96-5670-4bef-8036-27bf61267fc1", | | | "resourceId": "9fcd21b5-301b-44e2-bb25-6bbffee99c26", | | | "vimLevelResourceType": "OS::Nova::Server" | | | }, | | | "vnfcCpInfo": [ | | | { | | | "id": "VDU2_CP1-9fcd21b5-301b-44e2-bb25-6bbffee99c26", | | | "cpdId": "VDU2_CP1", | | | "vnfLinkPortId": "b0e4a59e-5831-4deb-aaba-fd4d0d02248b" | | | } | | | ], | | | "metadata": { | | | "creation_time": "2023-04-07T09:49:14Z", | | | "stack_id": "vnf-ae844932-730a-4063-ad1d-7e3f7f9d82d1/87e00a91-17d7-496e-b30e-a99af1a6726e", | | | "flavor": "m1.tiny", | | | "image-VDU2": "cirros-0.5.2-x86_64-disk" | | | } | | | } | | | ], | | | "vnfVirtualLinkResourceInfo": [ | | | { | | | "id": "c2688b4d-f444-4a9c-b5d1-e25766082a14", | | | "vnfVirtualLinkDescId": "internalVL3", | | | "networkResource": { | | | "vimConnectionId": "defb2f96-5670-4bef-8036-27bf61267fc1", | | | "resourceId": "c2688b4d-f444-4a9c-b5d1-e25766082a14", | | | "vimLevelResourceType": "OS::Neutron::Net" | | | }, | | | "vnfLinkPorts": [ | | | { | | | "id": "b0e4a59e-5831-4deb-aaba-fd4d0d02248b", | | | "resourceHandle": { | | | "vimConnectionId": "defb2f96-5670-4bef-8036-27bf61267fc1", | | | "resourceId": "b0e4a59e-5831-4deb-aaba-fd4d0d02248b", | | | "vimLevelResourceType": "OS::Neutron::Port" | | | }, | | | "cpInstanceId": "VDU2_CP1-9fcd21b5-301b-44e2-bb25-6bbffee99c26", | | | "cpInstanceType": "VNFC_CP" | | | }, | | | { | | | "id": "09a8a6ab-9a43-4d3a-9cf8-92b18dd74d17", | | | "resourceHandle": { | | | "vimConnectionId": "defb2f96-5670-4bef-8036-27bf61267fc1", | | | "resourceId": "09a8a6ab-9a43-4d3a-9cf8-92b18dd74d17", | | | "vimLevelResourceType": "OS::Neutron::Port" | | | }, | | | "cpInstanceId": "VDU1_CP1-5f201bdf-671b-4ba8-9c19-35eb9717ea9d", | | | "cpInstanceType": "VNFC_CP" | | | } | | | ] | | | } | | | ], | | | "vnfcInfo": [ | | | { | | | "id": "VDU1-5f201bdf-671b-4ba8-9c19-35eb9717ea9d", | | | "vduId": "VDU1", | | | "vnfcResourceInfoId": "5f201bdf-671b-4ba8-9c19-35eb9717ea9d", | | | "vnfcState": "STARTED" | | | }, | | | { | | | "id": "VDU2-9fcd21b5-301b-44e2-bb25-6bbffee99c26", | | | "vduId": "VDU2", | | | "vnfcResourceInfoId": "9fcd21b5-301b-44e2-bb25-6bbffee99c26", | | | "vnfcState": "STARTED" | | | } | | | ], | | | "metadata": { | | | "stack_id": "87e00a91-17d7-496e-b30e-a99af1a6726e" | | | } | | | } | | Instantiation State | INSTANTIATED | | Links | { | | | "self": { | | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/ae844932-730a-4063-ad1d-7e3f7f9d82d1" | | | }, | | | "terminate": { | | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/ae844932-730a-4063-ad1d-7e3f7f9d82d1/terminate" | | | }, | | | "scale": { | | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/ae844932-730a-4063-ad1d-7e3f7f9d82d1/scale" | | | }, | | | "heal": { | | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/ae844932-730a-4063-ad1d-7e3f7f9d82d1/heal" | | | }, | | | "changeExtConn": { | | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/ae844932-730a-4063-ad1d-7e3f7f9d82d1/change_ext_conn" | | | } | | | } | | VIM Connection Info | { | | | "vim1": { | | | "vimId": "defb2f96-5670-4bef-8036-27bf61267fc1", | | | "vimType": "ETSINFV.OPENSTACK_KEYSTONE.V_3", | | | "interfaceInfo": { | | | "endpoint": "http://192.168.121.170/identity" | | | }, | | | "accessInfo": { | | | "region": "RegionOne", | | | "project": "admin", | | | "username": "admin", | | | "userDomain": "Default", | | | "projectDomain": "Default" | | | } | | | } | | | } | | VNF Configurable Properties | | | VNF Instance Description | | | VNF Instance Name | | | VNF Product Name | Sample VNF | | VNF Provider | Company | | VNF Software Version | 1.0 | | VNFD ID | e9214953-47d5-45bd-91d1-502accfbe967 | | VNFD Version | 1.0 | +-----------------------------+----------------------------------------------------------------------------------------------------------------------+
via API:
$ curl -X GET ${TACKER_ENDPOINT}/vnflcm/v2/vnf_instances/$VNF_INST_ID \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" -H "Version: 2.0.0" \ | jq -r '{ instantiationState: .instantiationState, vnfcResourceInfo: .instantiatedVnfInfo.vnfcResourceInfo }' { "instantiationState": "INSTANTIATED", "vnfcResourceInfo": [ { "id": "5f201bdf-671b-4ba8-9c19-35eb9717ea9d", "vduId": "VDU1", "computeResource": { "vimConnectionId": "defb2f96-5670-4bef-8036-27bf61267fc1", "resourceId": "5f201bdf-671b-4ba8-9c19-35eb9717ea9d", "vimLevelResourceType": "OS::Nova::Server" }, "vnfcCpInfo": [ { "id": "VDU1_CP1-5f201bdf-671b-4ba8-9c19-35eb9717ea9d", "cpdId": "VDU1_CP1", "vnfLinkPortId": "09a8a6ab-9a43-4d3a-9cf8-92b18dd74d17" } ], "metadata": { "creation_time": "2023-04-07T09:49:22Z", "stack_id": "vnf-ae844932-730a-4063-ad1d-7e3f7f9d82d1-VDU1_scale_group-4qhp7z3cangj-mc4dbvvk73vc-edjhilnlkdww/de2707cf-f222-4c97-9c29-33404a50df94", "parent_stack_id": "vnf-ae844932-730a-4063-ad1d-7e3f7f9d82d1-VDU1_scale_group-4qhp7z3cangj/3eecd59f-5476-47f5-8135-62debac7499b", "parent_resource_name": "mc4dbvvk73vc", "flavor": "m1.tiny", "image-VDU1": "cirros-0.5.2-x86_64-disk" } }, { "id": "9fcd21b5-301b-44e2-bb25-6bbffee99c26", "vduId": "VDU2", "computeResource": { "vimConnectionId": "defb2f96-5670-4bef-8036-27bf61267fc1", "resourceId": "9fcd21b5-301b-44e2-bb25-6bbffee99c26", "vimLevelResourceType": "OS::Nova::Server" }, "vnfcCpInfo": [ { "id": "VDU2_CP1-9fcd21b5-301b-44e2-bb25-6bbffee99c26", "cpdId": "VDU2_CP1", "vnfLinkPortId": "b0e4a59e-5831-4deb-aaba-fd4d0d02248b" } ], "metadata": { "creation_time": "2023-04-07T09:49:14Z", "stack_id": "vnf-ae844932-730a-4063-ad1d-7e3f7f9d82d1/87e00a91-17d7-496e-b30e-a99af1a6726e", "flavor": "m1.tiny", "image-VDU2": "cirros-0.5.2-x86_64-disk" } } ], }
Verify the VM created successfully by openstack stack list/show command or OpenStack Dashboard.
Terminate¶
Terminate a VNF by specifying the VNF Instance ID.
via CLI command:
$ openstack vnflcm terminate fba5bda0-0b52-4d80-bffb-709200baf1e3 --os-tacker-api-version 2 Terminate request for VNF Instance 'fba5bda0-0b52-4d80-bffb-709200baf1e3' has been accepted.
via API:
$ curl -i -X POST ${TACKER_ENDPOINT}/vnflcm/v2/vnf_instances/$VNF_INST_ID/terminate \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" -H "Version: 2.0.0" \ -d '{"terminationType": "FORCEFUL"}'
How to deploy CNF Deployment (V2 API)¶
This user guide shows how to deploy CNF (Container Network Function) using Helm via Tacker. See the ETSI NFV-SOL CNF Deployment using Helm (v2 VNF LCM API) for the original procedure. This procedure can be used after OpenStack Tacker Zed release (version 8.0.0).
Note
This document focuses on some operations. See the Tacker Use Case Guide or API Reference for other operations.
Prerequisites¶
Credentials Setting¶
To use Tacker CLI, you need to configure the credentials, please change the username
and projectname
to be executed according to your environment.
$ source ${devstack_dir}/openrc admin admin
If you want to access Tacker via API, you need to get auth token by following procedure below.
# Create request body for issuing access token.
$ vi get_token.json
$ cat get_token.json
{
"auth": {
"identity": {
"methods": ["password"],
"password": {
"user": {
"domain": {
"name": "Default"
},
"name": "admin",
"password": "devstack"
}
}
},
"scope": {
"project": {
"domain": {
"name":"Default"
},
"name":"admin"
}
}
}
}
# Issue auth token for accessing via API.
$ curl -i -X POST -H "Content-Type: application/json" -d @./get_token.json http://192.168.121.170/identity/v3/auth/tokens
HTTP/1.1 201 CREATED
Date: Wed, 12 Apr 2023 07:22:44 GMT
Server: Apache/2.4.41 (Ubuntu)
Content-Type: application/json
Content-Length: 7469
X-Subject-Token: gAAAAABkNlxENR1WGpfgAe8g2Z4z5lCtwCsfUs5GTsg9mvYTMbG7S8HPIZep0vAGUnoPTj0_IYgMP-W1Y0vCDmWFQH7CSq1XWv3qNMd4aFnclk5sHuP1s0JtHSls7IQMM6zbn-FBYUSWTc9d783OSxYKXWqf3qo-CfFjPwrkmNzfkzgtlogkeA4
Vary: X-Auth-Token
x-openstack-request-id: req-e94aa763-9578-424b-affb-7ccab80db72c
Connection: close
{"token": {"methods": ["password"], "user": {"domain": {"id": "default", "name": "Default"}, "id": "3e2f3db203e347bfa2197f8fdd038f39", "name": "admin", "password_expires_at": null}, "audit_ids": ["1pgGosVvR4azhw29woKvDw"], "expires_at": "2023-04-12T08:22:44.000000Z", "issued_at": "2023-04-12T07:22:44.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "5af8bd4dd4ed4285ab1d45a95833cc67", "name": "admin"}, "is_domain": false, "roles": [{"id": "a039c220711049e0b77eac89a1504a81", "name": "reader"}, {"id": "57051bcc1fc24eb4875852a8ab32eae7", "name": "member"}, {"id": "029ea703a2534199a412b18cc5bfa31d", "name": "admin"}], "catalog": [{"endpoints": [{"id": "29307c3ec2f94553acbd7682e32602ba", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:8989/v2", "region": "RegionOne"}, {"id": "45e5c5f2d4ce4841a980e29e6d3713f7", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170:8989/v2", "region": "RegionOne"}, {"id": "8d79900575e3490cb71ad6fe5ff0697c", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170:8989/v2", "region": "RegionOne"}], "id": "00c00313624d4c74aeaa55285e2c553d", "type": "workflowv2", "name": "mistral"}, {"endpoints": [{"id": "aafc7809d8a943d39d20490442ed87fa", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/compute/v2/5af8bd4dd4ed4285ab1d45a95833cc67", "region": "RegionOne"}], "id": "131f57b38d7e4874a18446ab50f3f37b", "type": "compute_legacy", "name": "nova_legacy"}, {"endpoints": [{"id": "e1cd2199468a4486a4df2ffe884b9026", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:12347/v1", "region": "RegionOne"}], "id": "4dc58229363a4e5fa3d863357554678b", "type": "maintenance", "name": "fenix"}, {"endpoints": [], "id": "53b114aa4c2b4cf7b642ef99e767e58c", "type": "kuryr-kubernetes", "name": "kuryr-kubernetes"}, {"endpoints": [{"id": "1156b12e11a04ac2ab4a674976e8bb3e", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170/metric", "region": "RegionOne"}, {"id": "191a35e87d824e72819c28790d6dac8d", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170/metric", "region": "RegionOne"}, {"id": "99016e127b7d4f8483636f5531d994c9", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/metric", "region": "RegionOne"}], "id": "5d483e864b484f76a46266dc5640386b", "type": "metric", "name": "gnocchi"}, {"endpoints": [{"id": "d5ce793eee434288901795720538f811", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/volume/v3/5af8bd4dd4ed4285ab1d45a95833cc67", "region": "RegionOne"}], "id": "5e5f3dc6efa545569f67f453a05ac234", "type": "block-storage", "name": "cinder"}, {"endpoints": [{"id": "6ed501fde45047fe9a3684cc791df953", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/load-balancer", "region": "RegionOne"}], "id": "8b06952a46f3448f9e88daccee3212a9", "type": "load-balancer", "name": "octavia"}, {"endpoints": [{"id": "548133af931b4c0ea8d015dbb67d4388", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170/identity", "region": "RegionOne"}, {"id": "58f0b35802f442f4997318017a37cae9", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170/identity", "region": "RegionOne"}, {"id": "c062a6ce0ab54ee699b863b38e15c50a", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/identity", "region": "RegionOne"}], "id": "8ee29bc9aa6d4ddda69f7810b0c52ff5", "type": "identity", "name": "keystone"}, {"endpoints": [{"id": "7fdd1dac28874280928e6c9313b4a415", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/heat-api-cfn/v1", "region": "RegionOne"}], "id": "9605cce5cdad422f8934c891ac840fa7", "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"id": "53ed393173944da3bfac9d482907b65e", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170:9890/", "region": "RegionOne"}, {"id": "d6891cda1327453aa28155fd18e8596e", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170:9890/", "region": "RegionOne"}, {"id": "fef7c489ad544e708d9c85e4a801e344", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:9890/", "region": "RegionOne"}], "id": "a2c67888fc7a4f55a4001cd807293daf", "type": "nfv-orchestration", "name": "tacker"}, {"endpoints": [{"id": "413321647af94f2fb948e59c76bc2b87", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/placement", "region": "RegionOne"}], "id": "aa649b2a9f8644a184fd6857400328ab", "type": "placement", "name": "placement"}, {"endpoints": [{"id": "671a41088c4841d18c58db9ac8a97314", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:9696/networking", "region": "RegionOne"}], "id": "b1abe9867d07457dbc7c84f37906300a", "type": "network", "name": "neutron"}, {"endpoints": [{"id": "ba3d670defb748a1b23a4697a7998fb7", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/volume/v3/5af8bd4dd4ed4285ab1d45a95833cc67", "region": "RegionOne"}], "id": "b481211f6e5742f1913148ab157259ee", "type": "volumev3", "name": "cinderv3"}, {"endpoints": [{"id": "7eca8bcad7df40cda721a960a838f908", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/heat-api/v1/5af8bd4dd4ed4285ab1d45a95833cc67", "region": "RegionOne"}], "id": "c7c437d0564f428db112516273ca2c0b", "type": "orchestration", "name": "heat"}, {"endpoints": [{"id": "2be3a59b29c04cf7a359ec8b973d334a", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170/key-manager", "region": "RegionOne"}, {"id": "4258ac8e29084b5a82a48e55b2189284", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170/key-manager", "region": "RegionOne"}, {"id": "d463ed0ea12a4b44974b9239d2c14a49", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/key-manager", "region": "RegionOne"}], "id": "d411db3bd28a44f7b7c0ae53d3f5bb7b", "type": "key-manager", "name": "barbican"}, {"endpoints": [{"id": "05dea080ccc8493b9aa6a22bfe9d7b2b", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/compute/v2.1", "region": "RegionOne"}], "id": "d69f1f3988ee4809a9bb496f4f312bbd", "type": "compute", "name": "nova"}, {"endpoints": [{"id": "86e8d9e1998b4b9caf503dc58fc1297a", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/reservation/v1", "region": "RegionOne"}], "id": "d81b4911762a4c419f3816c36adcdac1", "type": "reservation", "name": "blazar"}, {"endpoints": [{"id": "0b0195a6580d48bf94eed97a35603756", "interface": "admin", "region_id": "RegionOne", "url": "http://192.168.121.170:8042", "region": "RegionOne"}, {"id": "67d676a732bb4c67abcdc5f433e5b3aa", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170:8042", "region": "RegionOne"}, {"id": "f753f73beed8463fa3f594c29911c332", "interface": "internal", "region_id": "RegionOne", "url": "http://192.168.121.170:8042", "region": "RegionOne"}], "id": "ddd00c0c78b448438bb925776fdbb350", "type": "alarming", "name": "aodh"}, {"endpoints": [{"id": "a39c85e31b3446239f958cc96c634216", "interface": "public", "region_id": "RegionOne", "url": "http://192.168.121.170/image", "region": "RegionOne"}], "id": "fe0a0e3590fa4fa69f395bcdc47f1241", "type": "image", "name": "glance"}]}}
# Set ``X-Subject-Token`` to environment variables as ``TOKEN``.
$ TOKEN=gAAAAABkNlxENR1WGpfgAe8g2Z4z5lCtwCsfUs5GTsg9mvYTMbG7S8HPIZep0vAGUnoPTj0_IYgMP-W1Y0vCDmWFQH7CSq1XWv3qNMd4aFnclk5sHuP1s0JtHSls7IQMM6zbn-FBYUSWTc9d783OSxYKXWqf3qo-CfFjPwrkmNzfkzgtlogkeA4
Get VIM Connection Information¶
Get VIM connection information by following procedure below. If you get via INF O2 service, follow the “Use Kubernetes Control Client through O2 DMS profile” section of INF O2 Service Userguide.
Get
bearer_token
:You have to confirm Kubernetes Secret name which contains
bearer_token
.$ kubectl get secret NAME TYPE DATA AGE default-token-cfx5m kubernetes.io/service-account-token 3 94m
Then, you can get the bearer token.
$ TOKEN=$(kubectl get secret default-token-cfx5m -o jsonpath="{.data.token}" | base64 --decode) && echo $TOKEN eyJhbGciOiJSUzI1NiIsImtpZCI6IkdWN3VydWFwUW1OYUUxcDc5dlU0V1gxQUZZRmVhTkRuWXJQbElKZmFwaE0ifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImRlZmF1bHQtdG9rZW4tY2Z4NW0iLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZGVmYXVsdCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjVkYzQxODUxLTdkNzYtNGZmYS04MmVmLWEwYjVhODJjMTMzMSIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpkZWZhdWx0OmRlZmF1bHQifQ.JFnE29iPCCOXeVroogNWYMe_r1qBoJNust0paR0yuZ7ctmR5EDeal79-HzFctiIYcoL5fPK0nHc4ZsyAIAyfs5eK-NvBMru3TwY4PduXAZ5U1cu_e1e3SPF31taMwgXXC2NpbtnVocUCC5xJ9V9EXLUV7-AFj14raHvjtnVWFIBkJpTshPbWmbdgMdMMkuAe57OR1kY_KoKlC0fBdHoCRlw-MDwkCN5gTf9eYQstVRmBCtJHDJ638o-2I-wu4bsun7uaZWsA_RCCJrxqdvo9G7EIvoq_LrHhqy7MSA41UhqGCKPwdpl58DoG98PBHNCiyVH47SvFTXyxS6BdYe8ZsQ
Get
ssl_ca_cert
:Users can get more information for authenticating to Kubernetes cluster.
$ kubectl get secrets default-token-cfx5m -o jsonpath="{.data.ca\.crt}" | base64 --decode -----BEGIN CERTIFICATE----- MIIC/jCCAeagAwIBAgIBADANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDEwprdWJl cm5ldGVzMB4XDTIzMDMyMjE0MjQ0NVoXDTMzMDMxOTE0MjQ0NVowFTETMBEGA1UE AxMKa3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRS HyraC+APG08cvJqM3NR76PkFnypekpz1XQrtpEk5Jeo11H+ppHIzVBJt6aPrXC0q tmK2L6j3MxknSNVxkjWhRwyD24PcyP1b1qXsZK1up0ek6ip0j0YuyUgszSdF204e QBp82v1zqAYbuxjy7e6wMv3pDu8yvBkrhqVHvLs6xJ0puUjX7XejrlgnjRwFuc8Q X+3VRuHaN9s+OMeiwm4nFDjGwAB7FpA8QPiwCZlA2QD5c6BzdrJA25xlOht6JvBB Bk90HS9yHg4kQvnikmudaeohRWv3+xzTK9FjGkFfyV/OBV9F66MsDCE5dGjWySLN wwmWlQ7Ad1/6wFfiYCsCAwEAAaNZMFcwDgYDVR0PAQH/BAQDAgKkMA8GA1UdEwEB /wQFMAMBAf8wHQYDVR0OBBYEFGwlLS7Sye6uTLz3DYfPUlYKxZj+MBUGA1UdEQQO MAyCCmt1YmVybmV0ZXMwDQYJKoZIhvcNAQELBQADggEBAIyCGBpiLsYgTE2WMjYf VYjBVZIboDiBfjnAbhn2SdXDjjSGd33gLX/hPOUhE6AkNYeeGD7NcKZfp9Yxg9a5 0zjEUs19gYjfRx7wP8iSw+Tdml+jibhdvg1oEABfDCy2tZq9R6UwFncRm4dzA3Gc t8V94pg6Hd8LgjJBRw9PZ8ui9n5sKtxu1wyXQ1uxyDXoNk8yxnIKnQYadey9LYlp FS1jJcArlKfYvXJllNg408I9XJB8gMfJX1gjIBaGOloOCNx69rZ3/LlleKcpTg6V 6YW/trOaSrZcxIOycBJvemHi8qHxJd1uC9joAT486hT8Bj5jhrFsC3oq3iTgxMNO bOc= -----END CERTIFICATE-----
Get Kubernetes server url:
By default Kubernetes API server listens on https://127.0.0.1:6443 and https://{HOST_IP}:6443. Users can get this information through kubectl cluster-info command and try to access API server with the bearer token described in the previous step.
$ kubectl cluster-info Kubernetes control plane is running at https://192.168.121.170:6443 To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
Helm Environment¶
Create an executable environment for Helm CLI by following procedure below. Helm CLI must be executable in an environment running Tacker for V2 API.
$ HELM_VERSION="3.10.3" # Change to version that is compatible with your cluster
$ wget -P /tmp https://get.helm.sh/helm-v$HELM_VERSION-linux-amd64.tar.gz
$ tar zxf /tmp/helm-v$HELM_VERSION-linux-amd64.tar.gz -C /tmp
$ sudo mv /tmp/linux-amd64/helm /usr/local/bin/helm
VNF Package¶
Create and upload the VNF Package that you want to deploy by following procedure below.
Prepare VNF Package. The sample VNF Package used in this guide is stored in
o2/tacker/samples/packages/cnf_v2
directory.$ git clone https://gerrit.o-ran-sc.org/r/smo/o2 $ cd o2/tacker/samples/packages/cnf_v2 $ ls Definitions Files input_param.json TOSCA-Metadata $ zip sample_cnf_package_v2.zip -r Definitions/ Files/ TOSCA-Metadata/
About details to prepare VNF Package, please refer to Prepare VNF Package.
Create and Upload VNF Package.
via CLI command:
$ openstack vnf package create +-------------------+-------------------------------------------------------------------------------------------------+ | Field | Value | +-------------------+-------------------------------------------------------------------------------------------------+ | ID | 9c9e71b2-2710-43f2-913c-3c53f056fad1 | | Links | { | | | "self": { | | | "href": "/vnfpkgm/v1/vnf_packages/9c9e71b2-2710-43f2-913c-3c53f056fad1" | | | }, | | | "packageContent": { | | | "href": "/vnfpkgm/v1/vnf_packages/9c9e71b2-2710-43f2-913c-3c53f056fad1/package_content" | | | } | | | } | | Onboarding State | CREATED | | Operational State | DISABLED | | Usage State | NOT_IN_USE | | User Defined Data | {} | +-------------------+-------------------------------------------------------------------------------------------------+ $ openstack vnf package upload --path sample_cnf_package_v2.zip 9c9e71b2-2710-43f2-913c-3c53f056fad1 Upload request for VNF package 9c9e71b2-2710-43f2-913c-3c53f056fad1 has been accepted.
via API:
$ TACKER_ENDPOINT=http://192.168.121.170:9890 $ VNFP_ID=$(curl -s -X POST ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" -d '{}' | jq -r '.id') $ VNFP_CONTENTS=./sample_cnf_package_v2.zip $ curl -i -X PUT ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages/$VNFP_ID/package_content \ -H "Content-type: application/zip" -H "X-Auth-Token:$TOKEN" -H "Accept:application/zip" \ -F vnf_package_content=@${VNFP_CONTENTS}
Deployment Procedure¶
Create¶
Create a VNF Instance by specifying the VNFD ID. The VNFD ID is the value defined in the VNFD file and can be found in the openstack vnf package show command.
via CLI command:
$ openstack vnflcm create 37391b92-a1d9-44e5-855a-83644cdc3265 --os-tacker-api-version 2 +-----------------------------+------------------------------------------------------------------------------------------------------------------+ | Field | Value | +-----------------------------+------------------------------------------------------------------------------------------------------------------+ | ID | 8ed20808-4d28-47c2-a83d-80e35c62d050 | | Instantiation State | NOT_INSTANTIATED | | Links | { | | | "self": { | | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/8ed20808-4d28-47c2-a83d-80e35c62d050" | | | }, | | | "instantiate": { | | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/8ed20808-4d28-47c2-a83d-80e35c62d050/instantiate" | | | } | | | } | | VNF Configurable Properties | | | VNF Instance Description | | | VNF Instance Name | | | VNF Product Name | Sample CNF | | VNF Provider | Company | | VNF Software Version | 1.0 | | VNFD ID | 37391b92-a1d9-44e5-855a-83644cdc3265 | | VNFD Version | 1.0 | +-----------------------------+------------------------------------------------------------------------------------------------------------------+
via API:
$ VNFD_ID=$(curl -s -X GET ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages/$VNFP_ID \ -H "X-Auth-Token:$TOKEN" | jq -r '.vnfdId') $ VNF_INST_ID=$(curl -sS -X POST ${TACKER_ENDPOINT}/vnflcm/v2/vnf_instances \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" -H "Version: 2.0.0" \ -d '{ "vnfdId": "'$VNFD_ID'"}' | jq -r '.id')
Instantiate¶
Instantiate a VNF by specifying the ID of the created VNF Instance and a file path of input parameters. V2 API allows you to insert VIM connection information directly into the instantiate input parameters.
$ cat input_param.json
{
"flavourId": "helmchart",
"vimConnectionInfo": {
"vim1": {
"vimType": "ETSINFV.HELM.V_3",
"interfaceInfo": {
"endpoint": "https://192.168.121.170:6443",
"ssl_ca_cert": "-----BEGIN CERTIFICATE-----\nMIIC/jCCAeagAwIBAgIBADANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDEwprdWJl\ncm5ldGVzMB4XDTIzMDMyMjE0MjQ0NVoXDTMzMDMxOTE0MjQ0NVowFTETMBEGA1UE\nAxMKa3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRS\nHyraC+APG08cvJqM3NR76PkFnypekpz1XQrtpEk5Jeo11H+ppHIzVBJt6aPrXC0q\ntmK2L6j3MxknSNVxkjWhRwyD24PcyP1b1qXsZK1up0ek6ip0j0YuyUgszSdF204e\nQBp82v1zqAYbuxjy7e6wMv3pDu8yvBkrhqVHvLs6xJ0puUjX7XejrlgnjRwFuc8Q\nX+3VRuHaN9s+OMeiwm4nFDjGwAB7FpA8QPiwCZlA2QD5c6BzdrJA25xlOht6JvBB\nBk90HS9yHg4kQvnikmudaeohRWv3+xzTK9FjGkFfyV/OBV9F66MsDCE5dGjWySLN\nwwmWlQ7Ad1/6wFfiYCsCAwEAAaNZMFcwDgYDVR0PAQH/BAQDAgKkMA8GA1UdEwEB\n/wQFMAMBAf8wHQYDVR0OBBYEFGwlLS7Sye6uTLz3DYfPUlYKxZj+MBUGA1UdEQQO\nMAyCCmt1YmVybmV0ZXMwDQYJKoZIhvcNAQELBQADggEBAIyCGBpiLsYgTE2WMjYf\nVYjBVZIboDiBfjnAbhn2SdXDjjSGd33gLX/hPOUhE6AkNYeeGD7NcKZfp9Yxg9a5\n0zjEUs19gYjfRx7wP8iSw+Tdml+jibhdvg1oEABfDCy2tZq9R6UwFncRm4dzA3Gc\nt8V94pg6Hd8LgjJBRw9PZ8ui9n5sKtxu1wyXQ1uxyDXoNk8yxnIKnQYadey9LYlp\nFS1jJcArlKfYvXJllNg408I9XJB8gMfJX1gjIBaGOloOCNx69rZ3/LlleKcpTg6V\n6YW/trOaSrZcxIOycBJvemHi8qHxJd1uC9joAT486hT8Bj5jhrFsC3oq3iTgxMNO\nbOc=\n-----END CERTIFICATE-----"
},
"accessInfo": {
"bearer_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IkdWN3VydWFwUW1OYUUxcDc5dlU0V1gxQUZZRmVhTkRuWXJQbElKZmFwaE0ifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImRlZmF1bHQtdG9rZW4tY2Z4NW0iLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZGVmYXVsdCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjVkYzQxODUxLTdkNzYtNGZmYS04MmVmLWEwYjVhODJjMTMzMSIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpkZWZhdWx0OmRlZmF1bHQifQ.JFnE29iPCCOXeVroogNWYMe_r1qBoJNust0paR0yuZ7ctmR5EDeal79-HzFctiIYcoL5fPK0nHc4ZsyAIAyfs5eK-NvBMru3TwY4PduXAZ5U1cu_e1e3SPF31taMwgXXC2NpbtnVocUCC5xJ9V9EXLUV7-AFj14raHvjtnVWFIBkJpTshPbWmbdgMdMMkuAe57OR1kY_KoKlC0fBdHoCRlw-MDwkCN5gTf9eYQstVRmBCtJHDJ638o-2I-wu4bsun7uaZWsA_RCCJrxqdvo9G7EIvoq_LrHhqy7MSA41UhqGCKPwdpl58DoG98PBHNCiyVH47SvFTXyxS6BdYe8ZsQ"
}
}
},
"additionalParams": {
"helm_chart_path": "Files/kubernetes/test-chart-0.1.0.tgz",
"helm_value_names": {
"VDU1": {
"replica": "replicaCount"
}
},
"namespace": "default"
}
}
via CLI command:
$ openstack vnflcm instantiate 8ed20808-4d28-47c2-a83d-80e35c62d050 input_param.json --os-tacker-api-version 2 Instantiate request for VNF Instance 8ed20808-4d28-47c2-a83d-80e35c62d050 has been accepted.
via API:
$ curl -i -X POST ${TACKER_ENDPOINT}/vnflcm/v2/vnf_instances/$VNF_INST_ID/instantiate \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" -H "Version: 2.0.0" \ -d @./input_param.json
You can verify that the deployment was successful in the following ways:
Verify that the VNF Instance displayed by the command is as follows:
Instantiation State
becameINSTANTIATED
.Deployed resource information is stored in
vnfcResourceInfo
ofInstantiated Vnf Info
.via CLI command:
$ openstack vnflcm show 8ed20808-4d28-47c2-a83d-80e35c62d050 --os-tacker-api-version 2 +-----------------------------+----------------------------------------------------------------------------------------------------------------------+ | Field | Value | +-----------------------------+----------------------------------------------------------------------------------------------------------------------+ | ID | 8ed20808-4d28-47c2-a83d-80e35c62d050 | | Instantiated Vnf Info | { | | | "flavourId": "helmchart", | | | "vnfState": "STARTED", | | | "scaleStatus": [ | | | { | | | "aspectId": "vdu1_aspect", | | | "scaleLevel": 0 | | | } | | | ], | | | "maxScaleLevels": [ | | | { | | | "aspectId": "vdu1_aspect", | | | "scaleLevel": 2 | | | } | | | ], | | | "vnfcResourceInfo": [ | | | { | | | "id": "vdu1-vnf8ed208084d2847c2a83d80e35c62d050-5b6b57ddbc-lznmz", | | | "vduId": "VDU1", | | | "computeResource": { | | | "resourceId": "vdu1-vnf8ed208084d2847c2a83d80e35c62d050-5b6b57ddbc-lznmz", | | | "vimLevelResourceType": "Deployment" | | | }, | | | "metadata": {} | | | } | | | ], | | | "vnfcInfo": [ | | | { | | | "id": "VDU1-vdu1-vnf8ed208084d2847c2a83d80e35c62d050-5b6b57ddbc-lznmz", | | | "vduId": "VDU1", | | | "vnfcResourceInfoId": "vdu1-vnf8ed208084d2847c2a83d80e35c62d050-5b6b57ddbc-lznmz", | | | "vnfcState": "STARTED" | | | } | | | ], | | | "metadata": { | | | "namespace": "default", | | | "vdu_reses": { | | | "VDU1": { | | | "apiVersion": "apps/v1", | | | "kind": "Deployment", | | | "metadata": { | | | "name": "vdu1-vnf8ed208084d2847c2a83d80e35c62d050", | | | "labels": { | | | "helm.sh/chart": "test-chart-0.1.0", | | | "app.kubernetes.io/name": "test-chart", | | | "app.kubernetes.io/instance": "vnf8ed208084d2847c2a83d80e35c62d050", | | | "app.kubernetes.io/version": "1.16.0", | | | "app.kubernetes.io/managed-by": "Helm" | | | }, | | | "namespace": "default" | | | }, | | | "spec": { | | | "replicas": 1, | | | "selector": { | | | "matchLabels": { | | | "app.kubernetes.io/name": "test-chart", | | | "app.kubernetes.io/instance": "vnf8ed208084d2847c2a83d80e35c62d050" | | | } | | | }, | | | "template": { | | | "metadata": { | | | "labels": { | | | "app.kubernetes.io/name": "test-chart", | | | "app.kubernetes.io/instance": "vnf8ed208084d2847c2a83d80e35c62d050" | | | } | | | }, | | | "spec": { | | | "serviceAccountName": "vnf8ed208084d2847c2a83d80e35c62d050-test-chart", | | | "securityContext": {}, | | | "containers": [ | | | { | | | "name": "test-chart", | | | "securityContext": {}, | | | "image": "nginx:1.16.0", | | | "imagePullPolicy": "IfNotPresent", | | | "ports": [ | | | { | | | "name": "http", | | | "containerPort": 80, | | | "protocol": "TCP" | | | } | | | ], | | | "resources": {} | | | } | | | ] | | | } | | | } | | | } | | | } | | | }, | | | "helm_chart_path": "Files/kubernetes/test-chart-0.1.0.tgz", | | | "helm_value_names": { | | | "VDU1": { | | | "replica": "replicaCount" | | | } | | | }, | | | "release_name": "vnf8ed208084d2847c2a83d80e35c62d050", | | | "revision": "1" | | | } | | | } | | Instantiation State | INSTANTIATED | | Links | { | | | "self": { | | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/8ed20808-4d28-47c2-a83d-80e35c62d050" | | | }, | | | "terminate": { | | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/8ed20808-4d28-47c2-a83d-80e35c62d050/terminate" | | | }, | | | "scale": { | | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/8ed20808-4d28-47c2-a83d-80e35c62d050/scale" | | | }, | | | "heal": { | | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/8ed20808-4d28-47c2-a83d-80e35c62d050/heal" | | | }, | | | "changeExtConn": { | | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/8ed20808-4d28-47c2-a83d-80e35c62d050/change_ext_conn" | | | } | | | } | | VIM Connection Info | { | | | "vim1": { | | | "vimType": "ETSINFV.HELM.V_3", | | | "interfaceInfo": { | | | "endpoint": "https://192.168.121.170:6443", | | | "ssl_ca_cert": "-----BEGIN CERTIFICATE-----\nMIIC/jCCAeagAwIBAgIBADANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDEwp | | | rdWJl\ncm5ldGVzMB4XDTIzMDMyMjE0MjQ0NVoXDTMzMDMxOTE0MjQ0NVowFTETMBEGA1UE\nAxMKa3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQA | | | DggEPADCCAQoCggEBAMRS\nHyraC+APG08cvJqM3NR76PkFnypekpz1XQrtpEk5Jeo11H+ppHIzVBJt6aPrXC0q\ntmK2L6j3MxknSNVxkjWhRwyD24P | | | cyP1b1qXsZK1up0ek6ip0j0YuyUgszSdF204e\nQBp82v1zqAYbuxjy7e6wMv3pDu8yvBkrhqVHvLs6xJ0puUjX7XejrlgnjRwFuc8Q\nX+3VRuHaN9s | | | +OMeiwm4nFDjGwAB7FpA8QPiwCZlA2QD5c6BzdrJA25xlOht6JvBB\nBk90HS9yHg4kQvnikmudaeohRWv3+xzTK9FjGkFfyV/OBV9F66MsDCE5dGjWy | | | SLN\nwwmWlQ7Ad1/6wFfiYCsCAwEAAaNZMFcwDgYDVR0PAQH/BAQDAgKkMA8GA1UdEwEB\n/wQFMAMBAf8wHQYDVR0OBBYEFGwlLS7Sye6uTLz3DYfPU | | | lYKxZj+MBUGA1UdEQQO\nMAyCCmt1YmVybmV0ZXMwDQYJKoZIhvcNAQELBQADggEBAIyCGBpiLsYgTE2WMjYf\nVYjBVZIboDiBfjnAbhn2SdXDjjSGd | | | 33gLX/hPOUhE6AkNYeeGD7NcKZfp9Yxg9a5\n0zjEUs19gYjfRx7wP8iSw+Tdml+jibhdvg1oEABfDCy2tZq9R6UwFncRm4dzA3Gc\nt8V94pg6Hd8Lg | | | jJBRw9PZ8ui9n5sKtxu1wyXQ1uxyDXoNk8yxnIKnQYadey9LYlp\nFS1jJcArlKfYvXJllNg408I9XJB8gMfJX1gjIBaGOloOCNx69rZ3/LlleKcpTg6 | | | V\n6YW/trOaSrZcxIOycBJvemHi8qHxJd1uC9joAT486hT8Bj5jhrFsC3oq3iTgxMNO\nbOc=\n-----END CERTIFICATE-----" | | | }, | | | "accessInfo": { | | | "bearer_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IkdWN3VydWFwUW1OYUUxcDc5dlU0V1gxQUZZRmVhTkRuWXJQbElKZmFwaE0 | | | ifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0 | | | Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImRlZmF1bHQtdG9rZW4tY2Z4NW0iLCJrdWJlcm5ldGVzLmlvL3NlcnZp | | | Y2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZGVmYXVsdCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50 | | | LnVpZCI6IjVkYzQxODUxLTdkNzYtNGZmYS04MmVmLWEwYjVhODJjMTMzMSIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpkZWZhdWx0OmRlZmF1 | | | bHQifQ.JFnE29iPCCOXeVroogNWYMe_r1qBoJNust0paR0yuZ7ctmR5EDeal79-HzFctiIYcoL5fPK0nHc4ZsyAIAyfs5eK-NvBMru3TwY4PduXAZ5U1 | | | cu_e1e3SPF31taMwgXXC2NpbtnVocUCC5xJ9V9EXLUV7-AFj14raHvjtnVWFIBkJpTshPbWmbdgMdMMkuAe57OR1kY_KoKlC0fBdHoCRlw-MDwkCN5gT | | | f9eYQstVRmBCtJHDJ638o-2I-wu4bsun7uaZWsA_RCCJrxqdvo9G7EIvoq_LrHhqy7MSA41UhqGCKPwdpl58DoG98PBHNCiyVH47SvFTXyxS6BdYe8Zs | | | Q" | | | } | | | } | | | } | | VNF Configurable Properties | | | VNF Instance Description | | | VNF Instance Name | | | VNF Product Name | Sample CNF | | VNF Provider | Company | | VNF Software Version | 1.0 | | VNFD ID | 37391b92-a1d9-44e5-855a-83644cdc3265 | | VNFD Version | 1.0 | +-----------------------------+----------------------------------------------------------------------------------------------------------------------+
via API:
$ curl -X GET ${TACKER_ENDPOINT}/vnflcm/v2/vnf_instances/$VNF_INST_ID \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" -H "Version: 2.0.0" \ | jq -r '{ instantiationState: .instantiationState, vnfcResourceInfo: .instantiatedVnfInfo.vnfcResourceInfo }' { "instantiationState": "INSTANTIATED", "vnfcResourceInfo": [ { "id": "vdu1-vnf8ed208084d2847c2a83d80e35c62d050-5b6b57ddbc-lznmz", "vduId": "VDU1", "computeResource": { "resourceId": "vdu1-vnf8ed208084d2847c2a83d80e35c62d050-5b6b57ddbc-lznmz", "vimLevelResourceType": "Deployment" }, "metadata": {} } ] }
Verify the CNF resources that were actually created as follows:
$ kubectl get deployment NAME READY UP-TO-DATE AVAILABLE AGE vdu1-vnf8ed208084d2847c2a83d80e35c62d050 1/1 1 1 3m15s $ kubectl get pod NAME READY STATUS RESTARTS AGE vdu1-vnf8ed208084d2847c2a83d80e35c62d050-5b6b57ddbc-lznmz 1/1 Running 0 3m35s $ helm list NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION vnf8ed208084d2847c2a83d80e35c62d050 default 1 2023-04-06 07:15:50.502657283 +0000 UTC deployed test-chart-0.1.0 1.16.0
Terminate¶
Terminate a VNF by specifying the VNF Instance ID.
via CLI command:
$ openstack vnflcm terminate 8ed20808-4d28-47c2-a83d-80e35c62d050 --os-tacker-api-version 2 Terminate request for VNF Instance '8ed20808-4d28-47c2-a83d-80e35c62d050' has been accepted.
via API:
$ curl -i -X POST ${TACKER_ENDPOINT}/vnflcm/v2/vnf_instances/$VNF_INST_ID/terminate \ -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" -H "Version: 2.0.0" \ -d '{"terminationType": "FORCEFUL"}'
API-Docs¶
This is the API-docs of SMO O2.
API Introduction¶
Tacker API Introduction¶
Tacker provides NFV-SOL compliant API. See the following documents.
API Functions¶
Tacker API Function¶
See Tacker API Reference above.