blob: 864837f6765974e461d1b73bc909fe3bf8d35b97 [file] [log] [blame]
Ayumu Uehaa91a3252022-10-21 05:01:46 +00001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3
4
5How to deploy CNF Deployment
6============================
7
8This user guide shows how to deploy CNF (Container Network Function) using Helm via Tacker.
Ayumu Uehac12629c2023-04-14 06:19:14 +00009See the `ETSI NFV-SOL CNF Deployment by Helm chart`_ for the original procedure.
10
11.. note::
12
13 This document focuses on some operations. See the Tacker `Use Case Guide`_ or `API Reference`_ for other operations.
Ayumu Uehaa91a3252022-10-21 05:01:46 +000014
15.. contents::
16 :depth: 3
17 :local:
18
19Prerequisites
20-------------
21
Ayumu Uehac12629c2023-04-14 06:19:14 +000022Credentials Setting
23~~~~~~~~~~~~~~~~~~~
24
25To use Tacker CLI, you need to configure the credentials, please change the ``username`` and ``projectname`` to be executed according to your environment.
26
27.. code:: bash
28
29 $ source ${devstack_dir}/openrc admin admin
30
31If you want to access Tacker via API, you need to get auth token by following procedure below.
32
33.. code:: bash
34
35 # Create request body for issuing access token.
36 $ vi get_token.json
37 $ cat get_token.json
38 {
39 "auth": {
40 "identity": {
41 "methods": ["password"],
42 "password": {
43 "user": {
44 "domain": {
45 "name": "Default"
46 },
47 "name": "admin",
48 "password": "devstack"
49 }
50 }
51 },
52 "scope": {
53 "project": {
54 "domain": {
55 "name":"Default"
56 },
57 "name":"admin"
58 }
59 }
60 }
61 }
62
63 # Issue auth token for accessing via API.
64 $ curl -i -X POST -H "Content-Type: application/json" -d @./get_token.json http://192.168.121.170/identity/v3/auth/tokens
65 HTTP/1.1 201 CREATED
66 Date: Wed, 12 Apr 2023 07:22:44 GMT
67 Server: Apache/2.4.41 (Ubuntu)
68 Content-Type: application/json
69 Content-Length: 7469
70 X-Subject-Token: gAAAAABkNlxENR1WGpfgAe8g2Z4z5lCtwCsfUs5GTsg9mvYTMbG7S8HPIZep0vAGUnoPTj0_IYgMP-W1Y0vCDmWFQH7CSq1XWv3qNMd4aFnclk5sHuP1s0JtHSls7IQMM6zbn-FBYUSWTc9d783OSxYKXWqf3qo-CfFjPwrkmNzfkzgtlogkeA4
71 Vary: X-Auth-Token
72 x-openstack-request-id: req-e94aa763-9578-424b-affb-7ccab80db72c
73 Connection: close
74
75 {"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"}]}}
76
77 # Set ``X-Subject-Token`` to environment variables as ``TOKEN``.
78 $ TOKEN=gAAAAABkNlxENR1WGpfgAe8g2Z4z5lCtwCsfUs5GTsg9mvYTMbG7S8HPIZep0vAGUnoPTj0_IYgMP-W1Y0vCDmWFQH7CSq1XWv3qNMd4aFnclk5sHuP1s0JtHSls7IQMM6zbn-FBYUSWTc9d783OSxYKXWqf3qo-CfFjPwrkmNzfkzgtlogkeA4
79
Ayumu Uehaa91a3252022-10-21 05:01:46 +000080VIM
81~~~
82Register Kubernetes VIM (Virtualized Infrastructure Manager) by following procedure below.
83
841. Prepare VIM config file, please change the parameters to suit your environment.
85 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`_.
86
87 Sample config file:
88
89 .. code:: bash
90
91 $ cat vim_config_k8s.yaml
92 auth_url: "https://192.168.121.170:6443"
93 project_name: "default"
94 bearer_token: "eyJhbGciOiJSUzI1NiIsImtpZCI6InZQOGs5bjhKdExWVkZiRU5reVZRdEtBS0pnYXJFemROcElKNFpIdEFtMXMifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJhZG1pbi11c2VyLXRva2VuLTk4am1qIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6ImFkbWluLXVzZXIiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiIzZWJkZmEzZi0wMTA1LTRhN2YtODFjZS1kYjg5ODcxYTBiMDYiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6a3ViZS1zeXN0ZW06YWRtaW4tdXNlciJ9.df_mV4RbsRN6oOS2KnkaKid0cJBAvdpautWnK67R0y8PRSm79Vc02NbUCmai0M4QiIF9gKhqtM0OYB5vZYJJng9vkcSNVWFUv6hA4Tvjw8FnEcGWe7TnWE2q-ZywJYiZNHvToRIgP5EH5UuLACEXu8KeeG56LxL3T2qNsUenUYLYaT6EciwKiy5SaEk3H1BB0zvSff0d_6sPvGCtY4xL_Q1pqqdgeL2lwC7tcivwEyRy3rMp1FBRrWOVdyeybww0XiNfEnYOjFyVSI4ED2n2msIdz_2JoHAnphGO7nslpn3MmkO-K1Mnhk7EKiR0kgHboGXwQlcnjW4Cje77PjumPg"
95 type: "kubernetes"
96
972. Register VIM to Tacker by running following command.
98
Ayumu Uehac12629c2023-04-14 06:19:14 +000099 * via CLI command:
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000100
Ayumu Uehac12629c2023-04-14 06:19:14 +0000101 .. code:: bash
102
103 $ openstack vim register --config-file vim_config_k8s.yaml vim-kubernetes
104
105 * via API:
106
107 .. code:: bash
108
109 $ TACKER_ENDPOINT=http://192.168.121.170:9890
110 $ K8S_ENDPOINT=https://192.168.121.170:6443
111 $ K8S_TOKEN=eyJhbGciOiJSUzI1NiIsImtpZCI6InZQOGs5bjhKdExWVkZiRU5reVZRdEtBS0pnYXJFemROcElKNFpIdEFtMXMifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJhZG1pbi11c2VyLXRva2VuLTk4am1qIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6ImFkbWluLXVzZXIiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiIzZWJkZmEzZi0wMTA1LTRhN2YtODFjZS1kYjg5ODcxYTBiMDYiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6a3ViZS1zeXN0ZW06YWRtaW4tdXNlciJ9.df_mV4RbsRN6oOS2KnkaKid0cJBAvdpautWnK67R0y8PRSm79Vc02NbUCmai0M4QiIF9gKhqtM0OYB5vZYJJng9vkcSNVWFUv6hA4Tvjw8FnEcGWe7TnWE2q-ZywJYiZNHvToRIgP5EH5UuLACEXu8KeeG56LxL3T2qNsUenUYLYaT6EciwKiy5SaEk3H1BB0zvSff0d_6sPvGCtY4xL_Q1pqqdgeL2lwC7tcivwEyRy3rMp1FBRrWOVdyeybww0XiNfEnYOjFyVSI4ED2n2msIdz_2JoHAnphGO7nslpn3MmkO-K1Mnhk7EKiR0kgHboGXwQlcnjW4Cje77PjumPg
112
113 $ curl -g -i -X POST ${TACKER_ENDPOINT}/v1.0/vims \
114 -H "Accept: application/json" -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" \
115 -d '{"vim": {"auth_url": "'${K8S_ENDPOINT}'", "type": "kubernetes", "vim_project": {"name": "default"},
116 "auth_cred": {"bearer_token": "'$K8S_TOKEN'"}, "name": "vim-kubernetes", "is_default": true}}'
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000117
1183. Check the registered VIM status is ``REACHABLE``.
119
Ayumu Uehac12629c2023-04-14 06:19:14 +0000120 * via CLI command:
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000121
Ayumu Uehac12629c2023-04-14 06:19:14 +0000122 .. code:: bash
123
124 $ openstack vim list
125 +--------------------------------------+----------------+----------------------------------+------------+------------+-----------+
126 | ID | Name | Tenant_id | Type | Is Default | Status |
127 +--------------------------------------+----------------+----------------------------------+------------+------------+-----------+
128 | 5a5815fa-bf1d-41f4-a824-3e39bbdcebd0 | vim-kubernetes | a51290751e094e608ad1e5e251b8cd39 | kubernetes | True | REACHABLE |
129 +--------------------------------------+----------------+----------------------------------+------------+------------+-----------+
130
131 * via API:
132
133 .. code:: bash
134
135 $ curl -g -X GET ${TACKER_ENDPOINT}/v1.0/vims \
136 -H "Accept: application/json" -H "X-Auth-Token: $TOKEN" \
137 | jq -r '.vims[] | .id + ": " + .status'
138 5a5815fa-bf1d-41f4-a824-3e39bbdcebd0: REACHABLE
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000139
140Helm Environment
141~~~~~~~~~~~~~~~~
142Create an executable environment for Helm CLI by following procedure below.
143
1441. Install Helm.
145
146 .. code:: bash
147
Ayumu Uehac12629c2023-04-14 06:19:14 +0000148 $ HELM_VERSION="3.10.3" # Change to version that is compatible with your cluster
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000149 $ wget -P /tmp https://get.helm.sh/helm-v$HELM_VERSION-linux-amd64.tar.gz
150 $ tar zxf /tmp/helm-v$HELM_VERSION-linux-amd64.tar.gz -C /tmp
151 $ sudo mv /tmp/linux-amd64/helm /usr/local/bin/helm
152
1532. Create directory to store Helm chart.
154
155 .. code:: bash
156
157 $ HELM_CHART_DIR="/var/tacker/helm"
158 $ sudo mkdir -p $HELM_CHART_DIR
159
1603. Update Helm Connection Information to VIM DB.
161
162 .. code:: bash
163
164 $ mysql
165 mysql> use tacker;
166 mysql> update vims set extra=json_object(
167 'helm_info', '{"masternode_ip": ["127.0.0.1"], "masternode_username": "stack", "masternode_password": "******"}')
168 where id="5a5815fa-bf1d-41f4-a824-3e39bbdcebd0";
169 mysql> exit
170
171 .. note::
172
173 The specified user must meet the following criteria:
174 * User can run Helm CLI commands via SSH.
175 * User can access to masternode_ip via ssh with password.
176 * User can execute sudo mkdir/chown/rm command without password.
177
178VNF Package
179~~~~~~~~~~~
180Create and upload the VNF Package that you want to deploy by following procedure below.
181
1821. Prepare VNF Package.
183 The sample VNF Package used in this guide is stored in ``o2/tacker/samples/packages/cnf`` directory.
184
185 .. code:: bash
186
187 $ git clone https://gerrit.o-ran-sc.org/r/smo/o2
188 $ cd o2/tacker/samples/packages/cnf
189 $ ls
190 Definitions Files input_param.json TOSCA-Metadata
191
192 $ zip sample_cnf_package.zip -r Definitions/ Files/ TOSCA-Metadata/
193
194 About details to prepare VNF Package, please refer to `Prepare VNF Package`_.
195
1962. Create and Upload VNF Package.
197
Ayumu Uehac12629c2023-04-14 06:19:14 +0000198 * via CLI command:
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000199
Ayumu Uehac12629c2023-04-14 06:19:14 +0000200 .. code:: bash
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000201
Ayumu Uehac12629c2023-04-14 06:19:14 +0000202 $ openstack vnf package create
203 +-------------------+-------------------------------------------------------------------------------------------------+
204 | Field | Value |
205 +-------------------+-------------------------------------------------------------------------------------------------+
206 | ID | 1efcf585-3fea-4813-88dd-bbc93692b51a |
207 | Links | { |
208 | | "self": { |
209 | | "href": "/vnfpkgm/v1/vnf_packages/1efcf585-3fea-4813-88dd-bbc93692b51a" |
210 | | }, |
211 | | "packageContent": { |
212 | | "href": "/vnfpkgm/v1/vnf_packages/1efcf585-3fea-4813-88dd-bbc93692b51a/package_content" |
213 | | } |
214 | | } |
215 | Onboarding State | CREATED |
216 | Operational State | DISABLED |
217 | Usage State | NOT_IN_USE |
218 | User Defined Data | {} |
219 +-------------------+-------------------------------------------------------------------------------------------------+
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000220
Ayumu Uehac12629c2023-04-14 06:19:14 +0000221 $ openstack vnf package upload --path sample_cnf_package.zip 1efcf585-3fea-4813-88dd-bbc93692b51a
222 Upload request for VNF package 1efcf585-3fea-4813-88dd-bbc93692b51a has been accepted.
223
224 * via API:
225
226 .. code:: bash
227
228 $ VNFP_ID=$(curl -s -X POST ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages \
229 -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" -d '{}' | jq -r '.id')
230
231 $ VNFP_CONTENTS=./sample_cnf_package.zip
232
233 $ curl -i -X PUT ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages/$VNFP_ID/package_content \
234 -H "Content-type: application/zip" -H "X-Auth-Token:$TOKEN" -H "Accept:application/zip" \
235 -F vnf_package_content=@${VNFP_CONTENTS}
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000236
237Deployment Procedure
238--------------------
239
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000240Create
241~~~~~~
242Create 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 :command:`openstack vnf package show` command.
243
Ayumu Uehac12629c2023-04-14 06:19:14 +0000244* via CLI command:
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000245
Ayumu Uehac12629c2023-04-14 06:19:14 +0000246 .. code:: bash
247
248 $ openstack vnflcm create 37391b92-a1d9-44e5-855a-83644cdc3265
249 +-----------------------------+------------------------------------------------------------------------------------------------------------------+
250 | Field | Value |
251 +-----------------------------+------------------------------------------------------------------------------------------------------------------+
252 | ID | b0915924-7e04-4c16-b229-d3dfcc366eee |
253 | Instantiation State | NOT_INSTANTIATED |
254 | Links | { |
255 | | "self": { |
256 | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/b0915924-7e04-4c16-b229-d3dfcc366eee" |
257 | | }, |
258 | | "instantiate": { |
259 | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/b0915924-7e04-4c16-b229-d3dfcc366eee/instantiate" |
260 | | } |
261 | | } |
262 | VNF Configurable Properties | |
263 | VNF Instance Description | None |
264 | VNF Instance Name | vnf-b0915924-7e04-4c16-b229-d3dfcc366eee |
265 | VNF Product Name | Sample CNF |
266 | VNF Provider | Company |
267 | VNF Software Version | 1.0 |
268 | VNFD ID | 37391b92-a1d9-44e5-855a-83644cdc3265 |
269 | VNFD Version | 1.0 |
270 | vnfPkgId | |
271 +-----------------------------+------------------------------------------------------------------------------------------------------------------+
272
273* via API:
274
275 .. code:: bash
276
277 $ VNFD_ID=$(curl -s -X GET ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages/$VNFP_ID \
278 -H "X-Auth-Token:$TOKEN" | jq -r '.vnfdId')
279
280 $ VNF_INST_ID=$(curl -sS -X POST ${TACKER_ENDPOINT}/vnflcm/v1/vnf_instances \
281 -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" \
282 -d '{ "vnfdId": "'$VNFD_ID'"}' | jq -r '.id')
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000283
284Instantiate
285~~~~~~~~~~~
286Instantiate a VNF by specifying the ID of the created VNF Instance and a file path of input parameters.
287
288.. code:: bash
289
290 $ cat input_param.json
291 {
292 "flavourId": "helmchart",
293 "additionalParams": {
294 "namespace": "default",
295 "use_helm": "true",
296 "using_helm_install_param": [
297 {
298 "exthelmchart": "false",
299 "helmchartfile_path": "Files/kubernetes/localhelm-0.1.0.tgz",
300 "helmreleasename": "tacker-test-vdu"
301 }
302 ],
303 "helm_replica_values": {
304 "vdu1_aspect": "replicaCount"
305 }
306 },
307 "vimConnectionInfo": [
308 {
309 "id": "742f1fc7-7f00-417d-85a6-d4e788353181",
310 "vimId": "5a5815fa-bf1d-41f4-a824-3e39bbdcebd0",
311 "vimType": "kubernetes"
312 }
313 ]
314 }
315
Ayumu Uehac12629c2023-04-14 06:19:14 +0000316* via CLI command:
317
318 .. code:: bash
319
320 $ openstack vnflcm instantiate b0915924-7e04-4c16-b229-d3dfcc366eee input_param.json
321 Instantiate request for VNF Instance b0915924-7e04-4c16-b229-d3dfcc366eee has been accepted.
322
323* via API:
324
325 .. code:: bash
326
327 $ curl -i -X POST ${TACKER_ENDPOINT}/vnflcm/v1/vnf_instances/$VNF_INST_ID/instantiate \
328 -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" \
329 -d @./input_param.json
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000330
331You can verify that the deployment was successful in the following ways:
332
3331. Verify that the VNF Instance displayed by the command is as follows:
334
335 * ``Instantiation State`` became ``INSTANTIATED``.
336 * Deployed resource information is stored in ``vnfcResourceInfo`` of ``Instantiated Vnf Info``.
337
Ayumu Uehac12629c2023-04-14 06:19:14 +0000338 * via CLI command:
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000339
Ayumu Uehac12629c2023-04-14 06:19:14 +0000340 .. code:: bash
341
342 $ openstack vnflcm show b0915924-7e04-4c16-b229-d3dfcc366eee
343 +-----------------------------+----------------------------------------------------------------------------------------------------------------------+
344 | Field | Value |
345 +-----------------------------+----------------------------------------------------------------------------------------------------------------------+
346 | ID | b0915924-7e04-4c16-b229-d3dfcc366eee |
347 | Instantiated Vnf Info | { |
348 | | "flavourId": "helmchart", |
349 | | "vnfState": "STARTED", |
350 | | "scaleStatus": [ |
351 | | { |
352 | | "aspectId": "vdu1_aspect", |
353 | | "scaleLevel": 0 |
354 | | } |
355 | | ], |
356 | | "extCpInfo": [], |
357 | | "vnfcResourceInfo": [ |
358 | | { |
359 | | "id": "df202937-2bb8-40a9-8be0-a8aa5e2ec0ae", |
360 | | "vduId": "VDU1", |
361 | | "computeResource": { |
362 | | "vimConnectionId": null, |
363 | | "resourceId": "tacker-test-vdu-localhelm-7b5489f949-fzmc5", |
364 | | "vimLevelResourceType": "Deployment" |
365 | | }, |
366 | | "storageResourceIds": [] |
367 | | } |
368 | | ], |
369 | | "additionalParams": { |
370 | | "useHelm": "true", |
371 | | "namespace": "default", |
372 | | "helmReplicaValues": { |
373 | | "vdu1Aspect": "replicaCount" |
374 | | }, |
375 | | "usingHelmInstallParam": [ |
376 | | { |
377 | | "exthelmchart": "false", |
378 | | "helmreleasename": "tacker-test-vdu", |
379 | | "helmchartfilePath": "Files/kubernetes/localhelm-0.1.0.tgz" |
380 | | } |
381 | | ] |
382 | | } |
383 | | } |
384 | Instantiation State | INSTANTIATED |
385 | Links | { |
386 | | "self": { |
387 | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/b0915924-7e04-4c16-b229-d3dfcc366eee" |
388 | | }, |
389 | | "terminate": { |
390 | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/b0915924-7e04-4c16-b229-d3dfcc366eee/terminate" |
391 | | }, |
392 | | "heal": { |
393 | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/b0915924-7e04-4c16-b229-d3dfcc366eee/heal" |
394 | | }, |
395 | | "changeExtConn": { |
396 | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/b0915924-7e04-4c16-b229-d3dfcc366eee/change_ext_conn" |
397 | | } |
398 | | } |
399 | VIM Connection Info | [ |
400 | | { |
401 | | "id": "742f1fc7-7f00-417d-85a6-d4e788353181", |
402 | | "vimId": "5a5815fa-bf1d-41f4-a824-3e39bbdcebd0", |
403 | | "vimType": "kubernetes", |
404 | | "interfaceInfo": {}, |
405 | | "accessInfo": {}, |
406 | | "extra": {} |
407 | | } |
408 | | ] |
409 | VNF Configurable Properties | |
410 | VNF Instance Description | None |
411 | VNF Instance Name | vnf-b0915924-7e04-4c16-b229-d3dfcc366eee |
412 | VNF Product Name | Sample CNF |
413 | VNF Provider | Company |
414 | VNF Software Version | 1.0 |
415 | VNFD ID | 37391b92-a1d9-44e5-855a-83644cdc3265 |
416 | VNFD Version | 1.0 |
417 | metadata | namespace=default |
418 | vnfPkgId | |
419 +-----------------------------+----------------------------------------------------------------------------------------------------------------------+
420
421 * via API:
422
423 .. code:: bash
424
425 $ curl -X GET ${TACKER_ENDPOINT}/vnflcm/v1/vnf_instances/$VNF_INST_ID \
426 -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" \
427 | jq -r '{ instantiationState: .instantiationState,
428 vnfcResourceInfo: .instantiatedVnfInfo.vnfcResourceInfo }'
429 {
430 "instantiationState": "INSTANTIATED",
431 "vnfcResourceInfo": [
432 {
433 "id": "df202937-2bb8-40a9-8be0-a8aa5e2ec0ae",
434 "vduId": "VDU1",
435 "computeResource": {
436 "vimConnectionId": null,
437 "resourceId": "tacker-test-vdu-localhelm-7b5489f949-fzmc5",
438 "vimLevelResourceType": "Deployment"
439 },
440 "storageResourceIds": []
441 }
442 ]
443 }
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000444
4452. Verify the CNF resources that were actually created as follows:
446
447 .. code:: bash
448
449 $ kubectl get deployment
450 NAME READY UP-TO-DATE AVAILABLE AGE
451 tacker-test-vdu-localhelm 1/1 1 1 20s
452
453 $ kubectl get pod
454 NAME READY STATUS RESTARTS AGE
455 tacker-test-vdu-localhelm-7b5489f949-fzmc5 1/1 Running 0 24s
456
457 $ helm list
458 NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
459 tacker-test-vdu default 1 2022-06-29 14:54:32.20990033 +0000 UTC deployed localhelm-0.1.0 1.16.0
460
461Terminate
462~~~~~~~~~
463Terminate a VNF by specifying the VNF Instance ID.
464
Ayumu Uehac12629c2023-04-14 06:19:14 +0000465* via CLI command:
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000466
Ayumu Uehac12629c2023-04-14 06:19:14 +0000467 .. code:: bash
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000468
Ayumu Uehac12629c2023-04-14 06:19:14 +0000469 $ openstack vnflcm terminate b0915924-7e04-4c16-b229-d3dfcc366eee
470 Terminate request for VNF Instance 'b0915924-7e04-4c16-b229-d3dfcc366eee' has been accepted.
471
472* via API:
473
474 .. code:: bash
475
476 $ curl -i -X POST ${TACKER_ENDPOINT}/vnflcm/v1/vnf_instances/$VNF_INST_ID/terminate \
477 -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" \
478 -d '{"terminationType": "FORCEFUL"}'
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000479
480.. _ETSI NFV-SOL CNF Deployment by Helm chart: https://docs.openstack.org/tacker/latest/user/mgmt_driver_deploy_k8s_and_cnf_with_helm.html#etsi-nfv-sol-cnf-deployment-by-helm-chart
Ayumu Uehac12629c2023-04-14 06:19:14 +0000481.. _Use Case Guide: https://docs.openstack.org/tacker/latest/user/etsi_use_case_guide.html
482.. _API Reference: https://docs.openstack.org/api-ref/nfv-orchestration
Ayumu Uehaa91a3252022-10-21 05:01:46 +0000483.. _INF O2 Service Userguide: https://docs.o-ran-sc.org/projects/o-ran-sc-pti-o2/en/latest/user-guide.html
484.. _Prepare VNF Package: https://docs.openstack.org/tacker/latest/user/mgmt_driver_deploy_k8s_and_cnf_with_helm.html#prepare-vnf-package