Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 1 | .. This work is licensed under a Creative Commons Attribution 4.0 International License. |
| 2 | .. http://creativecommons.org/licenses/by/4.0 |
| 3 | |
| 4 | |
| 5 | How to deploy VNF Deployment |
| 6 | ============================ |
| 7 | |
| 8 | This user guide shows how to deploy VNF (Virtualized Network Function) via Tacker. |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 9 | See the `ETSI NFV-SOL VNF Deployment`_ 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 Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 14 | |
| 15 | .. contents:: |
| 16 | :depth: 3 |
| 17 | :local: |
| 18 | |
| 19 | Prerequisites |
| 20 | ------------- |
| 21 | |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 22 | Credentials Setting |
| 23 | ~~~~~~~~~~~~~~~~~~~ |
| 24 | |
| 25 | To 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 | |
| 31 | If 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 Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 80 | VIM |
| 81 | ~~~ |
| 82 | Register OpenStack VIM (Virtualized Infrastructure Manager) by following procedure below. |
| 83 | |
| 84 | 1. Prepare VIM config file, please change the parameters to suit your environment. |
| 85 | |
| 86 | Sample config file: |
| 87 | |
| 88 | .. code:: bash |
| 89 | |
| 90 | $ cat vim_config.yaml |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 91 | auth_url: 'http://192.168.121.170/identity' |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 92 | username: 'admin' |
| 93 | password: 'devstack' |
| 94 | project_name: 'admin' |
| 95 | project_domain_name: 'Default' |
| 96 | user_domain_name: 'Default' |
| 97 | cert_verify: 'False' |
| 98 | |
| 99 | 2. Register VIM to Tacker by running following command. |
| 100 | |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 101 | * via CLI command: |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 102 | |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 103 | .. code:: bash |
| 104 | |
| 105 | $ openstack vim register --config-file vim_config.yaml vim-openstack |
| 106 | |
| 107 | * via API: |
| 108 | |
| 109 | .. code:: bash |
| 110 | |
| 111 | $ TACKER_ENDPOINT=http://192.168.121.170:9890 |
| 112 | $ OS_ENDPOINT=https://192.168.121.170/identity |
| 113 | |
| 114 | $ curl -g -i -X POST ${TACKER_ENDPOINT}/v1.0/vims \ |
| 115 | -H "Accept: application/json" -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" \ |
| 116 | -d '{"vim": {"auth_url": "'${OS_ENDPOINT}'", "type": "openstack", "vim_project": {"name": "admin", "project_domain_name": "Default"}, |
| 117 | "auth_cred": {"username": "admin", "password": "devstack", "user_domain_name": "Default", "cert_verify": "False"}, |
| 118 | "name": "vim-openstack", "is_default": false}}' |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 119 | |
| 120 | 3. Check the registered VIM status is ``REACHABLE``. |
| 121 | |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 122 | * via CLI command: |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 123 | |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 124 | .. code:: bash |
| 125 | |
| 126 | $ openstack vim list |
| 127 | +--------------------------------------+----------------+----------------------------------+------------+------------+-----------+ |
| 128 | | ID | Name | Tenant_id | Type | Is Default | Status | |
| 129 | +--------------------------------------+----------------+----------------------------------+------------+------------+-----------+ |
| 130 | | d8d886e4-fd98-4493-81e2-0e2b9991d629 | vim-openstack | a51290751e094e608ad1e5e251b8cd39 | openstack | True | REACHABLE | |
| 131 | +--------------------------------------+----------------+----------------------------------+------------+------------+-----------+ |
| 132 | |
| 133 | * via API: |
| 134 | |
| 135 | .. code:: bash |
| 136 | |
| 137 | $ curl -g -X GET ${TACKER_ENDPOINT}/v1.0/vims \ |
| 138 | -H "Accept: application/json" -H "X-Auth-Token: $TOKEN" \ |
| 139 | | jq -r '.vims[] | .id + ": " + .status' |
| 140 | d8d886e4-fd98-4493-81e2-0e2b9991d629: REACHABLE |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 141 | |
| 142 | VNF Package |
| 143 | ~~~~~~~~~~~ |
| 144 | Create and upload the VNF Package that you want to deploy by following procedure below. |
| 145 | |
| 146 | 1. Prepare VNF Package. |
| 147 | The sample VNF Package used in this guide is stored in ``o2/tacker/samples/packages/vnf`` directory. |
| 148 | |
| 149 | .. code:: bash |
| 150 | |
| 151 | $ git clone https://gerrit.o-ran-sc.org/r/smo/o2 |
| 152 | $ cd o2/tacker/samples/packages/vnf |
| 153 | $ ls |
| 154 | BaseHOT Definitions Files input_param.json TOSCA-Metadata UserData |
| 155 | |
| 156 | $ 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 |
| 157 | |
| 158 | $ zip sample_vnf_package.zip -r BaseHOT/ Definitions/ Files/ TOSCA-Metadata/ UserData/ |
| 159 | |
| 160 | |
| 161 | About details to prepare VNF Package, please refer to `Prepare VNF Package`_. |
| 162 | |
| 163 | 2. Create and Upload VNF Package. |
| 164 | |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 165 | * via CLI command: |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 166 | |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 167 | .. code:: bash |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 168 | |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 169 | $ openstack vnf package create |
| 170 | +-------------------+-------------------------------------------------------------------------------------------------+ |
| 171 | | Field | Value | |
| 172 | +-------------------+-------------------------------------------------------------------------------------------------+ |
| 173 | | ID | 9f10134f-90ae-4e71-bfdc-de6593552de8 | |
| 174 | | Links | { | |
| 175 | | | "self": { | |
| 176 | | | "href": "/vnfpkgm/v1/vnf_packages/9f10134f-90ae-4e71-bfdc-de6593552de8" | |
| 177 | | | }, | |
| 178 | | | "packageContent": { | |
| 179 | | | "href": "/vnfpkgm/v1/vnf_packages/9f10134f-90ae-4e71-bfdc-de6593552de8/package_content" | |
| 180 | | | } | |
| 181 | | | } | |
| 182 | | Onboarding State | CREATED | |
| 183 | | Operational State | DISABLED | |
| 184 | | Usage State | NOT_IN_USE | |
| 185 | | User Defined Data | {} | |
| 186 | +-------------------+-------------------------------------------------------------------------------------------------+ |
| 187 | |
| 188 | $ openstack vnf package upload --path sample_vnf_package.zip 9f10134f-90ae-4e71-bfdc-de6593552de8 |
| 189 | Upload request for VNF package 9f10134f-90ae-4e71-bfdc-de6593552de8 has been accepted. |
| 190 | |
| 191 | |
| 192 | * via API: |
| 193 | |
| 194 | .. code:: bash |
| 195 | |
| 196 | $ VNFP_ID=$(curl -s -X POST ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages \ |
| 197 | -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" -d '{}' | jq -r '.id') |
| 198 | |
| 199 | $ VNFP_CONTENTS=./sample_vnf_package.zip |
| 200 | |
| 201 | $ curl -i -X PUT ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages/$VNFP_ID/package_content \ |
| 202 | -H "Content-type: application/zip" -H "X-Auth-Token:$TOKEN" -H "Accept:application/zip" \ |
| 203 | -F vnf_package_content=@${VNFP_CONTENTS} |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 204 | |
| 205 | Deployment Procedure |
| 206 | -------------------- |
| 207 | |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 208 | Create |
| 209 | ~~~~~~ |
| 210 | 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 :command:`openstack vnf package show` command. |
| 211 | |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 212 | * via CLI command: |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 213 | |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 214 | .. code:: bash |
| 215 | |
| 216 | $ openstack vnflcm create b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
| 217 | +-----------------------------+------------------------------------------------------------------------------------------------------------------+ |
| 218 | | Field | Value | |
| 219 | +-----------------------------+------------------------------------------------------------------------------------------------------------------+ |
| 220 | | ID | fba5bda0-0b52-4d80-bffb-709200baf1e3 | |
| 221 | | Instantiation State | NOT_INSTANTIATED | |
| 222 | | Links | { | |
| 223 | | | "self": { | |
| 224 | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/fba5bda0-0b52-4d80-bffb-709200baf1e3" | |
| 225 | | | }, | |
| 226 | | | "instantiate": { | |
| 227 | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/fba5bda0-0b52-4d80-bffb-709200baf1e3/instantiate" | |
| 228 | | | } | |
| 229 | | | } | |
| 230 | | VNF Configurable Properties | | |
| 231 | | VNF Instance Description | None | |
| 232 | | VNF Instance Name | vnf-fba5bda0-0b52-4d80-bffb-709200baf1e3 | |
| 233 | | VNF Product Name | Sample VNF | |
| 234 | | VNF Provider | Company | |
| 235 | | VNF Software Version | 1.0 | |
| 236 | | VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 | |
| 237 | | VNFD Version | 1.0 | |
| 238 | | vnfPkgId | | |
| 239 | +-----------------------------+------------------------------------------------------------------------------------------------------------------+ |
| 240 | |
| 241 | * via API: |
| 242 | |
| 243 | .. code:: bash |
| 244 | |
| 245 | $ VNFD_ID=$(curl -s -X GET ${TACKER_ENDPOINT}/vnfpkgm/v1/vnf_packages/$VNFP_ID \ |
| 246 | -H "X-Auth-Token:$TOKEN" | jq -r '.vnfdId') |
| 247 | |
| 248 | $ VNF_INST_ID=$(curl -sS -X POST ${TACKER_ENDPOINT}/vnflcm/v1/vnf_instances \ |
| 249 | -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" \ |
| 250 | -d '{ "vnfdId": "'$VNFD_ID'"}' | jq -r '.id') |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 251 | |
| 252 | Instantiate |
| 253 | ~~~~~~~~~~~ |
| 254 | Instantiate a VNF by specifying the ID of the created VNF Instance and a file path of input parameters. |
| 255 | |
| 256 | .. note:: |
Ayumu Ueha | 43821df | 2023-04-07 13:16:50 +0000 | [diff] [blame] | 257 | Please change the parameters in ``input_param.json`` to suit your environment. |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 258 | |
| 259 | .. code:: bash |
| 260 | |
| 261 | $ cat input_param.json |
| 262 | { |
| 263 | "flavourId": "simple", |
| 264 | "extVirtualLinks": [ |
| 265 | { |
| 266 | "id": "test1", |
| 267 | "resourceId": "0e1cc46a-6808-4738-8b84-9e99a775c9eb", |
| 268 | "extCps": [ |
| 269 | { |
| 270 | "cpdId": "CP1", |
| 271 | "cpConfig": [ |
| 272 | { |
| 273 | "cpProtocolData": [ |
| 274 | { |
| 275 | "layerProtocol": "IP_OVER_ETHERNET", |
| 276 | "ipOverEthernet": { |
| 277 | "ipAddresses": [ |
| 278 | { |
| 279 | "type": "IPV4", |
| 280 | "numDynamicAddresses": 1, |
| 281 | "subnetId": "309614e6-4aab-4424-977f-fd9c8dfe493e" |
| 282 | } |
| 283 | ] |
| 284 | } |
| 285 | } |
| 286 | ] |
| 287 | } |
| 288 | ] |
| 289 | } |
| 290 | ] |
| 291 | } |
| 292 | ], |
| 293 | "vimConnectionInfo": [ |
| 294 | { |
| 295 | "id": "e24f9796-a8e9-4cb0-85ce-5920dcddafa1", |
| 296 | "vimId": "d8d886e4-fd98-4493-81e2-0e2b9991d629", |
| 297 | "vimType": "openstack" |
| 298 | } |
| 299 | ], |
| 300 | "additionalParams": { |
| 301 | "lcm-operation-user-data": "./UserData/lcm_user_data.py", |
| 302 | "lcm-operation-user-data-class": "SampleUserData" |
| 303 | } |
| 304 | } |
| 305 | |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 306 | * via CLI command: |
| 307 | |
| 308 | .. code:: bash |
| 309 | |
| 310 | $ openstack vnflcm instantiate b0915924-7e04-4c16-b229-d3dfcc366eee input_param.json |
| 311 | Instantiate request for VNF Instance b0915924-7e04-4c16-b229-d3dfcc366eee has been accepted. |
| 312 | |
| 313 | * via API: |
| 314 | |
| 315 | .. code:: bash |
| 316 | |
| 317 | $ curl -i -X POST ${TACKER_ENDPOINT}/vnflcm/v1/vnf_instances/$VNF_INST_ID/instantiate \ |
| 318 | -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" \ |
| 319 | -d @./input_param.json |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 320 | |
| 321 | You can verify that the deployment was successful in the following ways: |
| 322 | |
| 323 | 1. Verify that the VNF Instance displayed by :command:`openstack vnflcm show` command is as follows: |
| 324 | |
| 325 | * ``Instantiation State`` became ``INSTANTIATED``. |
| 326 | * Deployed resource information is stored in ``vnfcResourceInfo`` of ``Instantiated Vnf Info``. |
| 327 | |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 328 | * via CLI command: |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 329 | |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 330 | .. code:: bash |
| 331 | |
| 332 | $ openstack vnflcm show fba5bda0-0b52-4d80-bffb-709200baf1e3 |
| 333 | +-----------------------------+----------------------------------------------------------------------------------------------------------------------+ |
| 334 | | Field | Value | |
| 335 | +-----------------------------+----------------------------------------------------------------------------------------------------------------------+ |
| 336 | | ID | fba5bda0-0b52-4d80-bffb-709200baf1e3 | |
| 337 | | Instantiated Vnf Info | { | |
| 338 | | | "flavourId": "simple", | |
| 339 | | | "vnfState": "STARTED", | |
| 340 | | | "extCpInfo": [ | |
| 341 | | | { | |
| 342 | | | "id": "4e9cda91-f625-4790-8efb-273b3fbd03a1", | |
| 343 | | | "cpdId": "CP1", | |
| 344 | | | "extLinkPortId": null, | |
| 345 | | | "associatedVnfcCpId": "65676b39-1e80-435f-997d-217963d25298", | |
| 346 | | | "cpProtocolInfo": [ | |
| 347 | | | { | |
| 348 | | | "layerProtocol": "IP_OVER_ETHERNET", | |
| 349 | | | "ipOverEthernet": { | |
| 350 | | | "macAddress": null, | |
| 351 | | | "ipAddresses": [ | |
| 352 | | | { | |
| 353 | | | "type": "IPV4", | |
| 354 | | | "subnetId": "309614e6-4aab-4424-977f-fd9c8dfe493e", | |
| 355 | | | "isDynamic": true, | |
| 356 | | | "addresses": [] | |
| 357 | | | } | |
| 358 | | | ] | |
| 359 | | | } | |
| 360 | | | } | |
| 361 | | | ] | |
| 362 | | | } | |
| 363 | | | ], | |
| 364 | | | "extVirtualLinkInfo": [ | |
| 365 | | | { | |
| 366 | | | "id": "test1", | |
| 367 | | | "resourceHandle": { | |
| 368 | | | "vimConnectionId": null, | |
| 369 | | | "resourceId": "0e1cc46a-6808-4738-8b84-9e99a775c9eb", | |
| 370 | | | "vimLevelResourceType": null | |
| 371 | | | } | |
| 372 | | | } | |
| 373 | | | ], | |
| 374 | | | "vnfcResourceInfo": [ | |
| 375 | | | { | |
| 376 | | | "id": "65676b39-1e80-435f-997d-217963d25298", | |
| 377 | | | "vduId": "VDU1", | |
| 378 | | | "computeResource": { | |
| 379 | | | "vimConnectionId": "d8d886e4-fd98-4493-81e2-0e2b9991d629", | |
| 380 | | | "resourceId": "0f0ee6b9-cf6c-41c7-a36c-78d41fcba99c", | |
| 381 | | | "vimLevelResourceType": "OS::Nova::Server" | |
| 382 | | | }, | |
| 383 | | | "storageResourceIds": [], | |
| 384 | | | "vnfcCpInfo": [ | |
| 385 | | | { | |
| 386 | | | "id": "a3da58ce-039d-42ee-9569-a0e2a9adf9bb", | |
| 387 | | | "cpdId": "CP1", | |
| 388 | | | "vnfExtCpId": null, | |
| 389 | | | "vnfLinkPortId": "d61dcdf1-d5c6-4add-8b0f-0095b00908cd", | |
| 390 | | | "cpProtocolInfo": [ | |
| 391 | | | { | |
| 392 | | | "layerProtocol": "IP_OVER_ETHERNET", | |
| 393 | | | "ipOverEthernet": { | |
| 394 | | | "macAddress": null, | |
| 395 | | | "ipAddresses": [ | |
| 396 | | | { | |
| 397 | | | "type": "IPV4", | |
| 398 | | | "subnetId": "309614e6-4aab-4424-977f-fd9c8dfe493e", | |
| 399 | | | "isDynamic": true, | |
| 400 | | | "addresses": [] | |
| 401 | | | } | |
| 402 | | | ] | |
| 403 | | | } | |
| 404 | | | } | |
| 405 | | | ] | |
| 406 | | | } | |
| 407 | | | ] | |
| 408 | | | } | |
| 409 | | | ], | |
| 410 | | | "vnfVirtualLinkResourceInfo": [ | |
| 411 | | | { | |
| 412 | | | "id": "006531d5-7bb9-472d-9243-7dd415ca9839", | |
| 413 | | | "vnfVirtualLinkDescId": "internalVL1", | |
| 414 | | | "networkResource": { | |
| 415 | | | "vimConnectionId": null, | |
| 416 | | | "resourceId": "", | |
| 417 | | | "vimLevelResourceType": null | |
| 418 | | | }, | |
| 419 | | | "vnfLinkPorts": [ | |
| 420 | | | { | |
| 421 | | | "id": "11d2a97d-884d-4943-9539-bc6c8e4e9e2b", | |
| 422 | | | "resourceHandle": { | |
| 423 | | | "vimConnectionId": "d8d886e4-fd98-4493-81e2-0e2b9991d629", | |
| 424 | | | "resourceId": "601c9ce5-91df-4636-9fc3-0ae979781d9a", | |
| 425 | | | "vimLevelResourceType": "OS::Neutron::Port" | |
| 426 | | | }, | |
| 427 | | | "cpInstanceId": "a3da58ce-039d-42ee-9569-a0e2a9adf9bb" | |
| 428 | | | } | |
| 429 | | | ] | |
| 430 | | | }, | |
| 431 | | | { | |
| 432 | | | "id": "3a9607a4-0d5a-42da-aca3-2c471544ee86", | |
| 433 | | | "vnfVirtualLinkDescId": "test1", | |
| 434 | | | "networkResource": { | |
| 435 | | | "vimConnectionId": null, | |
| 436 | | | "resourceId": "0e1cc46a-6808-4738-8b84-9e99a775c9eb", | |
| 437 | | | "vimLevelResourceType": "OS::Neutron::Net" | |
| 438 | | | }, | |
| 439 | | | "vnfLinkPorts": [ | |
| 440 | | | { | |
| 441 | | | "id": "d61dcdf1-d5c6-4add-8b0f-0095b00908cd", | |
| 442 | | | "resourceHandle": { | |
| 443 | | | "vimConnectionId": null, | |
| 444 | | | "resourceId": "", | |
| 445 | | | "vimLevelResourceType": null | |
| 446 | | | }, | |
| 447 | | | "cpInstanceId": "a3da58ce-039d-42ee-9569-a0e2a9adf9bb" | |
| 448 | | | } | |
| 449 | | | ] | |
| 450 | | | } | |
| 451 | | | ], | |
| 452 | | | "vnfcInfo": [ | |
| 453 | | | { | |
| 454 | | | "id": "341f2d8c-b53f-4d4b-b7f2-2f1726355803", | |
| 455 | | | "vduId": "VDU1", | |
| 456 | | | "vnfcState": "STARTED" | |
| 457 | | | } | |
| 458 | | | ], | |
| 459 | | | "additionalParams": { | |
| 460 | | | "lcm-operation-user-data": "./UserData/lcm_user_data.py", | |
| 461 | | | "lcm-operation-user-data-class": "SampleUserData" | |
| 462 | | | } | |
| 463 | | | } | |
| 464 | | Instantiation State | INSTANTIATED | |
| 465 | | Links | { | |
| 466 | | | "self": { | |
| 467 | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/fba5bda0-0b52-4d80-bffb-709200baf1e3" | |
| 468 | | | }, | |
| 469 | | | "terminate": { | |
| 470 | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/fba5bda0-0b52-4d80-bffb-709200baf1e3/terminate" | |
| 471 | | | }, | |
| 472 | | | "heal": { | |
| 473 | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/fba5bda0-0b52-4d80-bffb-709200baf1e3/heal" | |
| 474 | | | }, | |
| 475 | | | "changeExtConn": { | |
| 476 | | | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/fba5bda0-0b52-4d80-bffb-709200baf1e3/change_ext_conn" | |
| 477 | | | } | |
| 478 | | | } | |
| 479 | | VIM Connection Info | [ | |
| 480 | | | { | |
| 481 | | | "id": "e24f9796-a8e9-4cb0-85ce-5920dcddafa1", | |
| 482 | | | "vimId": "d8d886e4-fd98-4493-81e2-0e2b9991d629", | |
| 483 | | | "vimType": "openstack", | |
| 484 | | | "interfaceInfo": {}, | |
| 485 | | | "accessInfo": {}, | |
| 486 | | | "extra": {} | |
| 487 | | | } | |
| 488 | | | ] | |
| 489 | | VNF Configurable Properties | | |
| 490 | | VNF Instance Description | None | |
| 491 | | VNF Instance Name | vnf-fba5bda0-0b52-4d80-bffb-709200baf1e3 | |
| 492 | | VNF Product Name | Sample VNF | |
| 493 | | VNF Provider | Company | |
| 494 | | VNF Software Version | 1.0 | |
| 495 | | VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 | |
| 496 | | VNFD Version | 1.0 | |
| 497 | | vnfPkgId | | |
| 498 | +-----------------------------+----------------------------------------------------------------------------------------------------------------------+ |
| 499 | |
| 500 | * via API: |
| 501 | |
| 502 | .. code:: bash |
| 503 | |
| 504 | $ curl -X GET ${TACKER_ENDPOINT}/vnflcm/v1/vnf_instances/$VNF_INST_ID \ |
| 505 | -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" \ |
| 506 | | jq -r '{ instantiationState: .instantiationState, |
| 507 | vnfcResourceInfo: .instantiatedVnfInfo.vnfcResourceInfo }' |
| 508 | { |
| 509 | "instantiationState": "INSTANTIATED", |
| 510 | "vnfcResourceInfo": [ |
| 511 | { |
| 512 | "id": "df202937-2bb8-40a9-8be0-a8aa5e2ec0ae", |
| 513 | "vduId": "VDU1", |
| 514 | "computeResource": { |
| 515 | "vimConnectionId": "d8d886e4-fd98-4493-81e2-0e2b9991d629", |
| 516 | "resourceId": "0f0ee6b9-cf6c-41c7-a36c-78d41fcba99c", |
| 517 | "vimLevelResourceType": "OS::Nova::Server" |
| 518 | }, |
| 519 | "storageResourceIds": [], |
| 520 | "vnfcCpInfo": [ |
| 521 | { |
| 522 | "id": "a3da58ce-039d-42ee-9569-a0e2a9adf9bb", |
| 523 | "cpdId": "CP1", |
| 524 | "vnfExtCpId": null, |
| 525 | "vnfLinkPortId": "d61dcdf1-d5c6-4add-8b0f-0095b00908cd", |
| 526 | "cpProtocolInfo": [ |
| 527 | { |
| 528 | "layerProtocol": "IP_OVER_ETHERNET", |
| 529 | "ipOverEthernet": { |
| 530 | "macAddress": null, |
| 531 | "ipAddresses": [ |
| 532 | { |
| 533 | "type": "IPV4", |
| 534 | "subnetId": "309614e6-4aab-4424-977f-fd9c8dfe493e", |
| 535 | "isDynamic": true, |
| 536 | "addresses": [] |
| 537 | } |
| 538 | ] |
| 539 | } |
| 540 | } |
| 541 | ] |
| 542 | } |
| 543 | ] |
| 544 | } |
| 545 | ] |
| 546 | } |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 547 | |
| 548 | 2. Verify the VM created successfully by :command:`openstack stack list/show` command or OpenStack Dashboard. |
| 549 | |
| 550 | Terminate |
| 551 | ~~~~~~~~~ |
| 552 | Terminate a VNF by specifying the VNF Instance ID. |
| 553 | |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 554 | * via CLI command: |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 555 | |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 556 | .. code:: bash |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 557 | |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 558 | $ openstack vnflcm terminate fba5bda0-0b52-4d80-bffb-709200baf1e3 |
| 559 | Terminate request for VNF Instance 'fba5bda0-0b52-4d80-bffb-709200baf1e3' has been accepted. |
| 560 | |
| 561 | * via API: |
| 562 | |
| 563 | .. code:: bash |
| 564 | |
| 565 | $ curl -i -X POST ${TACKER_ENDPOINT}/vnflcm/v1/vnf_instances/$VNF_INST_ID/terminate \ |
| 566 | -H "Content-type: application/json" -H "X-Auth-Token:$TOKEN" \ |
| 567 | -d '{"terminationType": "FORCEFUL"}' |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 568 | |
| 569 | .. _ETSI NFV-SOL VNF Deployment: https://docs.openstack.org/tacker/latest/user/etsi_vnf_deployment_as_vm_with_user_data.html |
Ayumu Ueha | c12629c | 2023-04-14 06:19:14 +0000 | [diff] [blame] | 570 | .. _Use Case Guide: https://docs.openstack.org/tacker/latest/user/etsi_use_case_guide.html |
| 571 | .. _API Reference: https://docs.openstack.org/api-ref/nfv-orchestration |
Ayumu Ueha | a91a325 | 2022-10-21 05:01:46 +0000 | [diff] [blame] | 572 | .. _Prepare VNF Package: https://docs.openstack.org/tacker/latest/user/vnf-package.html |