Separate UseCaseGuide for v1 API and v2 API

This patch separates the documents for v1 API and v2 API
that are described in the same document in UseCaseGuide.
Existing documents are modified for v1 API, and
v2 API documents are newly placed under `doc/source/user/v2`.

And some VNF Package samples have also been added.

Change-Id: I6d99a660df32b457ea70a64bfd153bc76ac2d9fe
This commit is contained in:
Ai Hamano 2023-11-13 18:05:07 +09:00
parent c056e248b2
commit afbbc893d8
148 changed files with 21193 additions and 8170 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

File diff suppressed because it is too large Load Diff

View File

@ -1,735 +0,0 @@
===============================================================
ETSI NFV-SOL CNF Auto Healing With Prometheus via FM Interfaces
===============================================================
This document describes how to auto heal CNF in Tacker with Prometheus
via Fault Management Interfaces.
Overview
--------
Using the Fault Management interfaces, there are two ways to implement
auto heal, Polling Mode and Notification Mode.
The diagram below shows an overview of the CNF auto healing.
1. Create FM subscription(Notification Mode)
NFVO sends a request to Tacker to create a FM subscription.
2. Collect metrics
Prometheus collects metrics and decides whether triggering alert
is needed or not.
3. POST alert
Prometheus sends alerts to Tacker.
4. Convert alert to alarm
Tacker receives informed alerts, converts them to alarms, and saves
them to Tacker DB.
5. Get Alarms and return result(Polling Mode)
NFVO sends a request at regular intervals to get the alarm in
the Tacker. Tacker searches Tacker DB with the query condition
specified by NFVO, and returns the alarm that matches the
condition to NFVO.
6. Send alarm notification(Notification Mode)
VnffmDriver finds all FM subscriptions in the DB and matches the
alerts to them. If there is a FM subscription that can match
successfully, the alarm is sent to the specified path of the
NFVO. If the match is not successful, the processing ends.
7. Heal
NFVO recognizes the failure of the CNF from the alarm and sends
a heal request to the Tacker.
8. Call Kubernetes API
In tacker-conductor, the request is redirected again to an
appropriate infra-driver (in this case Kubernetes infra-driver)
according to the contents of the instantiate parameters. Then,
Kubernetes infra-driver calls Kubernetes APIs.
9. Create a new pod
Kubernetes Master adds the number of Pods according to the
API calls.
10. Delete the old pod
Kubernetes Master deletes the number of Pods according to the
API calls.
.. figure:: ../_images/etsi_cnf_auto_healing_fm.png
:align: left
Prerequisites
-------------
* The following packages should be installed:
* tacker
* python-tackerclient
At least one VNF instance with status of ``INSTANTIATED`` is required.
You can refer to :doc:`./etsi_containerized_vnf_usage_guide` for the
procedure to instantiate VNF.
The VNF Package used can refer to `the sample`_.
* The following third-party services should be installed
* NFVO
* Prometheus(including Alertmanager)
Each operator has its own NFVO, there is no restriction here, as long as
it conforms to `ETSI NFV-SOL 002 v3.3.1`_ and `ETSI NFV-SOL 003 v3.3.1`_,
it can be used.
For the installation of Prometheus and Alertmanager, please refer to
the `Prometheus official website`_.
How to configure Prometheus Plugin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Prometheus Plugin is disabled by default in Tacker.
For it to work, we need to find ``fault_management`` in
``tacker.conf`` and change its value to ``True``.
.. code-block:: console
$ vi /etc/tacker/tacker.conf
...
[prometheus_plugin]
fault_management = True
[v2_vnfm]
# Enable https access to notification server from Tacker (boolean value)
notification_verify_cert = true
...
After modifying the configuration file, don't forget to restart the
Tacker service to take effect.
.. code-block:: console
$ sudo systemctl stop devstack@tacker
$ sudo systemctl restart devstack@tacker-conductor
$ sudo systemctl start devstack@tacker
How to configure Prometheus
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unlike auto scale via PM interfaces, auto heal via FM interfaces does not
need to login Prometheus server via SSH to modify its configuration.
Users need to manually modify the configuration file of Prometheus, and
then it will monitor the specified resources.
For the setting method of Prometheus configuration file, please refer to
`Prometheus Configuration`_ for details.
The following is the content of a sample ``prometheus.yml``:
.. code-block:: yaml
global:
scrape_interval: 15s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets:
- <IP of Alertmanager>:9093
rule_files:
- "tacker-samplevnf-rules.yaml"
scrape_configs:
- job_name: "kube-state-metrics"
static_configs:
- targets: ["<IP of Kubernetes>:<port of metrics>"]
The following is the content of a sample ``tacker-samplevnf-rules.yaml``:
.. code-block:: yaml
groups:
- name: example
rules:
- alert: KubePodCrashLooping
annotations:
probable_cause: The server cannot be connected.
fault_type: Server Down
fault_details: fault details
expr: |
rate(kube_pod_container_status_restarts_total{job="kube-state-metrics"}[10m]) * 60 * 5 > 0
for: 5m
labels:
receiver_type: tacker
function_type: vnffm
vnf_instance_id: <VNF instance ID>
perceived_severity: WARNING
event_type: EQUIPMENT_ALARM
The following is the content of a sample ``alertmanager.yml``:
.. code-block:: yaml
route:
group_by: ['cluster']
group_wait: 30s
group_interval: 2m
repeat_interval: 1h
receiver: 'web.boo'
routes:
- match:
alertname: KubePodCrashLooping
receiver: 'web.boo'
receivers:
- name: 'web.boo'
webhook_configs:
- url: 'http://<IP of Tacker>:9890/alert'
inhibit_rules:
- source_match:
severity: 'critical'
target_match:
severity: 'warning'
equal: ['dev', 'instance']
How does NFVO Auto Heal CNF
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Through the FM interfaces, there are two modes to auto heal the CNF.
Polling Mode
^^^^^^^^^^^^
This mode is where NFVO actively sends a get alarms request to Tacker
at an interval.
According to the content of the response, confirm the VNFC instance ID
of the CNF in which the problem occurred.
The following is an example of a response to a get alarms request:
.. code-block:: json
[
{
"id": "78a39661-60a8-4824-b989-88c1b0c3534a",
"managedObjectId": "c61314d0-f583-4ab3-a457-46426bce02d3",
"vnfcInstanceIds": [
"VDU2-curry-probe-test001-766bdd79bf-wgc7m"
],
"alarmRaisedTime": "2021-09-03 10:21:03",
"alarmChangedTime": "",
"alarmClearedTime": "",
"alarmAcknowledgedTime": "",
"ackState": "UNACKNOWLEDGED",
"perceivedSeverity": "WARNING",
"eventTime": "2021-09-03 10:06:03",
"eventType": "EQUIPMENT_ALARM",
"faultType": "",
"probableCause": "The server cannot be connected.",
"isRootCause": "false",
"correlatedAlarmIds": [],
"faultDetails": [],
"_links": {
"self": "/vnffm/v1/alarms/78a39661-60a8-4824-b989-88c1b0c3534a",
"objectInstance": ""
}
}
]
.. note::
The value of ``managedObjectId`` is the VNF instance ID.
The value of ``vnfcInstanceIds`` is the VNFC instance IDs.
Then send a heal request specifying the VNFC instance ID to Tacker.
The format of the heal request can refer to `heal request`_.
.. _Notification Mode :
Notification Mode
^^^^^^^^^^^^^^^^^
This mode is that NFVO will create a FM subscription on Tacker.
In this FM subscription, multiple filter conditions can be set, so that
the VNF instance that has been instantiated in Tacker can be matched.
Create FM subscription can be executed by the following CLI command.
.. code-block:: console
$ openstack vnffm sub create sample_param_file.json --os-tacker-api-version 2
The content of the sample ``sample_param_file.json`` in this document is
as follows:
.. code-block:: json
{
"filter": {
"vnfInstanceSubscriptionFilter": {
"vnfdIds": [
"4d5ffa3b-9dde-45a9-a805-659dc8df0c02"
],
"vnfProductsFromProviders": [
{
"vnfProvider": "Company",
"vnfProducts": [
{
"vnfProductName": "Sample VNF",
"versions": [
{
"vnfSoftwareVersion": 1.0,
"vnfdVersions": [1.0, 2.0]
}
]
}
]
}
],
"vnfInstanceIds": [
"aad7d2fe-ed51-47da-a20d-7b299860607e"
],
"vnfInstanceNames": [
"test"
]
},
"notificationTypes": [
"AlarmNotification"
],
"faultyResourceTypes": [
"COMPUTE"
],
"perceivedSeverities": [
"WARNING"
],
"eventTypes": [
"EQUIPMENT_ALARM"
],
"probableCauses": [
"The server cannot be connected."
]
},
"callbackUri": "http://127.0.0.1:9890/vnffm/v1/subscriptions/407cb9c5-60f2-43e8-a43a-925c0323c3eb",
"authentication": {
"authType": [
"BASIC",
"OAUTH2_CLIENT_CREDENTIALS",
"OAUTH2_CLIENT_CERT"
],
"paramsBasic": {
"userName": "nfvo",
"password": "nfvopwd"
},
"paramsOauth2ClientCredentials": {
"clientId": "auth_user_name",
"clientPassword": "auth_password",
"tokenEndpoint": "token_endpoint"
},
"paramsOauth2ClientCert": {
"clientId": "auth_user_name",
"certificateRef": {
"type": "x5t#S256",
"value": "certificate_fingerprint"
},
"tokenEndpoint": "token_endpoint"
}
}
}
Here is an example of create FM subscription:
.. code-block:: console
$ openstack vnffm sub create sample_param_file.json --os-tacker-api-version 2
+--------------+-----------------------------------------------------------------------------------------------------+
| Field | Value |
+--------------+-----------------------------------------------------------------------------------------------------+
| Callback Uri | /nfvo/notification |
| Filter | { |
| | "vnfInstanceSubscriptionFilter": { |
| | "vnfdIds": [ |
| | "4d5ffa3b-9dde-45a9-a805-659dc8df0c02" |
| | ], |
| | "vnfProductsFromProviders": [ |
| | { |
| | "vnfProvider": "Company", |
| | "vnfProducts": [ |
| | { |
| | "vnfProductName": "Sample VNF", |
| | "versions": [ |
| | { |
| | "vnfSoftwareVersion": "1.0", |
| | "vnfdVersions": [ |
| | "1.0", |
| | "2.0" |
| | ] |
| | } |
| | ] |
| | } |
| | ] |
| | } |
| | ], |
| | "vnfInstanceIds": [ |
| | "aad7d2fe-ed51-47da-a20d-7b299860607e" |
| | ], |
| | "vnfInstanceNames": [ |
| | "test" |
| | ] |
| | }, |
| | "notificationTypes": [ |
| | "AlarmNotification" |
| | ], |
| | "faultyResourceTypes": [ |
| | "COMPUTE" |
| | ], |
| | "perceivedSeverities": [ |
| | "WARNING" |
| | ], |
| | "eventTypes": [ |
| | "EQUIPMENT_ALARM" |
| | ], |
| | "probableCauses": [ |
| | "The server cannot be connected." |
| | ] |
| | } |
| ID | a7a18ac6-a668-4d94-8ba0-f04c20cfeacd |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnffm/v1/subscriptions/407cb9c5-60f2-43e8-a43a-925c0323c3eb" |
| | } |
| | } |
+--------------+-----------------------------------------------------------------------------------------------------+
After the FM subscription is created, whenever Prometheus sends an alert
to Tacker, Tacker will find a matching FM subscription based on the
information in the alert.
The following is an example of the request body that Prometheus sends
an alert:
.. code-block:: json
{
"receiver": "receiver",
"status": "firing",
"alerts": [
{
"status": "firing",
"labels": {
"receiver_type": "tacker",
"function_type": "vnffm",
"vnf_instance_id": "aad7d2fe-ed51-47da-a20d-7b299860607e",
"pod": "curry-probe-test001-766bdd79bf-wgc7m",
"perceived_severity": "WARNING",
"event_type": "PROCESSING_ERROR_ALARM"
},
"annotations": {
"fault_type": "Server Down",
"probable_cause": "Process Terminated",
"fault_details": "pid 12345"
},
"startsAt": "2022-06-21T23:47:36.453Z",
"endsAt": "0001-01-01T00:00:00Z",
"generatorURL": "http://controller147:9090/graph?g0.expr=up%7Bjob%3D%22node%22%7D+%3D%3D+0&g0.tab=1",
"fingerprint": "5ef77f1f8a3ecb8d"
}
],
"groupLabels": {},
"commonLabels": {
"alertname": "NodeInstanceDown",
"job": "node"
},
"commonAnnotations": {
"description": "sample"
},
"externalURL": "http://controller147:9093",
"version": "4",
"groupKey": "{}:{}",
"truncatedAlerts": 0
}
Finally, a notification is sent to the Callback Uri (i.e. NFVO) in the FM
subscription. NFVO sends a heal request to Tacker according to the
content in the notification.
The format of the heal request can refer to `heal request`_.
The following is an example of the request body that Tacker sends
a notification:
.. code-block:: json
{
"id": "87bea1ed-6ced-403e-8640-2c631eb55d08",
"notificationType": "AlarmNotification",
"subscriptionId": "fb782658-af96-47e7-9faa-90ba8416e426",
"timeStamp": "2021-09-03 10:21:03",
"alarm": {
"id": "78a39661-60a8-4824-b989-88c1b0c3534a",
"managedObjectId": "c61314d0-f583-4ab3-a457-46426bce02d3",
"vnfcInstanceIds": [
"VDU2-curry-probe-test001-766bdd79bf-wgc7m"
],
"alarmRaisedTime": "2021-09-03 10:21:03",
"alarmChangedTime": "",
"alarmClearedTime": "",
"alarmAcknowledgedTime": "",
"ackState": "UNACKNOWLEDGED",
"perceivedSeverity": "WARNING",
"eventTime": "2021-09-03 10:06:03",
"eventType": "EQUIPMENT_ALARM",
"faultType": "",
"probableCause": "The server cannot be connected.",
"isRootCause": "false",
"correlatedAlarmIds": [],
"faultDetails": [],
"_links": {
"self": {
"href": "/vnffm/v1/alarms/78a39661-60a8-4824-b989-88c1b0c3534a"
},
"objectInstance": {
"href": "/vnffm/v1/vnf_instances/c61314d0-f583-4ab3-a457-46426bce02d3"
}
}
},
"_links": {
"subscription": {
"href": "/vnffm/v1/subscriptions/fb782658-af96-47e7-9faa-90ba8416e426"
}
}
}
How to use the CLI of FM interfaces
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get all alarms
^^^^^^^^^^^^^^
Get all alarms can be executed by the following CLI command.
.. code-block:: console
$ openstack vnffm alarm list --os-tacker-api-version 2
Here is an example of getting all alarms:
.. code-block:: console
$ openstack vnffm alarm list --os-tacker-api-version 2
+--------------------------------------+--------------------------------------+--------------+------------------------+--------------------+--------------------+
| ID | Managed Object Id | Ack State | Event Type | Perceived Severity | Probable Cause |
+--------------------------------------+--------------------------------------+--------------+------------------------+--------------------+--------------------+
| 1829331c-4439-4bda-bf57-832fb5786ce9 | fe9b053d-777a-442f-ad24-cfc9fd23b0c4 | ACKNOWLEDGED | PROCESSING_ERROR_ALARM | WARNING | Process Terminated |
| 70935ca5-e03c-4190-8eca-233dd4b2be9a | ca1999fd-44ef-43c0-b3e3-3290a54b2bb4 | ACKNOWLEDGED | PROCESSING_ERROR_ALARM | WARNING | Process Terminated |
+--------------------------------------+--------------------------------------+--------------+------------------------+--------------------+--------------------+
Get the specified alarm
^^^^^^^^^^^^^^^^^^^^^^^
Get the specified alarm can be executed by the following CLI command.
.. code-block:: console
$ openstack vnffm alarm show ALARM_ID --os-tacker-api-version 2
Here is an example of getting the specified alarm:
.. code-block:: console
$ openstack vnffm alarm show 1829331c-4439-4bda-bf57-832fb5786ce9 --os-tacker-api-version 2
+----------------------------+------------------------------------------------------------------------------------------------------+
| Field | Value |
+----------------------------+------------------------------------------------------------------------------------------------------+
| Ack State | ACKNOWLEDGED |
| Alarm Acknowledged Time | 2022-08-30T12:23:52Z |
| Alarm Changed Time | 2022-08-31T07:47:05Z |
| Alarm Cleared Time | 2022-06-22T23:47:36Z |
| Alarm Raised Time | 2022-08-31T07:46:59Z |
| Correlated Alarm Ids | |
| Event Time | 2022-06-21T23:47:36Z |
| Event Type | PROCESSING_ERROR_ALARM |
| Fault Details | [ |
| | "fingerprint: 5ef77f1f8a3ecb8d", |
| | "detail: pid 12345" |
| | ] |
| Fault Type | Server Down |
| ID | 1829331c-4439-4bda-bf57-832fb5786ce9 |
| Is Root Cause | False |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnffm/v1/alarms/1829331c-4439-4bda-bf57-832fb5786ce9" |
| | }, |
| | "objectInstance": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/fe9b053d-777a-442f-ad24-cfc9fd23b0c4" |
| | } |
| | } |
| Managed Object Id | fe9b053d-777a-442f-ad24-cfc9fd23b0c4 |
| Perceived Severity | WARNING |
| Probable Cause | Process Terminated |
| Root Cause Faulty Resource | |
| Vnfc Instance Ids | [ |
| | "VDU2-curry-probe-test001-766bdd79bf-wgc7m" |
| | ] |
+----------------------------+------------------------------------------------------------------------------------------------------+
Change target Alarm
^^^^^^^^^^^^^^^^^^^
Change the ackState of the alarm can be executed by the following CLI
command.
.. code-block:: console
$ openstack vnffm alarm update ALARM_ID --ack-state UNACKNOWLEDGED --os-tacker-api-version 2
.. note::
The value of ``--ack-state`` can only be ``ACKNOWLEDGED`` or
``UNACKNOWLEDGED``.
Here is an example of changing target alarm:
.. code-block:: console
$ openstack vnffm alarm update 1829331c-4439-4bda-bf57-832fb5786ce9 --ack-state UNACKNOWLEDGED --os-tacker-api-version 2
+-----------+----------------+
| Field | Value |
+-----------+----------------+
| Ack State | UNACKNOWLEDGED |
+-----------+----------------+
Create a new FM subscription
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The creation of FM subscription has been introduced in the
:ref:`Notification Mode` above, and the use case of the CLI command
can be referred to there.
Get all FM subscriptions
^^^^^^^^^^^^^^^^^^^^^^^^
Get all FM subscriptions can be executed by the following CLI command.
.. code-block:: console
$ openstack vnffm sub list --os-tacker-api-version 2
Here is an example of getting all FM subscriptions:
.. code-block:: console
$ openstack vnffm sub list --os-tacker-api-version 2
+--------------------------------------+--------------------------------------------------------------------------------+
| ID | Callback Uri |
+--------------------------------------+--------------------------------------------------------------------------------+
| 407cb9c5-60f2-43e8-a43a-925c0323c3eb | http://localhost:9990/notification/callback/test_faultmanagement_interface_max |
| c4f21875-c41d-42a8-967a-3ec7efe1d867 | http://localhost:9990/notification/callback/test_faultmanagement_interface_min |
+--------------------------------------+--------------------------------------------------------------------------------+
Get the specified FM subscription
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Get the specified FM subscription can be executed by the following CLI command.
.. code-block:: console
$ openstack vnffm sub show FM_SUBSCRIPTION_ID --os-tacker-api-version 2
Here is an example of getting the specified FM subscription:
.. code-block:: console
$ openstack vnffm sub show 407cb9c5-60f2-43e8-a43a-925c0323c3eb --os-tacker-api-version 2
+--------------+-----------------------------------------------------------------------------------------------------+
| Field | Value |
+--------------+-----------------------------------------------------------------------------------------------------+
| Callback Uri | http://localhost:9990/notification/callback/test_faultmanagement_interface_max |
| Filter | { |
| | "vnfInstanceSubscriptionFilter": { |
| | "vnfdIds": [ |
| | "4d5ffa3b-9dde-45a9-a805-659dc8df0c02" |
| | ], |
| | "vnfProductsFromProviders": [ |
| | { |
| | "vnfProvider": "Company", |
| | "vnfProducts": [ |
| | { |
| | "vnfProductName": "Sample VNF", |
| | "versions": [ |
| | { |
| | "vnfSoftwareVersion": "1.0", |
| | "vnfdVersions": [ |
| | "1.0" |
| | ] |
| | } |
| | ] |
| | } |
| | ] |
| | } |
| | ], |
| | "vnfInstanceIds": [ |
| | "aad7d2fe-ed51-47da-a20d-7b299860607e" |
| | ], |
| | "vnfInstanceNames": [ |
| | "test" |
| | ] |
| | }, |
| | "notificationTypes": [ |
| | "AlarmNotification", |
| | "AlarmClearedNotification" |
| | ], |
| | "faultyResourceTypes": [ |
| | "COMPUTE" |
| | ], |
| | "perceivedSeverities": [ |
| | "WARNING" |
| | ], |
| | "eventTypes": [ |
| | "PROCESSING_ERROR_ALARM" |
| | ], |
| | "probableCauses": [ |
| | "Process Terminated" |
| | ] |
| | } |
| ID | 407cb9c5-60f2-43e8-a43a-925c0323c3eb |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnffm/v1/subscriptions/407cb9c5-60f2-43e8-a43a-925c0323c3eb" |
| | } |
| | } |
+--------------+-----------------------------------------------------------------------------------------------------+
Delete the specified FM subscription
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Delete the specified FM subscription can be executed by the following CLI
command.
.. code-block:: console
$ openstack vnffm sub delete FM_SUBSCRIPTION_ID --os-tacker-api-version 2
Here is an example of deleting the specified FM subscription:
.. code-block:: console
$ openstack vnffm sub delete a7a18ac6-a668-4d94-8ba0-f04c20cfeacd --os-tacker-api-version 2
VNF FM subscription 'a7a18ac6-a668-4d94-8ba0-f04c20cfeacd' deleted successfully
.. _the sample : https://docs.openstack.org/tacker/latest/user/etsi_cnf_healing.html#how-to-create-vnf-package-for-healing
.. _Prometheus Configuration : https://prometheus.io/docs/prometheus/latest/configuration/configuration/
.. _Prometheus official website : https://prometheus.io/docs/prometheus/latest/getting_started/
.. _ETSI NFV-SOL 002 v3.3.1 : https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/002/03.03.01_60/gs_nfv-sol002v030301p.pdf
.. _ETSI NFV-SOL 003 v3.3.1 : https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/03.03.01_60/gs_nfv-sol003v030301p.pdf
.. _heal request : https://docs.openstack.org/api-ref/nfv-orchestration/v2/vnflcm.html?expanded=heal-a-vnf-instance-v2-detail#heal-a-vnf-instance-v2

View File

@ -1,671 +0,0 @@
===================================================================
ETSI NFV-SOL CNF Auto Scaling With Prometheus via PM Job Interfaces
===================================================================
This document describes how to auto scale CNF in Tacker with Prometheus
via Performance Management Job Interfaces.
Overview
--------
The diagram below shows an overview of the CNF auto scaling.
1. Create PM job
The NFVO sends a request to the Tacker to create a PM job.
2. Set PM job
Prometheus Plugin sets PM job to Prometheus.
3. Trigger event
Prometheus collects metrics and decides whether triggering event is
needed or not.
4. POST event
Prometheus sends POST request to Tacker with specified URI. Tacker
collects data related to the PM event.
5. Convert event to report
Tacker receives informed event, converts it to report, and saves
it to DB. Tacker also saves timestamp of the event.
6. Send report notification
VnfPmDriverV2 finds all jobs in the DB and matches the report to
job. If there is a job that can match successfully, the report is
sent to the specified path of the NFVO. If the match is not successful,
the processing ends.
7. Get PM report
The NFVO make a request for the content of the report, then make a
decision of scaling.
8. Scale
Upon receiving a request to scale VNF from NFVO, tacker-server
redirects it to tacker-conductor.
9. Call Kubernetes API
In tacker-conductor, the request is redirected again to an
appropriate infra-driver (in this case Kubernetes infra-driver)
according to the contents of the instantiate parameters. Then,
Kubernetes infra-driver calls Kubernetes APIs.
10. Change the number of Pods
Kubernetes Master change the number of Pods according to the
API calls.
.. figure:: ../_images/etsi_cnf_auto_scaling_pm.png
:align: left
Prerequisites
-------------
* The following packages should be installed:
* tacker
* python-tackerclient
At least one VNF instance with status of ``INSTANTIATED`` is required.
You can refer to :doc:`./etsi_containerized_vnf_usage_guide` for the
procedure to instantiate VNF.
The VNF Package used can refer to `the sample`_.
* The following third-party services should be installed
* NFVO
* Prometheus(including Alertmanager)
Each operator has its own NFVO, there is no restriction here, as long as
it conforms to `ETSI NFV-SOL 002 v3.3.1`_ and `ETSI NFV-SOL 003 v3.3.1`_,
it can be used.
For the installation of Prometheus and Alertmanager, please refer to
the `official website`_.
How to configure Prometheus Plugin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Prometheus Plugin is disabled by default in Tacker.
For it to work, we need to find ``performance_management`` in
``tacker.conf`` and change its value to ``True``.
.. code-block:: console
$ vi /etc/tacker/tacker.conf
...
[prometheus_plugin]
performance_management = True
[v2_vnfm]
# Enable https access to notification server from Tacker (boolean value)
notification_verify_cert = true
...
After modifying the configuration file, don't forget to restart the
Tacker service to take effect.
.. code-block:: console
$ sudo systemctl stop devstack@tacker
$ sudo systemctl restart devstack@tacker-conductor
$ sudo systemctl start devstack@tacker
.. _Create PM job :
How to create a PM job
~~~~~~~~~~~~~~~~~~~~~~
After having a CNF that can scale, we need to create a PM job. It
determines the monitoring metrics and monitoring resources to be
used by Prometheus.
.. note::
When having an NFVO client, the request is sent by NFVO.
The interface for creating PM jobs is defined in both
`ETSI NFV-SOL 002 v3.3.1`_ and `ETSI NFV-SOL 003 v3.3.1`_.
The following are the parameters required by this interface.
.. list-table:: additional params
:widths: 18 18 10 50
:header-rows: 1
* - Attribute name
- Data type
- Cardinality
- Description
* - objectType
- String
- 1
- Type of the measured object. The applicable measured object type for a
measurement is defined in clause 7.2 of `ETSI GS NFV-IFA 027`_.
* - objectInstanceIds
- Identifier
- 1..N
- Identifiers of the measured object instances for which performance
information is requested to be collected.
* - subObjectInstanceIds
- IdentifierInVnf
- 0..N
- Identifiers of the measured object instances in case of a structured
measured object.
* - criteria
- PmJobCriteria
- 1
- Criteria of the collection of performance information.
* - performanceMetric
- String
- 0..N
- This defines the types of performance metrics for the specified object
instances. Valid values are specified as "Measurement Name" values in
clause 7.2 of `ETSI GS NFV-IFA 027`_. At least one of the two
attributes (performance metric or group) shall be present.
* - performanceMetricGroup
- String
- 0..N
- Group of performance metrics. A metric group is a pre-defined list of
metrics, known to the API producer that it can decompose to individual
metrics. Valid values are specified as "Measurement Group" values in
clause 7.2 of `ETSI GS NFV-IFA 027`_. At least one of the two
attributes (performance metric or group) shall be present.
* - collectionPeriod
- UnsignedInt
- 1
- Specifies the periodicity at which the API producer will collect
performance information. The unit shall be seconds.
* - reportingPeriod
- UnsignedInt
- 1
- Specifies the periodicity at which the API producer will report to
the API consumer. about performance information. The unit shall be
seconds. The reportingPeriod should be equal to or a multiple of
the collectionPeriod.
* - reportingBoundary
- DateTime
- 0..1
- Identifies a time boundary after which the reporting will stop. The
boundary shall allow a single reporting as well as periodic reporting
up to the boundary.
* - callbackUri
- Uri
- 1
- The URI of the endpoint to send the notification to.
* - authentication
- SubscriptionAuthentication
- 0..1
- Authentication parameters to configure the use of Authorization when
sending notifications corresponding to this subscription. See as
clause 8.3.4 of `ETSI GS NFV-SOL 013`_.
* - metadata
- Structure
- 1
- Additional parameters to create PM job.
* - monitoring
- Structure
- 1
- Treats to specify such as monitoring system and driver information.
* - monitorName
- String
- 1
- In case specifying “prometheus”, backend of monitoring feature is
to be Prometheus.
* - driverType
- String
- 1
- “external”: SCP/SFTP for config file transfer.
* - targetsInfo
- Structure
- 1..N
- Information about the target monitoring system.
* - prometheusHost
- String
- 1
- FQDN or ip address of target PrometheusServer.
* - prometheusHostPort
- Int
- 1
- Port of the ssh target PrometheusServer.
* - alertRuleConfigPath
- String
- 1
- Path of alertRuleConfig path for target Prometheus.
* - prometheusReloadApiEndpoint
- String
- 1
- Endpoint url of reload API of target Prometheus.
* - authInfo
- Structure
- 1
- Define authentication information to access host.
* - ssh_username
- String
- 1
- The username of the target host for ssh.
* - ssh_password
- String
- 1
- The password of the target host for ssh.
.. note::
* If ``subObjectInstanceIds`` is present, the cardinality of the
``objectInstanceIds`` attribute shall be 1.
* ``performanceMetric`` and ``performanceMetricGroup``, at least one of
the two attributes shall be present.
* ``objectType`` has only the following values: ``Vnf``, ``Vnfc``,
``VnfIntCp``, ``VnfExtCp``.
Create PM job can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm job create sample_param_file.json --os-tacker-api-version 2
The content of the sample ``sample_param_file.json`` in this document is
as follows:
.. code-block:: json
{
"objectType": "Vnf",
"objectInstanceIds": ["495ffedf-2755-42c8-bf14-a5433701311e"],
"subObjectInstanceIds": [],
"criteria": {
"performanceMetric": [
"VcpuUsageMeanVnf.495ffedf-2755-42c8-bf14-a5433701311e"
],
"performanceMetricGroup": [
"VirtualisedComputeResource"
],
"collectionPeriod": 5,
"reportingPeriod": 10,
"reportingBoundary": "2022-06-23T04:56:00.910Z"
},
"callbackUri": "http://localhost:9990/notification/callback/test_performancemanagement_interface_min_1",
"authentication": {
"authType": [
"BASIC",
"OAUTH2_CLIENT_CREDENTIALS",
"OAUTH2_CLIENT_CERT"
],
"paramsBasic": {
"userName": "nfvo",
"password": "nfvopwd"
},
"paramsOauth2ClientCredentials": {
"clientId": "auth_user_name",
"clientPassword": "auth_password",
"tokenEndpoint": "token_endpoint"
},
"paramsOauth2ClientCert": {
"clientId": "auth_user_name",
"certificateRef": {
"type": "x5t#S256",
"value": "certificate_fingerprint"
},
"tokenEndpoint": "token_endpoint"
}
},
"metadata": {
"monitoring": {
"monitorName": "prometheus",
"driverType": "external",
"targetsInfo": [
{
"prometheusHost": "prometheusHost",
"prometheusHostPort": "22",
"authInfo": {
"ssh_username": "ssh_username",
"ssh_password": "ssh_password"
},
"alertRuleConfigPath": "/etc/prometheus/rules",
"prometheusReloadApiEndpoint": "http://localhost:9990/-/reload"
}
]
}
}
}
Here is an example of create PM job:
.. code-block:: console
$ openstack vnfpm job create sample_param_file.json --os-tacker-api-version 2
+-------------------------+------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+------------------------------------------------------------------------------------------------------------------------+
| Callback Uri | http://localhost:9990/notification/callback/test_performancemanagement_interface_min_1 |
| Criteria | { |
| | "performanceMetric": [ |
| | "VCpuUsageMeanVnf.495ffedf-2755-42c8-bf14-a5433701311e" |
| | ], |
| | "collectionPeriod": 5, |
| | "reportingPeriod": 10 |
| | } |
| ID | ca9b58cf-8493-44e3-9e76-678ea0e80a80 |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnfpm/v2/pm_jobs/ca9b58cf-8493-44e3-9e76-678ea0e80a80" |
| | }, |
| | "objects": [ |
| | { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/495ffedf-2755-42c8-bf14-a5433701311e" |
| | } |
| | ] |
| | } |
| Object Instance Ids | [ |
| | "495ffedf-2755-42c8-bf14-a5433701311e" |
| | ] |
| Object Type | Vnf |
| Reports | [] |
| Sub Object Instance Ids | |
+-------------------------+------------------------------------------------------------------------------------------------------------------------+
When creating a PM job, Tacker will modify the configuration file on the
specified Prometheus based on ``metadata``.
Then Prometheus will monitor the specified resource and send the monitored
information to Tacker.
Tacker converts the received monitoring information into a report and
sends a notification request to NFVO.
The following is the request body of a sample notification request.
.. code-block:: console
{
'id': 'c045dae8-cd94-4a29-b09c-96729060f2ad',
'notificationType': 'PerformanceInformationAvailableNotification',
'timeStamp': '2022-09-05T06:56:39Z',
'pmJobId': '34f7a186-88fa-4a42-a35f-30ea9ad710f1',
'objectType': 'Vnf',
'objectInstanceId': 'e30f5f45-522c-4e84-9b2d-9e1669708fff',
'_links': {
'objectInstance': {
'href': 'http://127.0.0.1:9890/vnflcm/v2/vnf_instances/e30f5f45-522c-4e84-9b2d-9e1669708fff'
},
'pmJob': {
'href': 'http://127.0.0.1:9890/vnfpm/v2/pm_jobs/34f7a186-88fa-4a42-a35f-30ea9ad710f1'
},
'performanceReport': {
'href': 'http://127.0.0.1:9890/vnfpm/v2/pm_jobs/34f7a186-88fa-4a42-a35f-30ea9ad710f1/reports/46e95584-7f11-4fd0-b59c-4688c37177ff'
}
}
}
.. note::
The target URL of this notification request is the ``Callback Uri``
field in the PM job.
How does NFVO Auto Scale CNF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NFVO will send a get PM report request to Tacker according to the URL
of the report in the notification request.
The response returned by Tacker is as follows:
.. code-block:: console
{
'entries': [
{
'objectType': 'Vnf',
'objectInstanceId': 'e30f5f45-522c-4e84-9b2d-9e1669708fff',
'subObjectInstanceId': 'VDU2-curry-probe-test001-766bdd79bf-wgc7m',
'performanceMetric': 'VCpuUsageMeanVnf.e30f5f45-522c-4e84-9b2d-9e1669708fff',
'performanceValues': [
{
'timeStamp': '2022-09-05T08:02:58Z',
'value': 99.0
}
]
}
]
}
NFVO will determine whether a scale operation is required based on
the report data. If needed, a scale request will be sent to Tacker.
How to use the CLI of PM interfaces
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create a PM job
^^^^^^^^^^^^^^^
The creation of PM job has been introduced in the
:ref:`Create PM job` above, and the use case of the CLI
command can be referred to there.
Get all PM jobs
^^^^^^^^^^^^^^^
Get all PM jobs can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm job list --os-tacker-api-version 2
Here is an example of getting all PM jobs:
.. code-block:: console
$ openstack vnfpm job list --os-tacker-api-version 2
+--------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| Id | Object Type | Links |
+--------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| b8b4095a-148d-42b5-b714-9d703e6c7c62 | Vnf | { |
| | | "self": { |
| | | "href": "http://127.0.0.1:9890/vnfpm/v2/pm_jobs/b8b4095a-148d-42b5-b714-9d703e6c7c62" |
| | | }, |
| | | "objects": [ |
| | | { |
| | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/97efce79-34c4-474d-87a0-38ad954f64af" |
| | | } |
| | | ] |
| | | } |
| ca9b58cf-8493-44e3-9e76-678ea0e80a80 | Vnf | { |
| | | "self": { |
| | | "href": "http://127.0.0.1:9890/vnfpm/v2/pm_jobs/ca9b58cf-8493-44e3-9e76-678ea0e80a80" |
| | | }, |
| | | "objects": [ |
| | | { |
| | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/495ffedf-2755-42c8-bf14-a5433701311e" |
| | | } |
| | | ] |
| | | } |
+--------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
Get the specified PM job
^^^^^^^^^^^^^^^^^^^^^^^^
Get the specified PM job can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm job show JOB_ID --os-tacker-api-version 2
Here is an example of getting the specified PM job:
.. code-block:: console
$ openstack vnfpm job show ca9b58cf-8493-44e3-9e76-678ea0e80a80 --os-tacker-api-version 2
+-------------------------+------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+------------------------------------------------------------------------------------------------------------------------+
| Callback Uri | http://localhost:9990/notification/callback/test_performancemanagement_interface_min_1 |
| Criteria | { |
| | "performanceMetric": [ |
| | "VCpuUsageMeanVnf.495ffedf-2755-42c8-bf14-a5433701311e" |
| | ], |
| | "collectionPeriod": 5, |
| | "reportingPeriod": 10 |
| | } |
| ID | ca9b58cf-8493-44e3-9e76-678ea0e80a80 |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnfpm/v2/pm_jobs/ca9b58cf-8493-44e3-9e76-678ea0e80a80" |
| | }, |
| | "objects": [ |
| | { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/495ffedf-2755-42c8-bf14-a5433701311e" |
| | } |
| | ] |
| | } |
| Object Instance Ids | [ |
| | "495ffedf-2755-42c8-bf14-a5433701311e" |
| | ] |
| Object Type | Vnf |
| Reports | [ |
| | { |
| | "href": "/vnfpm/v2/pm_jobs/ca9b58cf-8493-44e3-9e76-678ea0e80a80/reports/53aafe25-7124-4880-8b58-47a93b3dc371", |
| | "readyTime": "2022-08-30T08:02:58Z" |
| | } |
| | ] |
| Sub Object Instance Ids | |
+-------------------------+------------------------------------------------------------------------------------------------------------------------+
Change target PM job
^^^^^^^^^^^^^^^^^^^^
Updating a PM job can only change two fields, callbackUri and authentication.
It can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm job update JOB_ID sample_param_file.json --os-tacker-api-version 2
The content of the sample ``sample_param_file.json`` in this document is
as follows:
.. code-block:: json
{
"callbackUri": "http://localhost:9990/notification/callback",
"authentication": {
"authType": [
"BASIC",
"OAUTH2_CLIENT_CREDENTIALS",
"OAUTH2_CLIENT_CERT"
],
"paramsBasic": {
"userName": "nfvo",
"password": "nfvopwd"
},
"paramsOauth2ClientCredentials": {
"clientId": "auth_user_name",
"clientPassword": "auth_password",
"tokenEndpoint": "token_endpoint"
},
"paramsOauth2ClientCert": {
"clientId": "auth_user_name",
"certificateRef": {
"type": "x5t#S256",
"value": "certificate_fingerprint"
},
"tokenEndpoint": "token_endpoint"
}
}
}
Here is an example of changing target PM job:
.. code-block:: console
$ openstack vnfpm job update ca9b58cf-8493-44e3-9e76-678ea0e80a80 sample_param_file.json --os-tacker-api-version 2
+-------------------------+------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+------------------------------------------------------------------------------------------------------------------------+
| Callback Uri | http://localhost:9990/notification/callback |
| Criteria | { |
| | "performanceMetric": [ |
| | "VCpuUsageMeanVnf.495ffedf-2755-42c8-bf14-a5433701311e" |
| | ], |
| | "collectionPeriod": 5, |
| | "reportingPeriod": 10 |
| | } |
| ID | ca9b58cf-8493-44e3-9e76-678ea0e80a80 |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnfpm/v2/pm_jobs/ca9b58cf-8493-44e3-9e76-678ea0e80a80" |
| | }, |
| | "objects": [ |
| | { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/495ffedf-2755-42c8-bf14-a5433701311e" |
| | } |
| | ] |
| | } |
| Object Instance Ids | [ |
| | "495ffedf-2755-42c8-bf14-a5433701311e" |
| | ] |
| Object Type | Vnf |
| Reports | [] |
| Sub Object Instance Ids | |
+-------------------------+------------------------------------------------------------------------------------------------------------------------+
Delete the specified PM job
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Delete the specified PM job can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm job delete JOB_ID --os-tacker-api-version 2
Here is an example of deleting the specified PM job:
.. code-block:: console
$ openstack vnfpm job delete ca9b58cf-8493-44e3-9e76-678ea0e80a80 --os-tacker-api-version 2
VNF PM job 'ca9b58cf-8493-44e3-9e76-678ea0e80a80' deleted successfully
Get the specified PM report
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Get the specified PM report can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm report show JOB_ID REPORT_ID --os-tacker-api-version 2
Here is an example of getting the specified PM report:
.. code-block:: console
$ openstack vnfpm report show ca9b58cf-8493-44e3-9e76-678ea0e80a80 53aafe25-7124-4880-8b58-47a93b3dc371 --os-tacker-api-version 2
+---------+---------------------------------------------------------------------------------------+
| Field | Value |
+---------+---------------------------------------------------------------------------------------+
| Entries | [ |
| | { |
| | "objectType": "Vnf", |
| | "objectInstanceId": "495ffedf-2755-42c8-bf14-a5433701311e", |
| | "performanceMetric": "VCpuUsageMeanVnf.495ffedf-2755-42c8-bf14-a5433701311e", |
| | "performanceValues": [ |
| | { |
| | "timeStamp": "2022-08-30T08:02:58Z", |
| | "value": "99.0" |
| | } |
| | ] |
| | } |
| | ] |
+---------+---------------------------------------------------------------------------------------+
.. _ETSI NFV-SOL 002 v3.3.1 : https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/002/03.03.01_60/gs_nfv-sol002v030301p.pdf
.. _ETSI NFV-SOL 003 v3.3.1 : https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/03.03.01_60/gs_nfv-sol003v030301p.pdf
.. _official website : https://prometheus.io/docs/prometheus/latest/getting_started/
.. _the sample : https://docs.openstack.org/tacker/latest/user/etsi_cnf_scaling.html#how-to-create-vnf-package-for-scaling
.. _ETSI GS NFV-IFA 027 : https://www.etsi.org/deliver/etsi_gs/NFV-IFA/001_099/027/03.03.01_60/gs_nfv-ifa027v030301p.pdf
.. _ETSI GS NFV-SOL 013 : https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/013/03.04.01_60/gs_nfv-sol013v030401p.pdf

View File

@ -1,527 +0,0 @@
=========================================================================
ETSI NFV-SOL CNF Auto Scaling With Prometheus via PM Threshold Interfaces
=========================================================================
This document describes how to auto scale CNF in Tacker with Prometheus
via Performance Management Threshold Interfaces.
Overview
--------
The diagram below shows an overview of the CNF auto scaling.
1. Create PM threshold
The NFVO sends a request to the Tacker to create a PM threshold.
2. Set PM threshold
Prometheus Plugin sets PM threshold to Prometheus.
3. Trigger threshold event
Prometheus collects metrics and decides whether triggering threshold event
is needed or not.
4. POST threshold event
Prometheus sends POST request to Tacker with specified URI. Tacker
collects data related to the PM threshold event.
5. Convert threshold event to threshold state
Tacker receives informed threshold event, converts it to threshold state,
and saves it to DB.
6. Send threshold state notification
VnfPmDriverV2 finds all thresholds in the DB and matches the threshold
state to threshold. If the crossingDirection of threshold state is ``UP``
or ``DOWN``, the notification is sent to the specified path of the NFVO.
If the match is not successful or the situation does not exist, the
processing ends.
7. Scale
Upon receiving a request to scale VNF from NFVO, tacker-server
redirects it to tacker-conductor.
8. Call Kubernetes API
In tacker-conductor, the request is redirected again to an
appropriate infra-driver (in this case Kubernetes infra-driver)
according to the contents of the instantiate parameters. Then,
Kubernetes infra-driver calls Kubernetes APIs.
9. Change the number of Pods
Kubernetes Master change the number of Pods according to the
API calls.
.. figure:: ../_images/etsi_cnf_auto_scaling_pm_threshold.png
:align: left
Prerequisites
-------------
* The following packages should be installed:
* tacker
* python-tackerclient
At least one VNF instance with status of ``INSTANTIATED`` is required.
You can refer to :doc:`./etsi_containerized_vnf_usage_guide` for the
procedure to instantiate VNF.
The VNF Package used can refer to `the sample`_.
* The following third-party services should be installed
* NFVO
* Prometheus(including Alertmanager)
Each operator has its own NFVO, there is no restriction here, as long as
it conforms to `ETSI NFV-SOL 002 v3.3.1`_ and `ETSI NFV-SOL 003 v3.3.1`_,
it can be used.
For the installation of Prometheus and Alertmanager, please refer to
the `official website`_.
How to configure Prometheus Plugin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please refer to `How to configure Prometheus Plugin`_ to enable the
Prometheus Plugin.
.. _Create PM threshold :
How to create a PM threshold
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
After having a CNF that can scale, we need to create a PM threshold. It
determines the monitoring metrics and monitoring resources to be
used by Prometheus.
.. note::
When having an NFVO client, the request is sent by NFVO.
The interface for creating PM thresholds is defined in both
`ETSI NFV-SOL 002 v3.3.1`_ and `ETSI NFV-SOL 003 v3.3.1`_.
The following are the parameters required by this interface.
.. list-table:: additional params
:widths: 18 18 10 50
:header-rows: 1
* - Attribute name
- Data type
- Cardinality
- Description
* - objectType
- String
- 1
- Type of the measured object. The applicable measured object type for a
measurement is defined in clause 7.2 of `ETSI GS NFV-IFA 027`_.
* - objectInstanceId
- Identifier
- 1
- Identifiers of the measured object instances for which performance
information is requested to be collected.
* - subObjectInstanceIds
- IdentifierInVnf
- 0..N
- Identifiers of the measured object instances in case of a structured
measured object.
* - criteria
- ThresholdCriteria
- 1
- Criteria of the collection of performance information.
* - performanceMetric
- String
- 1
- This defines the types of performance metrics for the specified object
instances. Valid values are specified as "Measurement Name" values in
clause 7.2 of `ETSI GS NFV-IFA 027`_.
* - thresholdType
- String
- 1
- This defines the type of threshold. This attribute determines which other
attributes are present in the data structure.
* - simpleThresholdDetails
- Structure
- 0..1
- Details of a simple threshold. Shall be present if
thresholdType="SIMPLE".
* - thresholdValue
- Float
- 1
- The threshold value. Shall be represented as a floating point number.
* - hysteresis
- Float
- 1
- The hysteresis of the threshold. Shall be represented as a non-negative
floating point number.
* - callbackUri
- Uri
- 1
- The URI of the endpoint to send the notification to.
* - authentication
- SubscriptionAuthentication
- 0..1
- Authentication parameters to configure the use of Authorization when
sending notifications corresponding to this subscription. See as
clause 8.3.4 of `ETSI GS NFV-SOL 013`_.
* - metadata
- Structure
- 1
- Additional parameters to create PM threshold.
* - monitoring
- Structure
- 1
- Treats to specify such as monitoring system and driver information.
* - monitorName
- String
- 1
- In case specifying "prometheus", backend of monitoring feature is
to be Prometheus.
* - driverType
- String
- 1
- "external": SCP/SFTP for config file transfer.
* - targetsInfo
- Structure
- 1..N
- Information about the target monitoring system.
* - prometheusHost
- String
- 1
- FQDN or ip address of target PrometheusServer.
* - prometheusHostPort
- Int
- 1
- Port of the ssh target PrometheusServer.
* - alertRuleConfigPath
- String
- 1
- Path of alertRuleConfig path for target Prometheus.
* - prometheusReloadApiEndpoint
- String
- 1
- Endpoint url of reload API of target Prometheus.
* - authInfo
- Structure
- 1
- Define authentication information to access host.
* - ssh_username
- String
- 1
- The username of the target host for ssh.
* - ssh_password
- String
- 1
- The password of the target host for ssh.
.. note::
* ``objectType`` has only the following values: ``Vnf``, ``Vnfc``,
``VnfIntCp``, ``VnfExtCp``.
Create PM threshold can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm threshold create sample_param_file.json --os-tacker-api-version 2
The content of the sample ``sample_param_file.json`` in this document is
as follows:
.. code-block:: json
{
"objectType": "Vnf",
"objectInstanceId": "511a2d68-c975-4913-b7b8-d75468e3102b",
"subObjectInstanceIds": [],
"criteria": {
"performanceMetric": "VMemoryUsageMeanVnf.511a2d68-c975-4913-b7b8-d75468e3102b",
"thresholdType": "SIMPLE",
"simpleThresholdDetails": {
"thresholdValue": 55,
"hysteresis": 30
}
},
"callbackUri": "http://localhost:9990/notification/callbackuri/511a2d68-c975-4913-b7b8-d75468e3102b",
"authentication": {
"authType": [
"BASIC",
"OAUTH2_CLIENT_CREDENTIALS",
"OAUTH2_CLIENT_CERT"
],
"paramsBasic": {
"userName": "nfvo",
"password": "nfvopwd"
},
"paramsOauth2ClientCredentials": {
"clientId": "auth_user_name",
"clientPassword": "auth_password",
"tokenEndpoint": "token_endpoint"
},
"paramsOauth2ClientCert": {
"clientId": "auth_user_name",
"certificateRef": {
"type": "x5t#S256",
"value": "certificate_fingerprint"
},
"tokenEndpoint": "token_endpoint"
}
},
"metadata": {
"monitoring": {
"monitorName": "prometheus",
"driverType": "external",
"targetsInfo": [
{
"prometheusHost": "prometheusHost",
"prometheusHostPort": "22",
"authInfo": {
"ssh_username": "ssh_username",
"ssh_password": "ssh_password"
},
"alertRuleConfigPath": "/etc/prometheus/rules",
"prometheusReloadApiEndpoint": "http://localhost:9990/-/reload"
}
]
}
}
}
Here is an example of create PM threshold:
.. code-block:: console
$ openstack vnfpm threshold create sample_param_file.json --os-tacker-api-version 2
+-------------------------+------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+------------------------------------------------------------------------------------------------------+
| Callback Uri | http://127.0.0.1:9990/notification/callbackuri/511a2d68-c975-4913-b7b8-d75468e3102b |
| Criteria | { |
| | "performanceMetric": "VMemoryUsageMeanVnf.511a2d68-c975-4913-b7b8-d75468e3102b", |
| | "thresholdType": "SIMPLE", |
| | "simpleThresholdDetails": { |
| | "thresholdValue": 55.0, |
| | "hysteresis": 30.0 |
| | } |
| | } |
| ID | 4787c544-c3d0-4aeb-bf60-1598125c3d4f |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnfpm/v2/thresholds/4787c544-c3d0-4aeb-bf60-1598125c3d4f" |
| | }, |
| | "object": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/511a2d68-c975-4913-b7b8-d75468e3102b" |
| | } |
| | } |
| Object Instance Id | 511a2d68-c975-4913-b7b8-d75468e3102b |
| Object Type | Vnf |
| Sub Object Instance Ids | |
+-------------------------+------------------------------------------------------------------------------------------------------+
When creating a PM threshold, Tacker will modify the configuration file on the
specified Prometheus based on ``metadata``.
Then Prometheus will monitor the specified resource and send the monitored
information to Tacker.
Tacker converts the received monitoring information into a threshold state and
sends a notification request to NFVO.
The following is the request body of a sample notification request.
.. code-block:: json
{
"id": "ec3cfe7b-aef4-4d66-9b65-15fe6a589b2e",
"notificationType": "PerformanceThresholdNotification",
"timeStamp": "2023-02-10T02:39:07Z",
"thresholdId": "4787c544-c3d0-4aeb-bf60-1598125c3d4f",
"crossingDirection": "DOWN",
"objectType": "Vnf",
"objectInstanceId": "511a2d68-c975-4913-b7b8-d75468e3102b",
"performanceMetric": "VMemoryUsageMeanVnf.511a2d68-c975-4913-b7b8-d75468e3102b",
"performanceValue": "0.0014381563014867896",
"_links": {
"objectInstance": {
"href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/511a2d68-c975-4913-b7b8-d75468e3102b"
},
"threshold": {
"href": "http://127.0.0.1:9890/vnfpm/v2/thresholds/4787c544-c3d0-4aeb-bf60-1598125c3d4f"
}
}
}
.. note::
The target URL of this notification request is the ``Callback Uri``
field in the PM threshold.
How does NFVO Auto Scale CNF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NFVO will determine whether a scale operation is required based on
the notification data. If needed, a scale request will be sent to Tacker.
How to use the CLI of PM interfaces
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create a PM threshold
^^^^^^^^^^^^^^^^^^^^^
The creation of PM threshold has been introduced in the
:ref:`Create PM threshold` above, and the use case of the CLI
command can be referred to there.
Get all PM thresholds
^^^^^^^^^^^^^^^^^^^^^
Get all PM thresholds can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm threshold list --os-tacker-api-version 2
Here is an example of getting all PM thresholds:
.. code-block:: console
$ openstack vnfpm threshold list --os-tacker-api-version 2
+--------------------------------------+-------------+------------------------------------------------------------------------------------------------------+
| ID | Object Type | Links |
+--------------------------------------+-------------+------------------------------------------------------------------------------------------------------+
| 682eb763-a976-4a7a-b6a6-a40787d25dbb | Vnf | { |
| | | "self": { |
| | | "href": "http://127.0.0.1:9890/vnfpm/v2/thresholds/682eb763-a976-4a7a-b6a6-a40787d25dbb" |
| | | }, |
| | | "object": { |
| | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/511a2d68-c975-4913-b7b8-d75468e3102b" |
| | | } |
| | | } |
+--------------------------------------+-------------+------------------------------------------------------------------------------------------------------+
Get the specified PM threshold
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Get the specified PM threshold can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm threshold show THRESHOLD_ID --os-tacker-api-version 2
Here is an example of getting the specified PM threshold:
.. code-block:: console
$ openstack vnfpm threshold show 682eb763-a976-4a7a-b6a6-a40787d25dbb --os-tacker-api-version 2
+-------------------------+------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+------------------------------------------------------------------------------------------------------+
| Callback Uri | http://127.0.0.1:9990/notification/callbackuri/511a2d68-c975-4913-b7b8-d75468e3102b |
| Criteria | { |
| | "performanceMetric": "VMemoryUsageMeanVnf.511a2d68-c975-4913-b7b8-d75468e3102b", |
| | "thresholdType": "SIMPLE", |
| | "simpleThresholdDetails": { |
| | "thresholdValue": 55.0, |
| | "hysteresis": 30.0 |
| | } |
| | } |
| ID | 682eb763-a976-4a7a-b6a6-a40787d25dbb |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnfpm/v2/thresholds/682eb763-a976-4a7a-b6a6-a40787d25dbb" |
| | }, |
| | "object": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/511a2d68-c975-4913-b7b8-d75468e3102b" |
| | } |
| | } |
| Object Instance Id | 511a2d68-c975-4913-b7b8-d75468e3102b |
| Object Type | Vnf |
| Sub Object Instance Ids | |
+-------------------------+------------------------------------------------------------------------------------------------------+
Change target PM threshold
^^^^^^^^^^^^^^^^^^^^^^^^^^
Updating a PM threshold can only change two fields, callbackUri and
authentication.
It can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm threshold update THRESHOLD_ID sample_param_file.json --os-tacker-api-version 2
The content of the sample ``sample_param_file.json`` in this document is
as follows:
.. code-block:: json
{
"callbackUri": "http://127.0.0.1:9990/notification/callbackuri/callbackUri",
"authentication": {
"authType": [
"BASIC",
"OAUTH2_CLIENT_CREDENTIALS",
"OAUTH2_CLIENT_CERT"
],
"paramsBasic": {
"userName": "nfvo",
"password": "nfvopwd"
},
"paramsOauth2ClientCredentials": {
"clientId": "auth_user_name",
"clientPassword": "password",
"tokenEndpoint": "token_endpoint"
},
"paramsOauth2ClientCert": {
"clientId": "auth_user_name",
"certificateRef": {
"type": "x5t#S256",
"value": "certificate_fingerprint"
},
"tokenEndpoint": "token_endpoint"
}
}
}
Here is an example of changing target PM threshold:
.. code-block:: console
$ openstack vnfpm threshold update 682eb763-a976-4a7a-b6a6-a40787d25dbb sample_param_file.json --os-tacker-api-version 2
+----------------+------------------------------------------------------------+
| Field | Value |
+----------------+------------------------------------------------------------+
| Callback Uri | http://127.0.0.1:9990/notification/callbackuri/callbackUri |
+----------------+------------------------------------------------------------+
Delete the specified PM threshold
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Delete the specified PM threshold can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm threshold delete THRESHOLD_ID --os-tacker-api-version 2
Here is an example of deleting the specified PM threshold:
.. code-block:: console
$ openstack vnfpm threshold delete 682eb763-a976-4a7a-b6a6-a40787d25dbb --os-tacker-api-version 2
VNF PM threshold '682eb763-a976-4a7a-b6a6-a40787d25dbb' deleted successfully
.. _ETSI NFV-SOL 002 v3.3.1 : https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/002/03.03.01_60/gs_nfv-sol002v030301p.pdf
.. _ETSI NFV-SOL 003 v3.3.1 : https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/03.03.01_60/gs_nfv-sol003v030301p.pdf
.. _official website : https://prometheus.io/docs/prometheus/latest/getting_started/
.. _the sample : https://docs.openstack.org/tacker/latest/user/etsi_cnf_scaling.html#how-to-create-vnf-package-for-scaling
.. _ETSI GS NFV-IFA 027 : https://www.etsi.org/deliver/etsi_gs/NFV-IFA/001_099/027/03.03.01_60/gs_nfv-ifa027v030301p.pdf
.. _ETSI GS NFV-SOL 013 : https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/013/03.04.01_60/gs_nfv-sol013v030401p.pdf
.. _How to configure Prometheus Plugin : https://docs.openstack.org/tacker/latest/user/etsi_cnf_auto_scaling_pm.html#how-to-configure-prometheus-plugin

View File

@ -2,7 +2,13 @@
ETSI NFV-SOL CNF Healing
========================
This document describes how to heal CNF in Tacker.
This document describes how to heal CNF in Tacker v1 API.
.. note::
This is a document for Tacker v1 API.
See :doc:`/user/v2/cnf/heal/index` for Tacker v2 API.
Overview
--------
@ -17,17 +23,16 @@ The diagram below shows an overview of the CNF healing.
2. Call Kubernetes API
Upon receiving a request from tacker-client, tacker-server redirects it to
tacker-conductor. In tacker-conductor, the request is redirected again to
tacker-conductor. In tacker-conductor, the request is redirected again to
an appropriate infra-driver (in this case Kubernetes infra-driver) according
to the contents of the instantiate parameters. Then, Kubernetes
to the contents of the instantiate parameters. Then, Kubernetes
infra-driver calls Kubernetes APIs.
3. Re-create Pods
Kubernetes Master re-creates Pods according to the API calls.
.. figure:: ../_images/etsi_cnf_healing.png
:align: left
.. figure:: /_images/etsi_cnf_healing.png
Prerequisites
@ -40,10 +45,11 @@ The following packages should be installed:
The procedure of prepare for healing operation that from "register VIM" to
"Instantiate VNF", basically refer to
:doc:`./etsi_containerized_vnf_usage_guide`.
:doc:`/user/etsi_containerized_vnf_usage_guide`.
This procedure uses an example using the sample VNF package.
How to Create VNF Package for Healing
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Using `samples/tests/etc/samples/etsi/nfv/test_cnf_heal`_,
@ -59,19 +65,21 @@ on TOSCA specifications.
.. code-block:: console
$ cd Definitions
$ wget https://forge.etsi.org/rep/nfv/SOL001/raw/v2.6.1/etsi_nfv_sol001_common_types.yaml
$ wget https://forge.etsi.org/rep/nfv/SOL001/raw/v2.6.1/etsi_nfv_sol001_vnfd_types.yaml
$ cd Definitions
$ wget https://forge.etsi.org/rep/nfv/SOL001/raw/v2.6.1/etsi_nfv_sol001_common_types.yaml
$ wget https://forge.etsi.org/rep/nfv/SOL001/raw/v2.6.1/etsi_nfv_sol001_vnfd_types.yaml
CSAR Package should be compressed into a ZIP file for uploading.
Following commands are an example of compressing a VNF Package:
.. code-block:: console
$ cd -
$ zip deployment.zip -r Definitions/ Files/ TOSCA-Metadata/
$ ls
Definitions deployment.zip Files TOSCA-Metadata
$ cd -
$ zip deployment.zip -r Definitions/ Files/ TOSCA-Metadata/
$ ls
Definitions deployment.zip Files TOSCA-Metadata
After creating a vnf package with :command:`openstack vnf package create`,
some information including ID, Links,
@ -79,26 +87,28 @@ Onboarding State, Operational State, and Usage State will be returned.
When the Onboarding State is CREATED, the Operational State is DISABLED,
and the Usage State is NOT_IN_USE, indicate the creation is successful.
.. code-block:: console
$ openstack vnf package create
+-------------------+-------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------+-------------------------------------------------------------------------------------------------+
| ID | 08d00a5c-e8aa-4219-9412-411458eaa7d2 |
| Links | { |
| | "self": { |
| | "href": "/vnfpkgm/v1/vnf_packages/08d00a5c-e8aa-4219-9412-411458eaa7d2" |
| | }, |
| | "packageContent": { |
| | "href": "/vnfpkgm/v1/vnf_packages/08d00a5c-e8aa-4219-9412-411458eaa7d2/package_content" |
| | } |
| | } |
| Onboarding State | CREATED |
| Operational State | DISABLED |
| Usage State | NOT_IN_USE |
| User Defined Data | {} |
+-------------------+-------------------------------------------------------------------------------------------------+
$ openstack vnf package create
+-------------------+-------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------+-------------------------------------------------------------------------------------------------+
| ID | 094c8abf-b5c8-45a1-9332-3952a710c65c |
| Links | { |
| | "self": { |
| | "href": "/vnfpkgm/v1/vnf_packages/094c8abf-b5c8-45a1-9332-3952a710c65c" |
| | }, |
| | "packageContent": { |
| | "href": "/vnfpkgm/v1/vnf_packages/094c8abf-b5c8-45a1-9332-3952a710c65c/package_content" |
| | } |
| | } |
| Onboarding State | CREATED |
| Operational State | DISABLED |
| Usage State | NOT_IN_USE |
| User Defined Data | {} |
+-------------------+-------------------------------------------------------------------------------------------------+
Upload the CSAR zip file to the VNF Package by running the following command
:command:`openstack vnf package upload --path <path of vnf package> <vnf package ID>`.
@ -106,8 +116,9 @@ Here is an example of uploading VNF package:
.. code-block:: console
$ openstack vnf package upload --path deployment.zip 08d00a5c-e8aa-4219-9412-411458eaa7d2
Upload request for VNF package 08d00a5c-e8aa-4219-9412-411458eaa7d2 has been accepted.
$ openstack vnf package upload --path deployment.zip 094c8abf-b5c8-45a1-9332-3952a710c65c
Upload request for VNF package 094c8abf-b5c8-45a1-9332-3952a710c65c has been accepted.
Create VNF instance by running :command:`openstack vnflcm create <VNFD ID>`.
@ -116,27 +127,29 @@ Here is an example of creating VNF :
.. code-block:: console
$ openstack vnflcm create b1bb0ce7-ebca-4fa7-95ed-4840d70a1177
+--------------------------+---------------------------------------------------------------------------------------------+
| Field | Value |
+--------------------------+---------------------------------------------------------------------------------------------+
| ID | 92cf0ccb-e575-46e2-9c0d-30c67e75aaf6 |
| Instantiation State | NOT_INSTANTIATED |
| Links | { |
| | "self": { |
| | "href": "/vnflcm/v1/vnf_instances/92cf0ccb-e575-46e2-9c0d-30c67e75aaf6" |
| | }, |
| | "instantiate": { |
| | "href": "/vnflcm/v1/vnf_instances/92cf0ccb-e575-46e2-9c0d-30c67e75aaf6/instantiate" |
| | } |
| | } |
| VNF Instance Description | None |
| VNF Instance Name | None |
| VNF Product Name | Sample VNF |
| VNF Provider | Company |
| VNF Software Version | 1.0 |
| VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
| VNFD Version | 1.0 |
+--------------------------+---------------------------------------------------------------------------------------------+
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
| ID | 2a9a1197-953b-4f0a-b510-5ab4ab979959 |
| Instantiation State | NOT_INSTANTIATED |
| Links | { |
| | "self": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/2a9a1197-953b-4f0a-b510-5ab4ab979959" |
| | }, |
| | "instantiate": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/2a9a1197-953b-4f0a-b510-5ab4ab979959/instantiate" |
| | } |
| | } |
| VNF Configurable Properties | |
| VNF Instance Description | |
| VNF Instance Name | vnf-2a9a1197-953b-4f0a-b510-5ab4ab979959 |
| 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 | |
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
After the command is executed, instantiate VNF.
@ -148,31 +161,28 @@ described in ``deployment_heal_simple.yaml``. Please note that ``additionalParam
includes path of Kubernetes resource definition file and that
``lcm-kubernetes-def-files`` should be a list.
.. code-block:: console
$ cat ./instance_kubernetes.json
{
"flavourId": "simple",
"additionalParams": {
"lcm-kubernetes-def-files": [
"Files/kubernetes/deployment_heal_simple.yaml"
]
},
"vimConnectionInfo": [
{
"id": "8a3adb69-0784-43c7-833e-aab0b6ab4470",
"vimId": "8d8373fe-6977-49ff-83ac-7756572ed186",
"vimType": "kubernetes"
}
$ cat ./instance_kubernetes.json
{
"flavourId": "simple",
"additionalParams": {
"lcm-kubernetes-def-files": [
"Files/kubernetes/deployment_heal_simple.yaml"
]
}
$ openstack vnflcm instantiate 92cf0ccb-e575-46e2-9c0d-30c67e75aaf6 instance_kubernetes.json
Instantiate request for VNF Instance 92cf0ccb-e575-46e2-9c0d-30c67e75aaf6 has been accepted.
},
"vimConnectionInfo": [
{
"id": "8a3adb69-0784-43c7-833e-aab0b6ab4470",
"vimId": "43176042-ca97-4954-9bd5-0a9c054885e1",
"vimType": "kubernetes"
}
]
}
$ openstack vnflcm instantiate 2a9a1197-953b-4f0a-b510-5ab4ab979959 instance_kubernetes.json
Instantiate request for VNF Instance 2a9a1197-953b-4f0a-b510-5ab4ab979959 has been accepted.
.. note::
In the case of version 2 API, you can also set
``vimType`` as ``ETSINFV.KUBERNETES.V_1`` in ``vimConnectionInfo``.
CNF Healing Procedure
---------------------
@ -180,7 +190,7 @@ CNF Healing Procedure
As mentioned in Prerequisites and Healing target VNF instance, the VNF must be
instantiated before healing.
Details of CLI commands are described in :doc:`../cli/cli-etsi-vnflcm`.
Details of CLI commands are described in :doc:`/cli/cli-etsi-vnflcm`.
There are two main methods for CNF healing.
@ -194,11 +204,12 @@ There are two main methods for CNF healing.
resources of Kubernetes such as Deployment, DaemonSet, StatefulSet and
ReplicaSet.
.. note:: A VNFC is a 'VNF Component', and one VNFC basically corresponds to
one VDU in the VNF. For more information on VNFC, see
`NFV-SOL002 v2.6.1`_.
.. note::
A VNFC is a 'VNF Component', and one VNFC basically corresponds to
one VDU in the VNF. For more information on VNFC, see
`NFV-SOL002 v2.6.1`_.
.. _labelCapHealingtargetVNFinstance:
Healing Target VNF Instance
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -211,77 +222,98 @@ This instance will be healed.
$ openstack vnflcm show VNF_INSTANCE_ID
Result:
.. code-block:: console
+--------------------------+-------------------------------------------------------------------------------------------+
| Field | Value |
+--------------------------+-------------------------------------------------------------------------------------------+
| ID | 92cf0ccb-e575-46e2-9c0d-30c67e75aaf6 |
| Instantiated Vnf Info | { |
| | "flavourId": "simple", |
| | "vnfState": "STARTED", |
| | "scaleStatus": [ |
| | { |
| | "aspectId": "vdu1_aspect", |
| | "scaleLevel": 0 |
| | } |
| | ], |
| | "extCpInfo": [], |
| | "vnfcResourceInfo": [ |
| | { |
| | "id": "686b356f-8096-4e24-99e5-3c81d36341be", |
| | "vduId": "VDU1", |
| | "computeResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "vdu1-heal-simple-75b5566444-wgc7m", |
| | "vimLevelResourceType": "Deployment" |
| | }, |
| | "storageResourceIds": [] |
| | }, |
| | { |
| | "id": "73cb41e7-31ae-494b-b4d0-66b8168c257e", |
| | "vduId": "VDU1", |
| | "computeResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "vdu1-heal-simple-75b5566444-wwzcm", |
| | "vimLevelResourceType": "Deployment" |
| | }, |
| | "storageResourceIds": [] |
| | } |
| | ], |
| | "additionalParams": {} |
| | } |
| Instantiation State | INSTANTIATED |
| Links | { |
| | "self": { |
| | "href": "/vnflcm/v1/vnf_instances/92cf0ccb-e575-46e2-9c0d-30c67e75aaf6" |
| | }, |
| | "terminate": { |
| | "href": "/vnflcm/v1/vnf_instances/92cf0ccb-e575-46e2-9c0d-30c67e75aaf6/terminate" |
| | }, |
| | "heal": { |
| | "href": "/vnflcm/v1/vnf_instances/92cf0ccb-e575-46e2-9c0d-30c67e75aaf6/heal" |
| | } |
| | } |
| VIM Connection Info | [ |
| | { |
| | "id": "8a3adb69-0784-43c7-833e-aab0b6ab4470", |
| | "vimId": "8d8373fe-6977-49ff-83ac-7756572ed186", |
| | "vimType": "kubernetes", |
| | "interfaceInfo": {}, |
| | "accessInfo": {} |
| | } |
| | ] |
| VNF Instance Description | None |
| VNF Instance Name | None |
| VNF Product Name | Sample VNF |
| VNF Provider | Company |
| VNF Software Version | 1.0 |
| VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
| VNFD Version | 1.0 |
+--------------------------+-------------------------------------------------------------------------------------------+
+-----------------------------+----------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------+
| ID | 2a9a1197-953b-4f0a-b510-5ab4ab979959 |
| Instantiated Vnf Info | { |
| | "flavourId": "simple", |
| | "vnfState": "STARTED", |
| | "scaleStatus": [ |
| | { |
| | "aspectId": "vdu1_aspect", |
| | "scaleLevel": 0 |
| | } |
| | ], |
| | "extCpInfo": [], |
| | "vnfcResourceInfo": [ |
| | { |
| | "id": "da087f50-521a-4f71-a3e4-3464a196d4e6", |
| | "vduId": "VDU1", |
| | "computeResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "vdu1-heal-simple-6d649fd6f7-dcjpn", |
| | "vimLevelResourceType": "Deployment" |
| | }, |
| | "storageResourceIds": [] |
| | }, |
| | { |
| | "id": "4e66f5d3-a4c5-4025-8ad8-6ad21414cffa", |
| | "vduId": "VDU1", |
| | "computeResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "vdu1-heal-simple-6d649fd6f7-hmsbh", |
| | "vimLevelResourceType": "Deployment" |
| | }, |
| | "storageResourceIds": [] |
| | } |
| | ], |
| | "additionalParams": { |
| | "lcm-kubernetes-def-files": [ |
| | "Files/kubernetes/deployment_heal_simple.yaml" |
| | ] |
| | } |
| | } |
| Instantiation State | INSTANTIATED |
| Links | { |
| | "self": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/2a9a1197-953b-4f0a-b510-5ab4ab979959" |
| | }, |
| | "terminate": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/2a9a1197-953b-4f0a-b510-5ab4ab979959/terminate" |
| | }, |
| | "heal": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/2a9a1197-953b-4f0a-b510-5ab4ab979959/heal" |
| | }, |
| | "changeExtConn": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/2a9a1197-953b-4f0a-b510-5ab4ab979959/change_ext_conn" |
| | } |
| | } |
| VIM Connection Info | [ |
| | { |
| | "id": "8a3adb69-0784-43c7-833e-aab0b6ab4470", |
| | "vimId": "43176042-ca97-4954-9bd5-0a9c054885e1", |
| | "vimType": "kubernetes", |
| | "interfaceInfo": {}, |
| | "accessInfo": {}, |
| | "extra": {} |
| | }, |
| | { |
| | "id": "f1e70f72-0e1f-427e-a672-b447d45ee52e", |
| | "vimId": "43176042-ca97-4954-9bd5-0a9c054885e1", |
| | "vimType": "kubernetes", |
| | "interfaceInfo": {}, |
| | "accessInfo": {}, |
| | "extra": {} |
| | } |
| | ] |
| VNF Configurable Properties | |
| VNF Instance Description | |
| VNF Instance Name | vnf-2a9a1197-953b-4f0a-b510-5ab4ab979959 |
| VNF Product Name | Sample VNF |
| VNF Provider | Company |
| VNF Software Version | 1.0 |
| VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
| VNFD Version | 1.0 |
| metadata | namespace=default, tenant=default |
| vnfPkgId | |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------+
How to Heal of the Entire VNF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -296,8 +328,9 @@ Pod information before heal:
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
vdu1-heal-simple-75b5566444-wgc7m 1/1 Running 0 20m
vdu1-heal-simple-75b5566444-wwzcm 1/1 Running 0 20m
vdu1-heal-simple-6d649fd6f7-dcjpn 1/1 Running 0 11m
vdu1-heal-simple-6d649fd6f7-hmsbh 1/1 Running 0 11m
Heal entire VNF can be executed by the following CLI command.
@ -305,11 +338,13 @@ Heal entire VNF can be executed by the following CLI command.
$ openstack vnflcm heal VNF_INSTANCE_ID
Result:
.. code-block:: console
Heal request for VNF Instance 92cf0ccb-e575-46e2-9c0d-30c67e75aaf6 has been accepted.
Heal request for VNF Instance 2a9a1197-953b-4f0a-b510-5ab4ab979959 has been accepted.
Pod information after heal:
@ -317,91 +352,113 @@ Pod information after heal:
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
vdu1-heal-simple-75b5566444-ks785 1/1 Running 0 60s
vdu1-heal-simple-75b5566444-p5mjv 1/1 Running 0 60s
vdu1-heal-simple-6d649fd6f7-2wvxj 1/1 Running 0 17s
vdu1-heal-simple-6d649fd6f7-tj4vx 1/1 Running 0 17s
All ``vnfcResourceInfo`` in ``Instantiated Vnf Info`` will be updated from
the VNF Instance displayed in :ref:`labelCapHealingtargetVNFinstance`.
the VNF Instance displayed in `Healing Target VNF Instance`_.
.. code-block:: console
$ openstack vnflcm show VNF_INSTANCE_ID
Result:
.. code-block:: console
+--------------------------+-------------------------------------------------------------------------------------------+
| Field | Value |
+--------------------------+-------------------------------------------------------------------------------------------+
| ID | 92cf0ccb-e575-46e2-9c0d-30c67e75aaf6 |
| Instantiated Vnf Info | { |
| | "flavourId": "simple", |
| | "vnfState": "STARTED", |
| | "scaleStatus": [ |
| | { |
| | "aspectId": "vdu1_aspect", |
| | "scaleLevel": 0 |
| | } |
| | ], |
| | "extCpInfo": [], |
| | "vnfcResourceInfo": [ |
| | { |
| | "id": "a77b9a8e-a672-492d-9459-81c7b6483947", |
| | "vduId": "VDU1", |
| | "computeResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "vdu1-heal-simple-75b5566444-j45qb", |
| | "vimLevelResourceType": "Deployment" |
| | }, |
| | "storageResourceIds": [] |
| | }, |
| | { |
| | "id": "9463d02b-faba-41cb-8131-e90eaa319c83", |
| | "vduId": "VDU1", |
| | "computeResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "vdu1-heal-simple-75b5566444-p5mjv", |
| | "vimLevelResourceType": "Deployment" |
| | }, |
| | "storageResourceIds": [] |
| | } |
| | ], |
| | "additionalParams": {} |
| | } |
| Instantiation State | INSTANTIATED |
| Links | { |
| | "self": { |
| | "href": "/vnflcm/v1/vnf_instances/92cf0ccb-e575-46e2-9c0d-30c67e75aaf6" |
| | }, |
| | "terminate": { |
| | "href": "/vnflcm/v1/vnf_instances/92cf0ccb-e575-46e2-9c0d-30c67e75aaf6/terminate" |
| | }, |
| | "heal": { |
| | "href": "/vnflcm/v1/vnf_instances/92cf0ccb-e575-46e2-9c0d-30c67e75aaf6/heal" |
| | } |
| | } |
| VIM Connection Info | [ |
| | { |
| | "id": "8a3adb69-0784-43c7-833e-aab0b6ab4470", |
| | "vimId": "8d8373fe-6977-49ff-83ac-7756572ed186", |
| | "vimType": "kubernetes", |
| | "interfaceInfo": {}, |
| | "accessInfo": {} |
| | } |
| | ] |
| VNF Instance Description | None |
| VNF Instance Name | None |
| VNF Product Name | Sample VNF |
| VNF Provider | Company |
| VNF Software Version | 1.0 |
| VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
| VNFD Version | 1.0 |
+--------------------------+-------------------------------------------------------------------------------------------+
+-----------------------------+----------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------+
| ID | 2a9a1197-953b-4f0a-b510-5ab4ab979959 |
| Instantiated Vnf Info | { |
| | "flavourId": "simple", |
| | "vnfState": "STARTED", |
| | "scaleStatus": [ |
| | { |
| | "aspectId": "vdu1_aspect", |
| | "scaleLevel": 0 |
| | } |
| | ], |
| | "extCpInfo": [], |
| | "vnfcResourceInfo": [ |
| | { |
| | "id": "63a16aa7-ab36-4bfb-a6e3-724636155c4f", |
| | "vduId": "VDU1", |
| | "computeResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "vdu1-heal-simple-6d649fd6f7-2wvxj", |
| | "vimLevelResourceType": "Deployment" |
| | }, |
| | "storageResourceIds": [] |
| | }, |
| | { |
| | "id": "ca211f05-2509-4abf-b6f2-a553d18a6863", |
| | "vduId": "VDU1", |
| | "computeResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "vdu1-heal-simple-6d649fd6f7-tj4vx", |
| | "vimLevelResourceType": "Deployment" |
| | }, |
| | "storageResourceIds": [] |
| | } |
| | ], |
| | "additionalParams": { |
| | "lcm-kubernetes-def-files": [ |
| | "Files/kubernetes/deployment_heal_simple.yaml" |
| | ] |
| | } |
| | } |
| Instantiation State | INSTANTIATED |
| Links | { |
| | "self": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/2a9a1197-953b-4f0a-b510-5ab4ab979959" |
| | }, |
| | "terminate": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/2a9a1197-953b-4f0a-b510-5ab4ab979959/terminate" |
| | }, |
| | "heal": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/2a9a1197-953b-4f0a-b510-5ab4ab979959/heal" |
| | }, |
| | "changeExtConn": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/2a9a1197-953b-4f0a-b510-5ab4ab979959/change_ext_conn" |
| | } |
| | } |
| VIM Connection Info | [ |
| | { |
| | "id": "8a3adb69-0784-43c7-833e-aab0b6ab4470", |
| | "vimId": "43176042-ca97-4954-9bd5-0a9c054885e1", |
| | "vimType": "kubernetes", |
| | "interfaceInfo": {}, |
| | "accessInfo": {}, |
| | "extra": {} |
| | }, |
| | { |
| | "id": "f1e70f72-0e1f-427e-a672-b447d45ee52e", |
| | "vimId": "43176042-ca97-4954-9bd5-0a9c054885e1", |
| | "vimType": "kubernetes", |
| | "interfaceInfo": {}, |
| | "accessInfo": {}, |
| | "extra": {} |
| | } |
| | ] |
| VNF Configurable Properties | |
| VNF Instance Description | |
| VNF Instance Name | vnf-2a9a1197-953b-4f0a-b510-5ab4ab979959 |
| VNF Product Name | Sample VNF |
| VNF Provider | Company |
| VNF Software Version | 1.0 |
| VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
| VNFD Version | 1.0 |
| metadata | namespace=default, tenant=default |
| vnfPkgId | |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------+
How to Heal Specified with VNFC Instances
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Execute Heal of the partial CNF CLI command and check the name and age of pod
information before and after healing.
This is to confirm that the name has changed and age has been new after heal.
@ -412,30 +469,29 @@ Pod information before heal:
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
vdu1-heal-simple-75b5566444-wgc7m 1/1 Running 0 20m
vdu1-heal-simple-75b5566444-wwzcm 1/1 Running 0 20m
vdu1-heal-simple-6d649fd6f7-dcjpn 1/1 Running 0 22m
vdu1-heal-simple-6d649fd6f7-hmsbh 1/1 Running 0 22m
Heal specified with VNFC instances can be executed by running
:command:`openstack vnflcm heal VNF_INSTANCE_ID --vnfc-instance VNFC_INSTANCE_ID`.
In the example of this procedure, specify the ID
``686b356f-8096-4e24-99e5-3c81d36341be`` of the first ``vnfcResourceInfo`` as
``da087f50-521a-4f71-a3e4-3464a196d4e6`` of the first ``vnfcResourceInfo`` as
``VNFC_INSTANCE_ID``.
.. note:: In the case of version 1 API,
``VNFC_INSTANCE_ID`` is ``instantiatedVnfInfo.vnfcResourceInfo.id``.
In the case of version 2 API,
``VNFC_INSTANCE_ID`` is ``instantiatedVnfInfo.vnfcInfo.id``.
.. code-block:: console
$ openstack vnflcm heal 92cf0ccb-e575-46e2-9c0d-30c67e75aaf6 --vnfc-instance 686b356f-8096-4e24-99e5-3c81d36341be
$ openstack vnflcm heal 2a9a1197-953b-4f0a-b510-5ab4ab979959 --vnfc-instance da087f50-521a-4f71-a3e4-3464a196d4e6
Result:
.. code-block:: console
Heal request for VNF Instance 92cf0ccb-e575-46e2-9c0d-30c67e75aaf6 has been accepted.
Heal request for VNF Instance 2a9a1197-953b-4f0a-b510-5ab4ab979959 has been accepted.
Pod information after heal:
@ -443,89 +499,122 @@ Pod information after heal:
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
vdu1-heal-simple-75b5566444-ks785 1/1 Running 0 24s
vdu1-heal-simple-75b5566444-wwzcm 1/1 Running 0 20m
vdu1-heal-simple-6d649fd6f7-2wvxj 1/1 Running 0 13s
vdu1-heal-simple-6d649fd6f7-hmsbh 1/1 Running 0 22m
Only the ``resourceId`` of target ``vnfcResourceInfo`` in
``Instantiated Vnf Info`` will be updated from the VNF Instance displayed in
:ref:`labelCapHealingtargetVNFinstance`.
`Healing Target VNF Instance`_.
.. code-block:: console
$ openstack vnflcm show VNF_INSTANCE_ID
Result:
.. code-block:: console
+--------------------------+-------------------------------------------------------------------------------------------+
| Field | Value |
+--------------------------+-------------------------------------------------------------------------------------------+
| ID | 92cf0ccb-e575-46e2-9c0d-30c67e75aaf6 |
| Instantiated Vnf Info | { |
| | "flavourId": "simple", |
| | "vnfState": "STARTED", |
| | "scaleStatus": [ |
| | { |
| | "aspectId": "vdu1_aspect", |
| | "scaleLevel": 0 |
| | } |
| | ], |
| | "extCpInfo": [], |
| | "vnfcResourceInfo": [ |
| | { |
| | "id": "686b356f-8096-4e24-99e5-3c81d36341be", |
| | "vduId": "VDU1", |
| | "computeResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "vdu1-heal-simple-75b5566444-ks785", |
| | "vimLevelResourceType": "Deployment" |
| | }, |
| | "storageResourceIds": [] |
| | }, |
| | { |
| | "id": "73cb41e7-31ae-494b-b4d0-66b8168c257e", |
| | "vduId": "VDU1", |
| | "computeResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "vdu1-heal-simple-75b5566444-wwzcm", |
| | "vimLevelResourceType": "Deployment" |
| | }, |
| | "storageResourceIds": [] |
| | } |
| | ], |
| | "additionalParams": {} |
| | } |
| Instantiation State | INSTANTIATED |
| Links | { |
| | "self": { |
| | "href": "/vnflcm/v1/vnf_instances/92cf0ccb-e575-46e2-9c0d-30c67e75aaf6" |
| | }, |
| | "terminate": { |
| | "href": "/vnflcm/v1/vnf_instances/92cf0ccb-e575-46e2-9c0d-30c67e75aaf6/terminate" |
| | }, |
| | "heal": { |
| | "href": "/vnflcm/v1/vnf_instances/92cf0ccb-e575-46e2-9c0d-30c67e75aaf6/heal" |
| | } |
| | } |
| VIM Connection Info | [ |
| | { |
| | "id": "8a3adb69-0784-43c7-833e-aab0b6ab4470", |
| | "vimId": "8d8373fe-6977-49ff-83ac-7756572ed186", |
| | "vimType": "kubernetes", |
| | "interfaceInfo": {}, |
| | "accessInfo": {} |
| | } |
| | ] |
| VNF Instance Description | None |
| VNF Instance Name | None |
| VNF Product Name | Sample VNF |
| VNF Provider | Company |
| VNF Software Version | 1.0 |
| VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
| VNFD Version | 1.0 |
+--------------------------+-------------------------------------------------------------------------------------------+
+-----------------------------+----------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------+
| ID | 2a9a1197-953b-4f0a-b510-5ab4ab979959 |
| Instantiated Vnf Info | { |
| | "flavourId": "simple", |
| | "vnfState": "STARTED", |
| | "scaleStatus": [ |
| | { |
| | "aspectId": "vdu1_aspect", |
| | "scaleLevel": 0 |
| | } |
| | ], |
| | "extCpInfo": [], |
| | "vnfcResourceInfo": [ |
| | { |
| | "id": "da087f50-521a-4f71-a3e4-3464a196d4e6", |
| | "vduId": "VDU1", |
| | "computeResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "vdu1-heal-simple-6d649fd6f7-2wvxj", |
| | "vimLevelResourceType": "Deployment" |
| | }, |
| | "storageResourceIds": [] |
| | }, |
| | { |
| | "id": "4e66f5d3-a4c5-4025-8ad8-6ad21414cffa", |
| | "vduId": "VDU1", |
| | "computeResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "vdu1-heal-simple-6d649fd6f7-hmsbh", |
| | "vimLevelResourceType": "Deployment" |
| | }, |
| | "storageResourceIds": [] |
| | } |
| | ], |
| | "additionalParams": { |
| | "lcm-kubernetes-def-files": [ |
| | "Files/kubernetes/deployment_heal_simple.yaml" |
| | ] |
| | } |
| | } |
| Instantiation State | INSTANTIATED |
| Links | { |
| | "self": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/2a9a1197-953b-4f0a-b510-5ab4ab979959" |
| | }, |
| | "terminate": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/2a9a1197-953b-4f0a-b510-5ab4ab979959/terminate" |
| | }, |
| | "heal": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/2a9a1197-953b-4f0a-b510-5ab4ab979959/heal" |
| | }, |
| | "changeExtConn": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/2a9a1197-953b-4f0a-b510-5ab4ab979959/change_ext_conn" |
| | } |
| | } |
| VIM Connection Info | [ |
| | { |
| | "id": "8a3adb69-0784-43c7-833e-aab0b6ab4470", |
| | "vimId": "43176042-ca97-4954-9bd5-0a9c054885e1", |
| | "vimType": "kubernetes", |
| | "interfaceInfo": {}, |
| | "accessInfo": {}, |
| | "extra": {} |
| | }, |
| | { |
| | "id": "f1e70f72-0e1f-427e-a672-b447d45ee52e", |
| | "vimId": "43176042-ca97-4954-9bd5-0a9c054885e1", |
| | "vimType": "kubernetes", |
| | "interfaceInfo": {}, |
| | "accessInfo": {}, |
| | "extra": {} |
| | } |
| | ] |
| VNF Configurable Properties | |
| VNF Instance Description | |
| VNF Instance Name | vnf-2a9a1197-953b-4f0a-b510-5ab4ab979959 |
| VNF Product Name | Sample VNF |
| VNF Provider | Company |
| VNF Software Version | 1.0 |
| VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
| VNFD Version | 1.0 |
| metadata | namespace=default, tenant=default |
| vnfPkgId | |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------+
.. _NFV-SOL002 v2.6.1 : https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/002/02.06.01_60/gs_nfv-sol002v020601p.pdf
.. _samples/tests/etc/samples/etsi/nfv/test_cnf_heal : https://opendev.org/openstack/tacker/src/branch/master/samples/tests/etc/samples/etsi/nfv/test_cnf_heal
History of Checks
-----------------
The content of this document has been confirmed to work
using the following VNF Package.
* `test_cnf_heal for 2023.2 Bobcat`_
.. _samples/tests/etc/samples/etsi/nfv/test_cnf_heal:
https://opendev.org/openstack/tacker/src/branch/master/samples/tests/etc/samples/etsi/nfv/test_cnf_heal
.. _NFV-SOL002 v2.6.1: https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/002/02.06.01_60/gs_nfv-sol002v020601p.pdf
.. _test_cnf_heal for 2023.2 Bobcat:
https://opendev.org/openstack/tacker/src/branch/stable/2023.2/tacker/tests/etc/samples/etsi/nfv/test_cnf_heal

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,13 @@
ETSI NFV-SOL CNF Scaling
========================
This document describes how to scale CNF in Tacker.
This document describes how to scale CNF in Tacker v1 API.
.. note::
This is a document for Tacker v1 API.
See :doc:`/user/v2/cnf/scale/index` for Tacker v2 API.
Overview
--------
@ -17,17 +23,17 @@ The diagram below shows an overview of the CNF scaling.
2. Call Kubernetes API
Upon receiving a request from tacker-client, tacker-server redirects it to
tacker-conductor. In tacker-conductor, the request is redirected again to
tacker-conductor. In tacker-conductor, the request is redirected again to
an appropriate infra-driver (in this case Kubernetes infra-driver) according
to the contents of the instantiate parameters. Then, Kubernetes
to the contents of the instantiate parameters. Then, Kubernetes
infra-driver calls Kubernetes APIs.
3. Change the number of Pods
Kubernetes Master change the number of Pods according to the API calls.
.. figure:: ../_images/etsi_cnf_scaling.png
:align: left
.. figure:: /_images/etsi_cnf_scaling.png
Prerequisites
-------------
@ -39,10 +45,11 @@ The following packages should be installed:
The procedure of prepare for scaling operation that from "register VIM" to
"Instantiate VNF", basically refer to
:doc:`./etsi_containerized_vnf_usage_guide`.
:doc:`/user/etsi_containerized_vnf_usage_guide`.
This procedure uses an example using the sample VNF package.
How to Create VNF Package for Scaling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Using `samples/tests/etc/samples/etsi/nfv/test_cnf_scale`_,
@ -50,7 +57,8 @@ describe how to create VNF package for scaling.
.. code-block:: console
$ cd samples/tests/etc/samples/etsi/nfv/test_cnf_scale
$ cd samples/tests/etc/samples/etsi/nfv/test_cnf_scale
Download official definition files from ETSI NFV.
ETSI GS NFV-SOL 001 [i.4] specifies the structure and format of the VNFD based
@ -58,19 +66,21 @@ on TOSCA specifications.
.. code-block:: console
$ cd Definitions
$ wget https://forge.etsi.org/rep/nfv/SOL001/raw/v2.6.1/etsi_nfv_sol001_common_types.yaml
$ wget https://forge.etsi.org/rep/nfv/SOL001/raw/v2.6.1/etsi_nfv_sol001_vnfd_types.yaml
$ cd Definitions
$ wget https://forge.etsi.org/rep/nfv/SOL001/raw/v2.6.1/etsi_nfv_sol001_common_types.yaml
$ wget https://forge.etsi.org/rep/nfv/SOL001/raw/v2.6.1/etsi_nfv_sol001_vnfd_types.yaml
CSAR Package should be compressed into a ZIP file for uploading.
Following commands are an example of compressing a VNF Package:
.. code-block:: console
$ cd -
$ zip deployment.zip -r Definitions/ Files/ TOSCA-Metadata/
$ ls
Definitions deployment.zip Files TOSCA-Metadata
$ cd -
$ zip deployment.zip -r Definitions/ Files/ TOSCA-Metadata/
$ ls
Definitions deployment.zip Files TOSCA-Metadata
After creating a vnf package with :command:`openstack vnf package create`, some
information including ID, Links, Onboarding State, Operational State, and Usage
@ -80,24 +90,25 @@ successful.
.. code-block:: console
$ openstack vnf package create
+-------------------+-------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------+-------------------------------------------------------------------------------------------------+
| ID | 08d00a5c-e8aa-4219-9412-411458eaa7d2 |
| Links | { |
| | "self": { |
| | "href": "/vnfpkgm/v1/vnf_packages/08d00a5c-e8aa-4219-9412-411458eaa7d2" |
| | }, |
| | "packageContent": { |
| | "href": "/vnfpkgm/v1/vnf_packages/08d00a5c-e8aa-4219-9412-411458eaa7d2/package_content" |
| | } |
| | } |
| Onboarding State | CREATED |
| Operational State | DISABLED |
| Usage State | NOT_IN_USE |
| User Defined Data | {} |
+-------------------+-------------------------------------------------------------------------------------------------+
$ openstack vnf package create
+-------------------+-------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------+-------------------------------------------------------------------------------------------------+
| ID | 094c8abf-b5c8-45a1-9332-3952a710c65c |
| Links | { |
| | "self": { |
| | "href": "/vnfpkgm/v1/vnf_packages/094c8abf-b5c8-45a1-9332-3952a710c65c" |
| | }, |
| | "packageContent": { |
| | "href": "/vnfpkgm/v1/vnf_packages/094c8abf-b5c8-45a1-9332-3952a710c65c/package_content" |
| | } |
| | } |
| Onboarding State | CREATED |
| Operational State | DISABLED |
| Usage State | NOT_IN_USE |
| User Defined Data | {} |
+-------------------+-------------------------------------------------------------------------------------------------+
Upload the CSAR zip file in to the VNF Package by running the following command
:command:`openstack vnf package upload --path <path of vnf package> <vnf package ID>`
@ -106,8 +117,9 @@ Here is an example of uploading VNF package:
.. code-block:: console
$ openstack vnf package upload --path deployment.zip 08d00a5c-e8aa-4219-9412-411458eaa7d2
Upload request for VNF package 08d00a5c-e8aa-4219-9412-411458eaa7d2 has been accepted.
$ openstack vnf package upload --path deployment.zip 094c8abf-b5c8-45a1-9332-3952a710c65c
Upload request for VNF package 094c8abf-b5c8-45a1-9332-3952a710c65c has been accepted.
Create VNF instance by running :command:`openstack vnflcm create <VNFD ID>`.
@ -116,27 +128,30 @@ Here is an example of creating VNF :
.. code-block:: console
$ openstack vnflcm create b1bb0ce7-ebca-4fa7-95ed-4840d70a1177
+--------------------------+---------------------------------------------------------------------------------------------+
| Field | Value |
+--------------------------+---------------------------------------------------------------------------------------------+
| ID | 92cf0ccb-e575-46e2-9c0d-30c67e75aaf6 |
| Instantiation State | NOT_INSTANTIATED |
| Links | { |
| | "self": { |
| | "href": "/vnflcm/v1/vnf_instances/92cf0ccb-e575-46e2-9c0d-30c67e75aaf6" |
| | }, |
| | "instantiate": { |
| | "href": "/vnflcm/v1/vnf_instances/92cf0ccb-e575-46e2-9c0d-30c67e75aaf6/instantiate" |
| | } |
| | } |
| VNF Instance Description | None |
| VNF Instance Name | None |
| VNF Product Name | Sample VNF |
| VNF Provider | Company |
| VNF Software Version | 1.0 |
| VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
| VNFD Version | 1.0 |
+--------------------------+---------------------------------------------------------------------------------------------+
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
| ID | e9d7c08e-72ed-4c64-bc91-78cd82163969 |
| Instantiation State | NOT_INSTANTIATED |
| Links | { |
| | "self": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/e9d7c08e-72ed-4c64-bc91-78cd82163969" |
| | }, |
| | "instantiate": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/e9d7c08e-72ed-4c64-bc91-78cd82163969/instantiate" |
| | } |
| | } |
| VNF Configurable Properties | |
| VNF Instance Description | |
| VNF Instance Name | vnf-e9d7c08e-72ed-4c64-bc91-78cd82163969 |
| 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 | |
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
After the command is executed, instantiate VNF.
Instantiate VNF by running the following command
@ -149,29 +164,25 @@ includes path of Kubernetes resource definition file and that
.. code-block:: console
$ cat ./instance_kubernetes.json
{
"flavourId": "simple",
"additionalParams": {
"lcm-kubernetes-def-files": [
"Files/kubernetes/deployment_scale.yaml"
]
},
"vimConnectionInfo": [
{
"id": "8a3adb69-0784-43c7-833e-aab0b6ab4470",
"vimId": "8d8373fe-6977-49ff-83ac-7756572ed186",
"vimType": "kubernetes"
}
$ cat ./instance_kubernetes.json
{
"flavourId": "simple",
"additionalParams": {
"lcm-kubernetes-def-files": [
"Files/kubernetes/deployment_scale.yaml"
]
}
$ openstack vnflcm instantiate 92cf0ccb-e575-46e2-9c0d-30c67e75aaf6 instance_kubernetes.json
Instantiate request for VNF Instance 92cf0ccb-e575-46e2-9c0d-30c67e75aaf6 has been accepted.
},
"vimConnectionInfo": [
{
"id": "8a3adb69-0784-43c7-833e-aab0b6ab4470",
"vimId": "43176042-ca97-4954-9bd5-0a9c054885e1",
"vimType": "kubernetes"
}
]
}
$ openstack vnflcm instantiate e9d7c08e-72ed-4c64-bc91-78cd82163969 instance_kubernetes.json
Instantiate request for VNF Instance e9d7c08e-72ed-4c64-bc91-78cd82163969 has been accepted.
.. note::
In the case of version 2 API, you can also set
``vimType`` as ``ETSINFV.KUBERNETES.V_1`` in ``vimConnectionInfo``.
CNF Scaling Procedure
---------------------
@ -181,18 +192,22 @@ scaling.
Users can scale the number of pod replicas managed by controller resources such
as Kubernetes Deployment, StatefulSet, and ReplicaSet.
.. note:: If kind is Stateful Set and not dynamic provisioning
(no-provisioner), user must create the Persistent Volume for the
maximum replicas in advance because the increased Persistent Volume
is not created during the scale out operation.
.. note::
Details of CLI commands are described in :doc:`../cli/cli-etsi-vnflcm`.
If kind is Stateful Set and not dynamic provisioning
(no-provisioner), user must create the Persistent Volume for the
maximum replicas in advance because the increased Persistent Volume
is not created during the scale out operation.
Details of CLI commands are described in :doc:`/cli/cli-etsi-vnflcm`.
There are two main methods for CNF scaling.
* Scale out CNF
* Scale in CNF
How to Identify ASPECT_ID
~~~~~~~~~~~~~~~~~~~~~~~~~
@ -278,7 +293,11 @@ In the following VNFD excerpt, **vdu1_aspect** corresponds to ``ASPECT_ID``.
...snip VNFD...
.. note:: See `NFV-SOL001 v2.6.1`_ annex A.6 for details about ``ASPECT_ID``.
.. note::
See `NFV-SOL001 v2.6.1`_ annex A.6 for details about ``ASPECT_ID``.
How to Scale Out CNF
~~~~~~~~~~~~~~~~~~~~
@ -296,17 +315,20 @@ Replicas information before scale-out:
NAME READY UP-TO-DATE AVAILABLE AGE
vdu1 1/1 1 1 2d
Scale-out CNF can be executed by the following CLI command.
.. code-block:: console
$ openstack vnflcm scale --type SCALE_OUT --aspect-id vdu1_aspect VNF_INSTANCE_ID
Result:
.. code-block:: console
Scale request for VNF Instance edd306c3-647c-412c-a033-74aa40118038 has been accepted.
Scale request for VNF Instance e9d7c08e-72ed-4c64-bc91-78cd82163969 has been accepted.
Replicas information after scale-out:
@ -316,6 +338,7 @@ Replicas information after scale-out:
NAME READY UP-TO-DATE AVAILABLE AGE
vdu1 2/2 2 2 2d
How to Scale in CNF
~~~~~~~~~~~~~~~~~~~
@ -332,18 +355,20 @@ Replicas information before scale-out:
NAME READY UP-TO-DATE AVAILABLE AGE
vdu1 2/2 2 2 2d
Scale-in VNF can be executed by the following CLI command.
.. code-block:: console
$ openstack vnflcm scale --type SCALE_IN --aspect-id vdu1_aspect VNF_INSTANCE_ID
Result:
.. code-block:: console
Scale request for VNF Instance
edd306c3-647c-412c-a033-74aa40118038 has been accepted.
Scale request for VNF Instance e9d7c08e-72ed-4c64-bc91-78cd82163969 has been accepted.
Replicas information after scale-in:
@ -353,5 +378,18 @@ Replicas information after scale-in:
NAME READY UP-TO-DATE AVAILABLE AGE
vdu1 1/1 1 1 2d
.. _NFV-SOL001 v2.6.1 : https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/001/02.06.01_60/gs_NFV-SOL001v020601p.pdf
.. _samples/tests/etc/samples/etsi/nfv/test_cnf_scale : https://opendev.org/openstack/tacker/src/branch/master/samples/tests/etc/samples/etsi/nfv/test_cnf_scale
History of Checks
-----------------
The content of this document has been confirmed to work
using the following VNF Package.
* `test_cnf_scale for 2023.2 Bobcat`_
.. _samples/tests/etc/samples/etsi/nfv/test_cnf_scale:
https://opendev.org/openstack/tacker/src/branch/master/samples/tests/etc/samples/etsi/nfv/test_cnf_scale
.. _NFV-SOL001 v2.6.1: https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/001/02.06.01_60/gs_NFV-SOL001v020601p.pdf
.. _test_cnf_scale for 2023.2 Bobcat:
https://opendev.org/openstack/tacker/src/branch/stable/2023.2/tacker/tests/etc/samples/etsi/nfv/test_cnf_scale

File diff suppressed because it is too large Load Diff

View File

@ -23,28 +23,36 @@ Summary
This lecture enables you to:
- create & delete a sample VNF on the OpenStack with Tacker
- create & delete a sample VNF on the OpenStack with Tacker v1 API
.. note::
This is a document for Tacker v1 API.
See :doc:`/user/v2/getting_started/index` for Tacker v2 API.
Following two types of VNF deployment supported by Tacker are introduced in
this lecture.
- VNF Deployment with TOSCA [#f1]_
- VNF Deployment with LCM Operation User Data (optional) [#f2]_
- :doc:`/user/etsi_vnf_deployment_as_vm_with_tosca`
- :doc:`/user/etsi_vnf_deployment_as_vm_with_user_data`
"VNF Deployment with LCM Operation User Data" is optional.
The part will be clarified with the notation [This is UserData specific part].
The following figure shows a sample VNF used in this lecture.
.. figure:: ../_images/etsi-getting-started-sample-vnf.png
.. figure:: /_images/etsi-getting-started-sample-vnf.png
:align: left
.. note::
VIM config, a VNF package, and instantiation parameters used in this tutorial are placed at the repository.
- VNF Deployment with TOSCA [#f3]_
- VNF Deployment with LCM Operation User Data [#f4]_
- `samples/etsi_getting_started/tosca`_
- `samples/etsi_getting_started/userdata`_
.. note::
@ -59,7 +67,7 @@ The following figure shows a sample VNF used in this lecture.
Prerequisites
-------------
The following packages should be installed [#f5]_:
The following packages should be installed:
* tacker
* python-tackerclient
@ -70,8 +78,28 @@ Configuration
Load credentials for client operations
""""""""""""""""""""""""""""""""""""""
Before any Tacker commands can be run, your credentials need to be sourced
[#f6]_.
Before any Tacker commands can be run, your credentials need to be sourced.
.. note::
See `Create OpenStack client environment scripts`_ for details.
In this document, the settings are as follows:
.. code-block::
OS_REGION_NAME=RegionOne
OS_PROJECT_DOMAIN_ID=default
OS_CACERT=
OS_AUTH_URL=http://192.168.56.10/identity
OS_TENANT_NAME=admin
OS_USER_DOMAIN_ID=default
OS_USERNAME=admin
OS_VOLUME_API_VERSION=3
OS_AUTH_TYPE=password
OS_PROJECT_NAME=admin
OS_PASSWORD=devstack
OS_IDENTITY_API_VERSION=3
You can confirm that Tacker is available by checking this command works without
error:
@ -80,9 +108,10 @@ error:
$ openstack vim list
.. note::
See CLI reference [#f7]_ to find all the available commands.
See :doc:`/cli/index` to find all the available commands.
Register VIM
@ -91,7 +120,7 @@ Register VIM
#. Prepare VIM configuration file:
You can use a setup script for generating VIM configuration or edit it from
scratch as described in :doc:`here </reference/vim_config>`.
scratch as described in :doc:`/reference/vim_config`.
This script finds parameters for the configuration, such as user
name or password, from your environment variables.
Here is an example of generating OpenStack VIM configuration as
@ -103,6 +132,7 @@ Register VIM
$ bash TACKER_ROOT/tools/gen_vim_config.sh
Config for OpenStack VIM 'vim_config.yaml' generated.
There are several options for configuring parameters from command
line supported. Refer help with ``-h`` for details.
@ -114,8 +144,10 @@ Register VIM
$ cp TACKER_ROOT/samples/etsi_getting_started/tosca/vim/vim_config.yaml ./
$ vi vim_config.yaml
.. literalinclude:: ../../../samples/etsi_getting_started/tosca/vim/vim_config.yaml
:language: yaml
:language: yaml
#. Register Default VIM:
@ -126,57 +158,55 @@ Register VIM
$ openstack vim register --config-file ./vim_config.yaml \
--is-default --fit-width openstack-admin-vim
+----------------+-----------------------------------------------------+
| Field | Value |
+----------------+-----------------------------------------------------+
| auth_cred | { |
| | "username": "admin", |
| | "user_domain_name": "default", |
| | "cert_verify": "True", |
| | "project_id": null, |
| | "project_name": "admin", |
| | "project_domain_name": "default", |
| | "auth_url": "http://192.168.56.10/identity/v3", |
| | "key_type": "barbican_key", |
| | "secret_uuid": "***", |
| | "password": "***" |
| | } |
| auth_url | http://192.168.56.10/identity/v3 |
| created_at | 2023-12-21 07:39:09.617234 |
| description | |
| extra | |
| id | 662e5f4f-3b16-4ca6-b560-28b62dd0e13b |
| is_default | True |
| name | openstack-admin-vim |
| placement_attr | { |
| | "regions": [ |
| | "RegionOne" |
| | ] |
| | } |
| project_id | 1994d69783d64c00aadab564038c2fd7 |
| status | ACTIVE |
| type | openstack |
| updated_at | None |
| vim_project | { |
| | "name": "admin", |
| | "project_domain_name": "default" |
| | } |
+----------------+-----------------------------------------------------+
+----------------+-------------------------------------------------+
| Field | Value |
+----------------+-------------------------------------------------+
| auth_cred | { |
| | "username": "admin", |
| | "user_domain_name": "Default", |
| | "cert_verify": "True", |
| | "project_id": null, |
| | "project_name": "admin", |
| | "project_domain_name": "Default", |
| | "auth_url": "http://127.0.0.1/identity/v3", |
| | "key_type": "barbican_key", |
| | "secret_uuid": "***", |
| | "password": "***" |
| | } |
| auth_url | http://127.0.0.1/identity/v3 |
| created_at | 2020-05-24 07:00:25.923831 |
| description | |
| id | 4bb57004-9e33-4c52-b5f9-629f876b4168 |
| is_default | True |
| name | openstack-admin-vim |
| placement_attr | { |
| | "regions": [ |
| | "RegionOne" |
| | ] |
| | } |
| project_id | d413421abf074c9b8f54a1403857038c |
| status | PENDING |
| type | openstack |
| updated_at | None |
| vim_project | { |
| | "name": "admin", |
| | "project_domain_name": "Default" |
| | } |
+----------------+-------------------------------------------------+
#. Confirm that the status of registered VIM is ``REACHABLE`` as ready to use:
#. Confirm that the status of registered VIM is ``ACTIVE`` as ready to use:
.. code-block:: console
$ openstack vim list
+--------------------------------------+---------------------+----------------------------------+-----------+------------+--------+
| ID | Name | Tenant_id | Type | Is Default | Status |
+--------------------------------------+---------------------+----------------------------------+-----------+------------+--------+
| 662e5f4f-3b16-4ca6-b560-28b62dd0e13b | openstack-admin-vim | 1994d69783d64c00aadab564038c2fd7 | openstack | True | ACTIVE |
+--------------------------------------+---------------------+----------------------------------+-----------+------------+--------+
+------------+------------+------------+-----------+------------+-----------+
| ID | Name | Tenant_id | Type | Is Default | Status |
+------------+------------+------------+-----------+------------+-----------+
| 4bb57004-9 | openstack- | d413421abf | openstack | True | REACHABLE |
| e33-4c52-b | admin-vim | 074c9b8f54 | | | |
| 5f9-629f87 | | a140385703 | | | |
| 6b4168 | | 8c | | | |
+------------+------------+------------+-----------+------------+-----------+
Create and Upload VNF Package
-----------------------------
@ -189,15 +219,17 @@ Prepare VNF Package
.. code-block:: console
$ mkdir -p ./sample_vnf_package_csar/TOSCA-Metadata \
./sample_vnf_package_csar/Definitions \
./sample_vnf_package_csar/Files
./sample_vnf_package_csar/Definitions \
./sample_vnf_package_csar/Files/images
[This is UserData specific part] When using UserData, create the following directories in addition.
.. code-block:: console
$ mkdir -p ./sample_vnf_package_csar/BaseHOT/simple \
./sample_vnf_package_csar/UserData
./sample_vnf_package_csar/UserData
#. Create a ``TOSCA.meta`` file:
@ -205,25 +237,39 @@ Prepare VNF Package
$ vi ./sample_vnf_package_csar/TOSCA-Metadata/TOSCA.meta
.. literalinclude:: ../../../samples/etsi_getting_started/tosca/sample_vnf_package_csar/TOSCA-Metadata/TOSCA.meta
:language: text
:language: text
#. Download image file:
.. code-block:: console
$ cd ./sample_vnf_package_csar/Files/images
$ wget https://download.cirros-cloud.net/0.5.2/cirros-0.5.2-x86_64-disk.img
#. Download ETSI definition files:
You should set ``${TOSCA_VERSION}`` to one of the appropriate TOSCA service
template versions [#f8]_, e.g., ``export TOSCA_VERSION=v2.6.1``.
template versions (`SOL001`_), e.g., ``export TOSCA_VERSION=v2.6.1``.
.. important::
You should also check if the version of TOSCA service template is
supported by tacker [#f9]_.
supported by tacker.
See :doc:`/user/vnfd-sol001` for supported version.
.. code-block:: console
$ cd -
$ cd ./sample_vnf_package_csar/Definitions
$ wget https://forge.etsi.org/rep/nfv/SOL001/raw/${TOSCA_VERSION}/etsi_nfv_sol001_common_types.yaml
$ wget https://forge.etsi.org/rep/nfv/SOL001/raw/${TOSCA_VERSION}/etsi_nfv_sol001_vnfd_types.yaml
#. Create VNFD files:
- Create ``sample_vnfd_top.yaml``
@ -233,7 +279,8 @@ Prepare VNF Package
$ vi ./sample_vnfd_top.yaml
.. literalinclude:: ../../../samples/etsi_getting_started/tosca/sample_vnf_package_csar/Definitions/sample_vnfd_top.yaml
:language: yaml
:language: yaml
- Create ``sample_vnfd_types.yaml``
@ -241,22 +288,27 @@ Prepare VNF Package
$ vi ./sample_vnfd_types.yaml
.. literalinclude:: ../../../samples/etsi_getting_started/tosca/sample_vnf_package_csar/Definitions/sample_vnfd_types.yaml
:language: yaml
:language: yaml
.. note::
``description_id`` shall be globally unique, i.e., you cannot create
multiple VNFDs with the same ``description_id``.
- Create ``sample_vnfd_df_simple.yaml``
.. code-block:: console
$ vi ./sample_vnfd_df_simple.yaml
.. literalinclude:: ../../../samples/etsi_getting_started/tosca/sample_vnf_package_csar/Definitions/sample_vnfd_df_simple.yaml
:language: yaml
:language: yaml
.. note::
@ -264,6 +316,7 @@ Prepare VNF Package
Tacker cannot handle it. After the instantiation, the default value in
``sample_vnfd_types.yaml`` is always used.
#. [This is UserData specific part] Create BaseHOT files:
.. code-block:: console
@ -271,8 +324,10 @@ Prepare VNF Package
$ cd -
$ vi ./sample_vnf_package_csar/BaseHOT/simple/sample_lcm_with_user_data_hot.yaml
.. literalinclude:: ../../../samples/etsi_getting_started/userdata/sample_vnf_package_csar/BaseHOT/simple/sample_lcm_with_user_data_hot.yaml
:language: yaml
:language: yaml
#. [This is UserData specific part] Create UserData files:
@ -282,8 +337,10 @@ Prepare VNF Package
$ touch ./__init__.py
$ vi ./lcm_user_data.py
.. literalinclude:: ../../../samples/etsi_getting_started/userdata/sample_vnf_package_csar/UserData/lcm_user_data.py
:language: python
:language: python
#. Compress the VNF Package CSAR to zip:
@ -311,12 +368,14 @@ Prepare VNF Package
TOSCA-Metadata/
TOSCA-Metadata/TOSCA.meta
- [This is UserData specific part] When using UserData, add ``BaseHOT`` and ``UserData`` directories.
.. code-block:: console
$ zip sample_vnf_package_csar.zip -r BaseHOT/ UserData/
The contents of the zip file should look something like this.
.. code-block:: console
@ -340,10 +399,10 @@ Prepare VNF Package
UserData/lcm_user_data.py
UserData/__init__.py
Here, you can find the structure of the sample VNF Package CSAR as a
zip file.
.. _Create VNF Package:
Create VNF Package
^^^^^^^^^^^^^^^^^^
@ -358,36 +417,42 @@ Create VNF Package
.. code-block:: console
$ openstack vnf package create --fit-width
$ openstack vnf package create
+-------------------+-------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------+-------------------------------------------------------------------------------------------------+
| ID | 156f1c4f-bfe2-492b-a079-a1bad32c0c3d |
| Links | { |
| | "self": { |
| | "href": "/vnfpkgm/v1/vnf_packages/156f1c4f-bfe2-492b-a079-a1bad32c0c3d" |
| | }, |
| | "packageContent": { |
| | "href": "/vnfpkgm/v1/vnf_packages/156f1c4f-bfe2-492b-a079-a1bad32c0c3d/package_content" |
| | } |
| | } |
| Onboarding State | CREATED |
| Operational State | DISABLED |
| Usage State | NOT_IN_USE |
| User Defined Data | {} |
+-------------------+-------------------------------------------------------------------------------------------------+
+-------------------+----------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------+----------------------------------------------------------------------------------------------------------------+
| ID | e712a702-741f-4093-a971-b3ad69411ac1 |
| Links | packageContent=href=/vnfpkgm/v1/vnf_packages/e712a702-741f-4093-a971-b3ad69411ac1/package_content, |
| | self=href=/vnfpkgm/v1/vnf_packages/e712a702-741f-4093-a971-b3ad69411ac1 |
| Onboarding State | CREATED |
| Operational State | DISABLED |
| Usage State | NOT_IN_USE |
| User Defined Data | |
+-------------------+----------------------------------------------------------------------------------------------------------------+
Upload VNF Package
^^^^^^^^^^^^^^^^^^
#. Execute vnfpkgm upload:
The "VNF Package ID" ``e712a702-741f-4093-a971-b3ad69411ac1`` needs to be
replaced with the appropriate one that was obtained from :ref:`Create VNF
The "VNF Package ID" ``156f1c4f-bfe2-492b-a079-a1bad32c0c3d`` needs to be
replaced with the appropriate one that was obtained from `Create VNF
Package`.
.. code-block:: console
$ openstack vnf package upload \
--path ./sample_vnf_package_csar/sample_vnf_package_csar.zip \
e712a702-741f-4093-a971-b3ad69411ac1
--path ./sample_vnf_package_csar/sample_vnf_package_csar.zip \
156f1c4f-bfe2-492b-a079-a1bad32c0c3d
Upload request for VNF package 156f1c4f-bfe2-492b-a079-a1bad32c0c3d has been accepted.
Upload request for VNF package e712a702-741f-4093-a971-b3ad69411ac1 has been accepted.
Check the created VNF Package
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -398,20 +463,33 @@ Check the created VNF Package
.. code-block:: console
$ openstack vnf package list
+--------------------------------------+------------------+------------------+-------------+-------------------+
| Id | Vnf Product Name | Onboarding State | Usage State | Operational State |
+--------------------------------------+------------------+------------------+-------------+-------------------+
| e712a702-741f-4093-a971-b3ad69411ac1 | | PROCESSING | NOT_IN_USE | DISABLED |
+--------------------------------------+------------------+------------------+-------------+-------------------+
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
| Id | Vnf Product Name | Onboarding State | Usage State | Operational State | Links |
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
| 156f1c4f-bfe2-492b-a079-a1bad32c0c3d | | PROCESSING | NOT_IN_USE | DISABLED | { |
| | | | | | "self": { |
| | | | | | "href": "/vnfpkgm/v1/vnf_packages/156f1c4f-bfe2-492b-a079-a1bad32c0c3d" |
| | | | | | }, |
| | | | | | "packageContent": { |
| | | | | | "href": "/vnfpkgm/v1/vnf_packages/156f1c4f-bfe2-492b-a079-a1bad32c0c3d/package_content" |
| | | | | | } |
| | | | | | } |
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
$ openstack vnf package list
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
| Id | Vnf Product Name | Onboarding State | Usage State | Operational State | Links |
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
| 156f1c4f-bfe2-492b-a079-a1bad32c0c3d | Sample VNF | ONBOARDED | NOT_IN_USE | ENABLED | { |
| | | | | | "self": { |
| | | | | | "href": "/vnfpkgm/v1/vnf_packages/156f1c4f-bfe2-492b-a079-a1bad32c0c3d" |
| | | | | | }, |
| | | | | | "packageContent": { |
| | | | | | "href": "/vnfpkgm/v1/vnf_packages/156f1c4f-bfe2-492b-a079-a1bad32c0c3d/package_content" |
| | | | | | } |
| | | | | | } |
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
+--------------------------------------+------------------+------------------+-------------+-------------------+
| Id | Vnf Product Name | Onboarding State | Usage State | Operational State |
+--------------------------------------+------------------+------------------+-------------+-------------------+
| e712a702-741f-4093-a971-b3ad69411ac1 | Sample VNF | ONBOARDED | NOT_IN_USE | ENABLED |
+--------------------------------------+------------------+------------------+-------------+-------------------+
Create & Instantiate VNF
------------------------
@ -427,14 +505,14 @@ Create VNF
.. code-block:: console
$ openstack vnf package show \
e712a702-741f-4093-a971-b3ad69411ac1 -c 'VNFD ID'
156f1c4f-bfe2-492b-a079-a1bad32c0c3d -c 'VNFD ID'
+---------+--------------------------------------+
| Field | Value |
+---------+--------------------------------------+
| VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
+---------+--------------------------------------+
#. Create VNF:
The "VNFD ID" ``b1bb0ce7-ebca-4fa7-95ed-4840d70a1177`` needs to be replaced
@ -442,24 +520,31 @@ Create VNF
.. code-block:: console
$ openstack vnflcm create \
b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 --fit-width
$ openstack vnflcm create b1bb0ce7-ebca-4fa7-95ed-4840d70a1177
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
| ID | 810d8c9b-e467-4b06-9265-ac9dce015fce |
| Instantiation State | NOT_INSTANTIATED |
| Links | { |
| | "self": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/810d8c9b-e467-4b06-9265-ac9dce015fce" |
| | }, |
| | "instantiate": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/810d8c9b-e467-4b06-9265-ac9dce015fce/instantiate" |
| | } |
| | } |
| VNF Configurable Properties | |
| VNF Instance Description | |
| VNF Instance Name | vnf-810d8c9b-e467-4b06-9265-ac9dce015fce |
| 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 | |
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
+--------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+--------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ID | 725f625e-f6b7-4bcd-b1b7-7184039fde45 |
| Instantiation State | NOT_INSTANTIATED |
| Links | instantiate=href=/vnflcm/v1/vnf_instances/725f625e-f6b7-4bcd-b1b7-7184039fde45/instantiate, |
| | self=href=/vnflcm/v1/vnf_instances/725f625e-f6b7-4bcd-b1b7-7184039fde45 |
| VNF Instance Description | None |
| VNF Instance Name | None |
| VNF Product Name | Sample VNF |
| VNF Provider | Company |
| VNF Software Version | 1.0 |
| VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
| VNFD Version | 1.0 |
+--------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
Instantiate VNF
^^^^^^^^^^^^^^^
@ -481,6 +566,7 @@ Instantiate VNF
You can skip ``vimConnectionInfo`` only when you have the default VIM.
A sample ``<param-file>`` named as ``sample_param_file.json`` with
minimal parametes:
@ -488,27 +574,33 @@ Instantiate VNF
$ vi ./sample_param_file.json
- When using TOSCA, use the following parameters.
.. literalinclude:: ../../../samples/etsi_getting_started/tosca/lcm_instantiate_request/sample_param_file.json
:language: json
:language: json
- [This is UserData specific part] When using UserData, use the following parameters instead.
.. literalinclude:: ../../../samples/etsi_getting_started/userdata/lcm_instantiate_request/sample_param_file.json
:language: json
:language: json
``${network_uuid}``, ``${subnet_uuid}`` and ``${vim_uuid}`` should be
replaced with the uuid of the network to use, the uuid of the subnet to use
and the uuid of the VIM to use, respectively.
.. hint::
You can find uuids of the network and the corresponding subnet with this command [#f10]_:
You can find uuids of the network and the corresponding subnet with
`network command`_:
.. code-block:: console
$ openstack network list
#. Instantiate VNF:
The "ID of vnf instance" and "path to <param-file>" are needed to
@ -517,48 +609,126 @@ Instantiate VNF
.. code-block:: console
$ openstack vnflcm instantiate \
725f625e-f6b7-4bcd-b1b7-7184039fde45 ./sample_param_file.json
810d8c9b-e467-4b06-9265-ac9dce015fce ./sample_param_file.json
Instantiate request for VNF Instance 810d8c9b-e467-4b06-9265-ac9dce015fce has been accepted.
instantiate request for vnf instance 725f625e-f6b7-4bcd-b1b7-7184039fde45 has been accepted.
Check the details of the instantiated vnf.
.. code-block:: console
$ openstack vnflcm list
+--------------------------------------+------------------------------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| ID | VNF Instance Name | Instantiation State | VNF Provider | VNF Software Version | VNF Product Name | VNFD ID |
+--------------------------------------+------------------------------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| 810d8c9b-e467-4b06-9265-ac9dce015fce | vnf-810d8c9b-e467-4b06-9265-ac9dce015fce | INSTANTIATED | Company | 1.0 | Sample VNF | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
+--------------------------------------+------------------------------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
+--------------------------------------+-------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| ID | VNF Instance Name | Instantiation State | VNF Provider | VNF Software Version | VNF Product Name | VNFD ID |
+--------------------------------------+-------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| 725f625e-f6b7-4bcd-b1b7-7184039fde45 | None | INSTANTIATED | Company | 1.0 | Sample VNF | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
+--------------------------------------+-------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
$ openstack vnflcm show 810d8c9b-e467-4b06-9265-ac9dce015fce
+-----------------------------+----------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------+
| ID | 810d8c9b-e467-4b06-9265-ac9dce015fce |
| Instantiated Vnf Info | { |
| | "flavourId": "simple", |
| | "vnfState": "STARTED", |
| | "extCpInfo": [], |
| | "vnfcResourceInfo": [ |
| | { |
| | "id": "6894448f-4a88-45ec-801f-4ef455e8a613", |
| | "vduId": "VDU1", |
| | "computeResource": { |
| | "vimConnectionId": "662e5f4f-3b16-4ca6-b560-28b62dd0e13b", |
| | "resourceId": "cfb5d6de-90a1-433a-9af4-1159ca279e27", |
| | "vimLevelResourceType": "OS::Nova::Server" |
| | }, |
| | "storageResourceIds": [], |
| | "vnfcCpInfo": [ |
| | { |
| | "id": "b6dffe31-2e4b-44e6-8ddd-b94608a9210b", |
| | "cpdId": "CP1", |
| | "vnfExtCpId": null, |
| | "vnfLinkPortId": "5040ae0d-ef8b-4d12-b96b-d9d05a0ba7fe" |
| | } |
| | ] |
| | } |
| | ], |
| | "vnfVirtualLinkResourceInfo": [ |
| | { |
| | "id": "4b67e6f9-8133-4f7d-b384-abd64f9bcbac", |
| | "vnfVirtualLinkDescId": "internalVL1", |
| | "networkResource": { |
| | "vimConnectionId": "662e5f4f-3b16-4ca6-b560-28b62dd0e13b", |
| | "resourceId": "d04beb5f-b29a-4f7e-b32b-7ea669afa3eb", |
| | "vimLevelResourceType": "OS::Neutron::Net" |
| | }, |
| | "vnfLinkPorts": [ |
| | { |
| | "id": "5040ae0d-ef8b-4d12-b96b-d9d05a0ba7fe", |
| | "resourceHandle": { |
| | "vimConnectionId": "662e5f4f-3b16-4ca6-b560-28b62dd0e13b", |
| | "resourceId": "84edd7c7-a02f-4f25-be2a-a0ee5b1c8dc7", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "b6dffe31-2e4b-44e6-8ddd-b94608a9210b" |
| | } |
| | ] |
| | } |
| | ], |
| | "vnfcInfo": [ |
| | { |
| | "id": "6c0ba2a3-3f26-4ba0-9b4f-db609b2e843c", |
| | "vduId": "VDU1", |
| | "vnfcState": "STARTED" |
| | } |
| | ], |
| | "additionalParams": {} |
| | } |
| Instantiation State | INSTANTIATED |
| Links | { |
| | "self": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/810d8c9b-e467-4b06-9265-ac9dce015fce" |
| | }, |
| | "terminate": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/810d8c9b-e467-4b06-9265-ac9dce015fce/terminate" |
| | }, |
| | "heal": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/810d8c9b-e467-4b06-9265-ac9dce015fce/heal" |
| | }, |
| | "changeExtConn": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/810d8c9b-e467-4b06-9265-ac9dce015fce/change_ext_conn" |
| | } |
| | } |
| VIM Connection Info | [ |
| | { |
| | "id": "e24f9796-a8e9-4cb0-85ce-5920dcddafa1", |
| | "vimId": "662e5f4f-3b16-4ca6-b560-28b62dd0e13b", |
| | "vimType": "ETSINFV.OPENSTACK_KEYSTONE.v_2", |
| | "interfaceInfo": {}, |
| | "accessInfo": {}, |
| | "extra": {} |
| | }, |
| | { |
| | "id": "67820f17-a82a-4e3a-b200-8ef119646749", |
| | "vimId": "662e5f4f-3b16-4ca6-b560-28b62dd0e13b", |
| | "vimType": "openstack", |
| | "interfaceInfo": {}, |
| | "accessInfo": {}, |
| | "extra": {} |
| | } |
| | ] |
| VNF Configurable Properties | |
| VNF Instance Description | |
| VNF Instance Name | vnf-810d8c9b-e467-4b06-9265-ac9dce015fce |
| VNF Product Name | Sample VNF |
| VNF Provider | Company |
| VNF Software Version | 1.0 |
| VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
| VNFD Version | 1.0 |
| metadata | tenant=admin |
| vnfPkgId | |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------+
$ openstack vnflcm show \
725f625e-f6b7-4bcd-b1b7-7184039fde45 --fit-width
+--------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+--------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ID | 725f625e-f6b7-4bcd-b1b7-7184039fde45 |
| Instantiated Vnf Info | , extCpInfo='[]', flavourId='simple', vnfState='STARTED', vnfVirtualLinkResourceInfo='[{'id': '0163cea3-af88-4ef8-ae43-ef3e5e7e827d', |
| | 'vnfVirtualLinkDescId': 'internalVL1', 'networkResource': {'resourceId': '073c74b9-670d-4764-a933-6fe4f2f991c1', 'vimLevelResourceType': |
| | 'OS::Neutron::Net'}, 'vnfLinkPorts': [{'id': '3b667826-336c-4919-889e-e6c63d959ee6', 'resourceHandle': {'resourceId': |
| | '5d3255b5-e9fb-449f-9c5f-5242049ce2fa', 'vimLevelResourceType': 'OS::Neutron::Port'}, 'cpInstanceId': '3091f046-de63-44c8-ad23-f86128409b27'}]}]', |
| | vnfcResourceInfo='[{'id': '2a66f545-c90d-49e7-8f17-fb4e57b19c92', 'vduId': 'VDU1', 'computeResource': {'resourceId': |
| | '6afc547d-0e19-46fc-b171-a3d9a0a80513', 'vimLevelResourceType': 'OS::Nova::Server'}, 'storageResourceIds': [], 'vnfcCpInfo': [{'id': |
| | '3091f046-de63-44c8-ad23-f86128409b27', 'cpdId': 'CP1', 'vnfExtCpId': None, 'vnfLinkPortId': '3b667826-336c-4919-889e-e6c63d959ee6'}]}]' |
| Instantiation State | INSTANTIATED |
| Links | heal=href=/vnflcm/v1/vnf_instances/725f625e-f6b7-4bcd-b1b7-7184039fde45/heal, self=href=/vnflcm/v1/vnf_instances/725f625e-f6b7-4bcd-b1b7-7184039fde45, |
| | terminate=href=/vnflcm/v1/vnf_instances/725f625e-f6b7-4bcd-b1b7-7184039fde45/terminate |
| VIM Connection Info | [] |
| VNF Instance Description | None |
| VNF Instance Name | None |
| VNF Product Name | Sample VNF |
| VNF Provider | Company |
| VNF Software Version | 1.0 |
| VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
| VNFD Version | 1.0 |
+--------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
Terminate & Delete VNF
----------------------
@ -571,12 +741,12 @@ Terminate VNF
.. code-block:: console
$ openstack vnflcm list
+--------------------------------------+------------------------------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| ID | VNF Instance Name | Instantiation State | VNF Provider | VNF Software Version | VNF Product Name | VNFD ID |
+--------------------------------------+------------------------------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| 810d8c9b-e467-4b06-9265-ac9dce015fce | vnf-810d8c9b-e467-4b06-9265-ac9dce015fce | INSTANTIATED | Company | 1.0 | Sample VNF | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
+--------------------------------------+------------------------------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
+--------------------------------------+-------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| ID | VNF Instance Name | Instantiation State | VNF Provider | VNF Software Version | VNF Product Name | VNFD ID |
+--------------------------------------+-------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| 725f625e-f6b7-4bcd-b1b7-7184039fde45 | None | INSTANTIATED | Company | 1.0 | Sample VNF | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
+--------------------------------------+-------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
#. Terminate VNF Instance:
@ -584,22 +754,21 @@ Terminate VNF
.. code-block:: console
$ openstack vnflcm terminate 725f625e-f6b7-4bcd-b1b7-7184039fde45
$ openstack vnflcm terminate 810d8c9b-e467-4b06-9265-ac9dce015fce
Terminate request for VNF Instance '810d8c9b-e467-4b06-9265-ac9dce015fce' has been accepted.
Terminate request for VNF Instance '725f625e-f6b7-4bcd-b1b7-7184039fde45' has been accepted.
Check the status of VNF Instance:
.. code-block:: console
$ openstack vnflcm list --fit-width
$ openstack vnflcm list
+--------------------------------------+------------------------------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| ID | VNF Instance Name | Instantiation State | VNF Provider | VNF Software Version | VNF Product Name | VNFD ID |
+--------------------------------------+------------------------------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| 810d8c9b-e467-4b06-9265-ac9dce015fce | vnf-810d8c9b-e467-4b06-9265-ac9dce015fce | NOT_INSTANTIATED | Company | 1.0 | Sample VNF | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
+--------------------------------------+------------------------------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
+----------------------+-------------------+---------------------+--------------+----------------------+------------------+-----------------------+
| ID | VNF Instance Name | Instantiation State | VNF Provider | VNF Software Version | VNF Product Name | VNFD ID |
+----------------------+-------------------+---------------------+--------------+----------------------+------------------+-----------------------+
| 725f625e-f6b7-4bcd-b | None | NOT_INSTANTIATED | Company | 1.0 | Sample VNF | b1bb0ce7-ebca-4fa7-95 |
| 1b7-7184039fde45 | | | | | | ed-4840d70a1177 |
+----------------------+-------------------+---------------------+--------------+----------------------+------------------+-----------------------+
Delete VNF
^^^^^^^^^^
@ -608,9 +777,9 @@ Delete VNF
.. code-block:: console
$ openstack vnflcm delete 725f625e-f6b7-4bcd-b1b7-7184039fde45
$ openstack vnflcm delete 810d8c9b-e467-4b06-9265-ac9dce015fce
Vnf instance '810d8c9b-e467-4b06-9265-ac9dce015fce' is deleted successfully
Vnf instance '725f625e-f6b7-4bcd-b1b7-7184039fde45' deleted successfully
Delete VNF Package
------------------
@ -622,47 +791,60 @@ Delete VNF Package
.. code-block:: console
$ openstack vnf package list
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
| Id | Vnf Product Name | Onboarding State | Usage State | Operational State | Links |
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
| 156f1c4f-bfe2-492b-a079-a1bad32c0c3d | Sample VNF | ONBOARDED | NOT_IN_USE | ENABLED | { |
| | | | | | "self": { |
| | | | | | "href": "/vnfpkgm/v1/vnf_packages/156f1c4f-bfe2-492b-a079-a1bad32c0c3d" |
| | | | | | }, |
| | | | | | "packageContent": { |
| | | | | | "href": "/vnfpkgm/v1/vnf_packages/156f1c4f-bfe2-492b-a079-a1bad32c0c3d/package_content" |
| | | | | | } |
| | | | | | } |
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
+--------------------------------------+------------------+------------------+-------------+-------------------+
| Id | Vnf Product Name | Onboarding State | Usage State | Operational State |
+--------------------------------------+------------------+------------------+-------------+-------------------+
| e712a702-741f-4093-a971-b3ad69411ac1 | Sample VNF | ONBOARDED | NOT_IN_USE | ENABLED |
+--------------------------------------+------------------+------------------+-------------+-------------------+
Update the Operational State to ``DISABLED``:
.. code-block:: console
$ openstack vnf package update \
--operational-state 'DISABLED' \
e712a702-741f-4093-a971-b3ad69411ac1
$ openstack vnf package update --operational-state 'DISABLED' \
156f1c4f-bfe2-492b-a079-a1bad32c0c3d
+-------------------+----------+
| Field | Value |
+-------------------+----------+
| Operational State | DISABLED |
+-------------------+----------+
Check the Operational State to be changed:
.. code-block:: console
$ openstack vnf package list
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
| Id | Vnf Product Name | Onboarding State | Usage State | Operational State | Links |
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
| 156f1c4f-bfe2-492b-a079-a1bad32c0c3d | Sample VNF | ONBOARDED | NOT_IN_USE | DISABLED | { |
| | | | | | "self": { |
| | | | | | "href": "/vnfpkgm/v1/vnf_packages/156f1c4f-bfe2-492b-a079-a1bad32c0c3d" |
| | | | | | }, |
| | | | | | "packageContent": { |
| | | | | | "href": "/vnfpkgm/v1/vnf_packages/156f1c4f-bfe2-492b-a079-a1bad32c0c3d/package_content" |
| | | | | | } |
| | | | | | } |
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
+--------------------------------------+------------------+------------------+-------------+-------------------+
| Id | Vnf Product Name | Onboarding State | Usage State | Operational State |
+--------------------------------------+------------------+------------------+-------------+-------------------+
| e712a702-741f-4093-a971-b3ad69411ac1 | Sample VNF | ONBOARDED | NOT_IN_USE | DISABLED |
+--------------------------------------+------------------+------------------+-------------+-------------------+
Delete the VNF Package:
.. code-block:: console
$ openstack vnf package delete e712a702-741f-4093-a971-b3ad69411ac1
$ openstack vnf package delete 156f1c4f-bfe2-492b-a079-a1bad32c0c3d
All specified vnf-package(s) deleted successfully
Trouble Shooting
----------------
@ -670,7 +852,7 @@ Trouble Shooting
.. code-block:: console
devstack tacker-conductor[8132]: 2020-05-25 09:17:12.976 TRACE oslo_messaging.rpc.server tacker.common.exceptions.VnfInstantiationFailed: Vnf instantiation failed for vnf ca2fe9cb-afba-40a5-aec6-b7ef643b0208, error: ERROR: HEAT-E99001 Service neutron is not available for resource type OS::Neutron::QoSPolicy, reason: Required extension qos in neutron service is not available.
Vnf instantiation failed for vnf 810d8c9b-e467-4b06-9265-ac9dce015fce, error: ERROR: HEAT-E99001 Service neutron is not available for resource type OS::Neutron::QoSPolicy, reason: Required extension qos in neutron service is not available.
#. Edit ``/etc/neutron/neutron.conf``:
@ -679,28 +861,33 @@ Trouble Shooting
$ sudo vi /etc/neutron/neutron.conf
.. code-block:: diff
- service_plugins = ovn-router,networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin,networking_sfc.services.sfc.plugin.SfcPlugin
+ service_plugins = ovn-router,networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin,networking_sfc.services.sfc.plugin.SfcPlugin,neutron.services.qos.qos_plugin.QoSPlugin,qos
#. Edit ``/etc/neutron/plugins/ml2/ml2_conf.ini``:
.. code-block:: console
$ sudo vi /etc/neutron/plugins/ml2/ml2_conf.ini
.. code-block:: diff
- extension_drivers = port_security
+ extension_drivers = port_security,qos
#. Restart neutron services:
.. code-block:: console
$ sudo systemctl restart devstack@q-*
- Error in networking-sfc
#. Disable networking-sfc by editting ``/etc/neutron/neutron.conf``:
@ -709,6 +896,7 @@ Trouble Shooting
$ sudo vi /etc/neutron/neutron.conf
.. code-block:: diff
- service_plugins = ovn-router,networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin,networking_sfc.services.sfc.plugin.SfcPlugin,neutron.services.qos.qos_plugin.QoSPlugin,qos
@ -719,31 +907,34 @@ Trouble Shooting
- [flowclassifier]
- drivers = ovs
#. Edit ``/etc/neutron/plugins/ml2/ml2_conf.ini``:
.. code-block:: console
$ sudo vi /etc/neutron/plugins/ml2/ml2_conf.ini
.. code-block:: diff
- [agent]
- extensions = sfc
#. Restart neutron services:
.. code-block:: console
$ sudo systemctl restart devstack@q-*
.. [#] https://docs.openstack.org/tacker/latest/user/etsi_vnf_deployment_as_vm_with_tosca.html
.. [#] https://docs.openstack.org/tacker/latest/user/etsi_vnf_deployment_as_vm_with_user_data.html
.. [#] https://opendev.org/openstack/tacker/src/branch/master/samples/etsi_getting_started/tosca
.. [#] https://opendev.org/openstack/tacker/src/branch/master/samples/etsi_getting_started/userdata
.. [#] https://docs.openstack.org/tacker/latest/install/index.html
.. [#] https://docs.openstack.org/liberty/install-guide-ubuntu/keystone-openrc.html
.. [#] https://docs.openstack.org/tacker/latest/cli/index.html
.. [#] https://forge.etsi.org/rep/nfv/SOL001
.. [#] https://docs.openstack.org/tacker/latest/user/vnfd-sol001.html
.. [#] https://docs.openstack.org/python-openstackclient/pike/cli/command-objects/network.html
.. _vim_config.yaml: https://opendev.org/openstack/tacker/src/branch/master/samples/etsi_getting_started/tosca/vim/vim_config.yaml
.. _samples/etsi_getting_started/tosca:
https://opendev.org/openstack/tacker/src/branch/master/samples/etsi_getting_started/tosca
.. _samples/etsi_getting_started/userdata:
https://opendev.org/openstack/tacker/src/branch/master/samples/etsi_getting_started/userdata
.. _Create OpenStack client environment scripts:
https://docs.openstack.org/keystone/latest/install/keystone-openrc-rdo.html
.. _vim_config.yaml:
https://opendev.org/openstack/tacker/src/branch/master/samples/etsi_getting_started/tosca/vim/vim_config.yaml
.. _SOL001: https://forge.etsi.org/rep/nfv/SOL001
.. _network command: https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/network.html

View File

@ -1,6 +1,11 @@
======================
v1/v2 Tacker Use Cases
======================
===================
v1 Tacker Use Cases
===================
.. note::
This is a document for Tacker v1 API.
See :doc:`/user/v2/use_case_guide` for Tacker v2 API.
VNF
@ -25,7 +30,7 @@ Container
:maxdepth: 1
etsi_containerized_vnf_usage_guide
etsi_cnf_helm_v2
Scale
^^^^^
@ -76,14 +81,6 @@ VM
etsi_vnf_update
Container
~~~~~~~~~
.. toctree::
:maxdepth: 1
etsi_cnf_update
Change External VNF Connectivity
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -95,26 +92,6 @@ VM
etsi_vnf_change_external_vnf_connectivity
Change Current VNF Package
^^^^^^^^^^^^^^^^^^^^^^^^^^
VM
~~
.. toctree::
:maxdepth: 1
etsi_vnf_change_current_vnf_package
etsi_vnf_change_current_vnf_package_with_standard_user_data
coordinate_api_client_in_coordinatevnf_script
Container
~~~~~~~~~
.. toctree::
:maxdepth: 1
etsi_cnf_change_current_vnf_package
Error Handling
^^^^^^^^^^^^^^
@ -123,8 +100,6 @@ Error Handling
:maxdepth: 1
etsi_vnf_error_handling
db_sync_error_handling
placement_error_handling
.. TODO(h-asahina): add `Action Driver`
* https://etherpad.opendev.org/p/tacker-wallaby-revise-docs
@ -135,8 +110,8 @@ Management Driver
.. TODO(h-asahina): add `Overview`
* https://etherpad.opendev.org/p/tacker-wallaby-revise-docs
Kubernetes Cluster VNF (v1 API)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kubernetes Cluster VNF
~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 1
@ -147,48 +122,22 @@ Kubernetes Cluster VNF (v1 API)
mgmt_driver_deploy_k8s_pv_usage_guide
mgmt_driver_deploy_k8s_kubespary_usage_guide
Ansible Driver (v1 API)
~~~~~~~~~~~~~~~~~~~~~~~
Ansible Driver
~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 1
mgmt_driver_for_ansible_driver_usage_guide
Container Update (v1/v2 API)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Container Update
~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 1
mgmt_driver_for_container_update
FaultNotification AutoHealing (v2 API)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 1
fault_notification_use_case_guide
Prometheus Plugin
^^^^^^^^^^^^^^^^^
.. toctree::
:maxdepth: 1
prometheus_plugin_use_case_guide
Container
~~~~~~~~~
.. toctree::
:maxdepth: 1
etsi_cnf_auto_scaling_pm
etsi_cnf_auto_scaling_pm_threshold
etsi_cnf_auto_healing_fm
VNF Package
___________

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,14 @@
ETSI NFV-SOL Change External VNF Connectivity
=============================================
This document describes how to change external VNF connectivity in Tacker.
This document describes how to change external VNF connectivity
in Tacker v1 API.
.. note::
This is a document for Tacker v1 API.
See :doc:`/user/v2/vnf/chg_ext_conn` for Tacker v2 API.
Prerequisites
-------------
@ -13,13 +20,16 @@ The following packages should be installed:
* python-tackerclient
A default VIM should be registered according to
:doc:`../cli/cli-legacy-vim`.
:doc:`/cli/cli-legacy-vim`.
The VNF Package(sample_vnf_pkg.zip) used below is prepared
by referring to :doc:`./vnf-package`.
The VNF Package(sample_vnf_package_csar.zip) used below is prepared
by referring to :doc:`/user/vnf-package`.
Execute before "Terminate VNF" in the procedure of
:doc:`./etsi_vnf_deployment_as_vm_with_tosca`.
The procedure of prepare for scaling operation that from "register VIM" to
"Instantiate VNF", basically refer to
:doc:`/user/etsi_vnf_deployment_as_vm_with_user_data`.
This procedure uses an example using the sample VNF package.
Change External VNF Connectivity
@ -32,7 +42,7 @@ Assuming that the following VNF instance exists,
this instance will be changed.
Details of CLI commands are described in
:doc:`../cli/cli-etsi-vnflcm`.
:doc:`/cli/cli-etsi-vnflcm`.
For changing external VNF connectivity, you need to prepare a JSON-formatted
definition file before running command for changing the connectivity.
@ -41,60 +51,66 @@ definition file before running command for changing the connectivity.
.. code-block:: json
{
"extVirtualLinks": [
{
"id": "ce38f1e7-4aec-4325-bb78-9c4411f113b5",
"resourceId": "1a4054c8-dd6b-444b-9604-7a8fc8c1cc0c",
"extCps": [
"extVirtualLinks": [
{
"cpdId": "VDU2_CP2",
"cpConfig": [
{
"cpProtocolData": [
"id": "a96d2f5b-c01a-48e1-813c-76132965042c",
"resourceId": "3019b1e7-99d8-4748-97ac-104922bc78d9",
"vimConnectionId": "79a97d01-e5f3-4eaa-b2bc-8f513ecb8a56",
"extCps": [
{
"layerProtocol": "IP_OVER_ETHERNET",
"ipOverEthernet":
{
"ipAddresses": [
"cpdId": "VDU1_CP2",
"cpConfig": [
{
"type": "IPV4",
"fixedAddresses": ["22.22.2.200"],
"subnetId": "25f4a13f-0c20-4fff-85aa-5349fc4efee8"
"cpProtocolData": [
{
"layerProtocol": "IP_OVER_ETHERNET",
"ipOverEthernet": {
"ipAddresses": [
{
"type": "IPV4",
"subnetId": "43c8f5fa-fefd-4bd4-a0df-f985b6969339"
}
]
}
}
]
}
]
}
]
}
]
]
}
],
"vimConnectionInfo": [
{
"id": "79a97d01-e5f3-4eaa-b2bc-8f513ecb8a56",
"vimType": "ETSINFV.OPENSTACK_KEYSTONE.v_2",
"vimConnectionId": "79a97d01-e5f3-4eaa-b2bc-8f513ecb8a56",
"interfaceInfo": {
"endpoint": "http://127.0.0.1/identity"
},
"accessInfo": {
"username": "nfv_user",
"region": "RegionOne",
"password": "devstack",
"tenant": "1994d69783d64c00aadab564038c2fd7"
}
]
}
]
],
"additionalParams": {
"lcm-operation-user-data": "./UserData/lcm_user_data.py",
"lcm-operation-user-data-class": "SampleUserData"
}
],
"vimConnectionInfo": [
{
"id": "4405b1a4-d967-4f72-9bd5-12f2852bd56b",
"vimType": "ETSINFV.OPENSTACK_KEYSTONE.v_2",
"vimConnectionId": "4405b1a4-d967-4f72-9bd5-12f2852bd56b",
"interfaceInfo":
{
"endpoint": "http://127.0.0.1/identity"
},
"accessInfo":
{
"username": "nfv_user",
"region": "RegionOne",
"password": "devstack",
"tenant": "6bdc3a89b3ee4cef9ff1676a22ae7f3b"
}
}
]
}
.. note:: sample_param_file.json contains all the data of port resource information.
if no setting is contained, it is treated as a change in information.
.. note::
sample_param_file.json contains all the data of port resource information.
If no setting is contained, it is treated as a change in information.
.. note::
The change external VNF Connectivity operation can change the
``vimConnectionInfo`` associated with an existing VNF instance.
Even if change external VNF Connectivity operation specify multiple
@ -102,6 +118,7 @@ definition file before running command for changing the connectivity.
them will be used for life cycle management operations.
It is not possible to delete the key of registered ``vimConnectionInfo``.
How to Change the Specific Port Setting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -129,21 +146,54 @@ Result:
+--------------------------------------+------------------------------------------+-----------------+
Port information before operation:
.. code-block:: console
$ openstack port list --name PORT_NAME
+--------------------------------------+-------------------------------------------------------------------------------------------+-------------------+---------------------------------------------------------------------------+--------+
| ID | Name | MAC Address | Fixed IP Addresses | Status |
+--------------------------------------+-------------------------------------------------------------------------------------------+-------------------+---------------------------------------------------------------------------+--------+
| 0988d9dc-97ba-43be-944d-185e316785f9 | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a-VDU1_scale-3x6qwnzbj6ep- | fa:16:3e:fb:f9:87 | ip_address='22.22.1.16', subnet_id='d290cae3-0dbc-44a3-a043-1a50ded04a64' | ACTIVE |
| | gfrxqjt6nfqb-2ufs4pbsedui-VDU1_CP2-riva4ygcbnyz | | | |
+--------------------------------------+-------------------------------------------------------------------------------------------+-------------------+---------------------------------------------------------------------------+--------+
$ openstack stack resource list e9d4576f-950c-4076-a54d-35b5cf43ebdd -n 2 --filter name=VDU1_CP2
+---------------+--------------------------------------+-------------------+-----------------+----------------------+-----------------------------------------------------------------------------------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time | stack_name |
+---------------+--------------------------------------+-------------------+-----------------+----------------------+-----------------------------------------------------------------------------------------------+
| VDU1_CP2 | 0988d9dc-97ba-43be-944d-185e316785f9 | OS::Neutron::Port | CREATE_COMPLETE | 2023-12-28T02:32:04Z | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a-VDU1_scale-3x6qwnzbj6ep-gfrxqjt6nfqb-2ufs4pbsedui |
+---------------+--------------------------------------+-------------------+-----------------+----------------------+-----------------------------------------------------------------------------------------------+
$ openstack stack resource show \
vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a-VDU1_scale-3x6qwnzbj6ep-gfrxqjt6nfqb-2ufs4pbsedui \
VDU1_CP2 -f json | jq .attributes.fixed_ips
[
{
"subnet_id": "d290cae3-0dbc-44a3-a043-1a50ded04a64",
"ip_address": "22.22.1.16"
}
]
See `Heat CLI reference`_ for details on Heat CLI commands.
Change External VNF Connectivity execution of the entire VNF:
.. code-block:: console
$ openstack vnflcm change-ext-conn VNF_INSTANCE_ID \
./sample_param_file.json
./sample_param_file.json
Result:
.. code-block:: console
Change External VNF Connectivity for VNF Instance 725f625e-f6b7-4bcd-b1b7-7184039fde45 has been accepted.
Change External VNF Connectivity for VNF Instance 0c3644ff-b207-4a6a-9d3a-d1295cda153a has been accepted.
.. note::
Create a parameter file that describes the resource information to be changed in advance.
@ -158,84 +208,72 @@ Result:
.. code-block:: console
+--------------------------------------+------------------------------------------+-----------------+
| ID | Stack Name | Stack Status |
+--------------------------------------+------------------------------------------+-----------------+
| ad077101-b093-4785-9ca5-cc7c1379bb10 | vnf-9e086f34-b3c9-4986-b5e5-609a5ac4c1f9 | UPDATE_COMPLETE |
+--------------------------------------+------------------------------------------+-----------------+
+--------------------------------------+---------------------------------------------+-----------------+
| ID | Stack Name | Stack Status |
+--------------------------------------+---------------------------------------------+-----------------+
| e9d4576f-950c-4076-a54d-35b5cf43ebdd | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a | UPDATE_COMPLETE |
+--------------------------------------+---------------------------------------------+-----------------+
.. note::
'Stack Status' transitions to UPDATE_COMPLETE.
'Stack Status' transitions to UPDATE_COMPLETE.
Stack resource information:
.. code-block:: console
$ openstack stack resource list ad077101-b093-4785-9ca5-cc7c1379bb10 -n 2
$ openstack stack resource list e9d4576f-950c-4076-a54d-35b5cf43ebdd \
-n 2 --filter name=VDU1
Result:
.. code-block:: console
+----------------------+--------------------------------------+----------------------------+-----------------+----------------------+-----------------------------------------------------------------------------------------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time | stack_name |
+----------------------+--------------------------------------+----------------------------+-----------------+----------------------+-----------------------------------------------------------------------------------------------------+
| 6mvcg7rftabt | 29f94441-bc14-4342-92f3-01eed02babb1 | VDU1.yaml | UPDATE_COMPLETE | 2021-03-25T06:02:42Z | vnflcm_8f054b70-93e9-46d5-a3bb-6404b99f91fb-VDU1_scale_group-gjwwa6637ur2 |
| ijarluromf6z | 42b84c3e-c017-4386-9dfa-f366bef5f42b | VDU2.yaml | UPDATE_COMPLETE | 2021-03-25T06:03:23Z | vnflcm_8f054b70-93e9-46d5-a3bb-6404b99f91fb-VDU2_scale_group-kjap6b2asrne |
| xmexppdgpb3d | 2a534d04-2f6a-4dd8-ba05-d79e0ced46e8 | VDU2.yaml | UPDATE_COMPLETE | 2021-03-25T06:03:24Z | vnflcm_8f054b70-93e9-46d5-a3bb-6404b99f91fb-VDU2_scale_group-kjap6b2asrne |
+----------------------+--------------------------------------+----------------------------+-----------------+----------------------+-----------------------------------------------------------------------------------------------------+
+---------------+--------------------------------------+------------------+-----------------+----------------------+-----------------------------------------------------------------------------------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time | stack_name |
+---------------+--------------------------------------+------------------+-----------------+----------------------+-----------------------------------------------------------------------------------------------+
| VDU1 | f32848eb-598f-4158-8896-5ea9479456de | OS::Nova::Server | UPDATE_COMPLETE | 2023-12-28T07:12:36Z | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a-VDU1_scale-3x6qwnzbj6ep-gfrxqjt6nfqb-2ufs4pbsedui |
+---------------+--------------------------------------+------------------+-----------------+----------------------+-----------------------------------------------------------------------------------------------+
Stack resource detailed information:
Port resource information:
.. code-block:: console
$ openstack stack resource show 42b84c3e-c017-4386-9dfa-f366bef5f42b VDU2_CP2 --fit-width
$ openstack port list --name PORT_NAME
+--------------------------------------+-------------------------------------------------------------------------------------------+-------------------+----------------------------------------------------------------------------+--------+
| ID | Name | MAC Address | Fixed IP Addresses | Status |
+--------------------------------------+-------------------------------------------------------------------------------------------+-------------------+----------------------------------------------------------------------------+--------+
| 8fcc7ddf-45cb-4ff6-a17f-4b18b9ab6a63 | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a-VDU1_scale-3x6qwnzbj6ep- | fa:16:3e:75:50:e8 | ip_address='10.10.0.136', subnet_id='43c8f5fa-fefd-4bd4-a0df-f985b6969339' | ACTIVE |
| | gfrxqjt6nfqb-2ufs4pbsedui-VDU1_CP2-gy4cxuefplkg | | | |
+--------------------------------------+-------------------------------------------------------------------------------------------+-------------------+----------------------------------------------------------------------------+--------+
$ openstack stack resource list e9d4576f-950c-4076-a54d-35b5cf43ebdd -n 2 --filter name=VDU1_CP2
+---------------+--------------------------------------+-------------------+-----------------+----------------------+-----------------------------------------------------------------------------------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time | stack_name |
+---------------+--------------------------------------+-------------------+-----------------+----------------------+-----------------------------------------------------------------------------------------------+
| VDU1_CP2 | 8fcc7ddf-45cb-4ff6-a17f-4b18b9ab6a63 | OS::Neutron::Port | CREATE_COMPLETE | 2023-12-28T07:12:35Z | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a-VDU1_scale-3x6qwnzbj6ep-gfrxqjt6nfqb-2ufs4pbsedui |
+---------------+--------------------------------------+-------------------+-----------------+----------------------+-----------------------------------------------------------------------------------------------+
$ openstack stack resource show \
vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a-VDU1_scale-3x6qwnzbj6ep-gfrxqjt6nfqb-2ufs4pbsedui \
VDU1_CP2 -f json | jq .attributes.fixed_ips
[
{
"subnet_id": "43c8f5fa-fefd-4bd4-a0df-f985b6969339",
"ip_address": "10.10.0.136"
}
]
Result:
.. note::
.. code-block:: console
+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| attributes | {'id': '958d4fd4-f579-4936-8898-04b6ec521a56', 'name': 'vnflcm_8f054b70-93e9-46d5-a3bb-6404b99f91fb-VDU2_scale_group-kjap6b2asrne-ijarluromf6z-zci6ve7ul27n-VDU2_CP2-i2k7w5mbvt7h', 'network_id': |
| | 'b6cd5128-4dd8-4564-89b4-879db6e12ada', 'tenant_id': 'f76fec29816c470e92c9d88c529802b9', 'mac_address': 'fa:16:3e:f1:c9:93', 'admin_state_up': True, 'status': 'ACTIVE', 'device_id': '0edf0aa8-be46-41af- |
| | abd6-6ba8440f1247', 'device_owner': 'compute:nova', 'fixed_ips': [{'subnet_id': '25f4a13f-0c20-4fff-85aa-5349fc4efee8', 'ip_address': '22.22.2.200'}], 'allowed_address_pairs': [], 'extra_dhcp_opts': [], |
| | 'security_groups': ['20f992ca-ad73-4d41-a503-0ad5866f6a84'], 'description': '', 'binding:vnic_type': 'normal', 'binding:profile': {}, 'binding:host_id': 'tackerhost', 'binding:vif_type': 'ovs', |
| | 'binding:vif_details': {'connectivity': 'l2', 'port_filter': True, 'ovs_hybrid_plug': False, 'datapath_type': 'system', 'bridge_name': 'tacker_bridge'}, 'port_security_enabled': True, 'qos_policy_id': None, |
| | 'qos_network_policy_id': None, 'resource_request': None, 'tags': [], 'created_at': '2021-04-12T00:05:00Z', 'updated_at': '2021-04-12T00:10:00Z', 'revision_number': 4, 'project_id': |
| | 'f76fec29816c470e92c9d88c529802b9'} |
+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. note:: you can check "fixed_ips" in attributes field.
Another way to check is by using "openstack port" command.
.. code-block:: console
$ openstack port list --sort-column Name --fit-width
Result:
.. code-block:: console
+--------------------------------------+-----------------------------------------------------------------------------------+-------------------+-----------------------------------------------------------------------------------+--------+
| ID | Name | MAC Address | Fixed IP Addresses | Status |
+--------------------------------------+-----------------------------------------------------------------------------------+-------------------+-----------------------------------------------------------------------------------+--------+
| 958d4fd4-f579-4936-8898-04b6ec521a56 | vnflcm_8f054b70-93e9-46d5-a3bb-6404b99f91fb-VDU2_scale_group-kjap6b2asrne- | fa:16:3e:f1:c9:93 | ip_address='22.22.2.200', subnet_id='25f4a13f-0c20-4fff-85aa-5349fc4efee8' | ACTIVE |
| | ijarluromf6z-zci6ve7ul27n-VDU2_CP2-i2k7w5mbvt7h | | | |
+--------------------------------------+-----------------------------------------------------------------------------------+-------------------+-----------------------------------------------------------------------------------+--------+
See `Heat CLI reference`_. for details on Heat CLI commands.
'subnet_id' has been changed from 'd290cae3-0dbc-44a3-a043-1a50ded04a64'
to '43c8f5fa-fefd-4bd4-a0df-f985b6969339'.
'ip_address' has been changed from '22.22.1.16' to '10.10.0.136'.
.. _NFV-SOL002 v2.6.1 : https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/002/02.06.01_60/gs_NFV-SOL002v020601p.pdf
.. _Change External VNF Connectivity API reference : https://docs.openstack.org/api-ref/orchestration/v1/index.html
.. _Heat CLI reference : https://docs.openstack.org/python-openstackclient/latest/cli/plugin-commands/heat.html

View File

@ -3,7 +3,13 @@ ETSI NFV-SOL VNF Deployment as VM with TOSCA
============================================
This document describes how to deploy VNF as VM with TOSCA
in Tacker using CLI commands.
in Tacker v1 API using CLI commands.
.. note::
This is a document for Tacker v1 API.
See :doc:`/user/v2/vnf/deployment_with_tosca/index` for Tacker v2 API.
Overview
--------
@ -13,9 +19,9 @@ The diagram below shows an overview of the VNF deployment.
1. Request create VNF
A user requests tacker-server to create a VNF with tacker-client by
uploading a VNF Package and requesting ``create VNF``. The VNF Package
should contain ``VNFD``. The detailed explanation of ``VNFD`` can be found
in :doc:`./vnf-package`.
uploading a VNF Package and requesting ``create VNF``. The VNF Package
should contain ``VNFD``. The detailed explanation of ``VNFD`` can be found
in :doc:`/user/vnf-package`.
2. Request instantiate VNF
@ -25,17 +31,16 @@ The diagram below shows an overview of the VNF deployment.
3. Call OpenStack Heat API
Upon receiving a request from tacker-client, tacker-server redirects it to
tacker-conductor. In tacker-conductor, the request is redirected again to
tacker-conductor. In tacker-conductor, the request is redirected again to
an appropriate infra-driver (in this case OpenStack infra-driver) according
to the contents of the instantiate parameters. Then, OpenStack infra-driver
to the contents of the instantiate parameters. Then, OpenStack infra-driver
calls OpenStack Heat APIs to create a VM as a VNF.
4. Create a VM
OpenStack Heat creates a VM according to the API calls.
.. figure:: ../_images/etsi_vnf_deployment_as_vm_with_tosca.png
:align: left
.. figure:: /_images/etsi_vnf_deployment_as_vm_with_tosca.png
Prerequisites
@ -47,10 +52,98 @@ The following packages should be installed:
* python-tackerclient
A default VIM should be registered according to
:doc:`../cli/cli-legacy-vim`.
:doc:`/cli/cli-legacy-vim`.
The VNF Package(sample_vnf_pkg.zip) used below is prepared
by referring to :doc:`./vnf-package`.
As an example, you can register default VIM as follow.
.. code-block:: console
$ cat vim_config.yaml
auth_url: "http://192.168.56.10/identity"
username: "admin"
password: "devstack"
project_name: "admin"
domain_name: "default"
project_domain_name: "default"
user_domain_name: "default"
cert_verify: "True"
$ openstack vim register --config-file vim_config.yaml \
--is-default openstack-admin-vim
+----------------+-----------------------------------------------------+
| Field | Value |
+----------------+-----------------------------------------------------+
| auth_cred | { |
| | "username": "admin", |
| | "user_domain_name": "default", |
| | "cert_verify": "True", |
| | "project_id": null, |
| | "project_name": "admin", |
| | "project_domain_name": "default", |
| | "auth_url": "http://192.168.56.10/identity/v3", |
| | "key_type": "barbican_key", |
| | "secret_uuid": "***", |
| | "password": "***" |
| | } |
| auth_url | http://192.168.56.10/identity/v3 |
| created_at | 2023-12-21 07:39:09.617234 |
| description | |
| extra | |
| id | 662e5f4f-3b16-4ca6-b560-28b62dd0e13b |
| is_default | True |
| name | openstack-admin-vim |
| placement_attr | { |
| | "regions": [ |
| | "RegionOne" |
| | ] |
| | } |
| project_id | 1994d69783d64c00aadab564038c2fd7 |
| status | ACTIVE |
| type | openstack |
| updated_at | None |
| vim_project | { |
| | "name": "admin", |
| | "project_domain_name": "default" |
| | } |
+----------------+-----------------------------------------------------+
The VNF Package(sample_vnf_package_csar.zip) used below is prepared
by referring to :doc:`/user/vnf-package`.
As an example, you can create a VNF Package as follow.
.. code-block:: console
$ cd TACKER_ROOT/samples/etsi_getting_started/tosca/sample_vnf_package_csar
$ zip sample_vnf_package_csar.zip -r Definitions/ Files/ TOSCA-Metadata/
updating: Definitions/ (stored 0%)
updating: Definitions/sample_vnfd_types.yaml (deflated 71%)
updating: Definitions/etsi_nfv_sol001_vnfd_types.yaml (deflated 84%)
updating: Definitions/etsi_nfv_sol001_common_types.yaml (deflated 77%)
updating: Definitions/sample_vnfd_df_simple.yaml (deflated 66%)
updating: Definitions/sample_vnfd_top.yaml (deflated 55%)
updating: Files/ (stored 0%)
updating: Files/images/ (stored 0%)
updating: Files/images/cirros-0.5.2-x86_64-disk.img (deflated 3%)
updating: TOSCA-Metadata/ (stored 0%)
updating: TOSCA-Metadata/TOSCA.meta (deflated 15%)
$ ll
...
drwxr-xr-x 2 stack stack 4096 Dec 21 08:50 Definitions/
drwxr-xr-x 3 stack stack 4096 Dec 21 03:53 Files/
-rw-rw-r-- 1 stack stack 15761428 Dec 21 08:50 sample_vnf_package_csar.zip
drwxr-xr-x 2 stack stack 4096 Dec 21 07:41 TOSCA-Metadata/
.. note::
In this document, ``TACKER_ROOT`` is the root of tacker's repository on
the server.
After you have done the above, you will have the sample VNF package
`sample_vnf_package_csar.zip`.
VNF Deployment Procedure as VM
@ -59,7 +152,7 @@ VNF Deployment Procedure as VM
In order to deploy VNF as VM, it is necessary to execute
the following procedure.
Details of CLI commands are described in
:doc:`../cli/cli-etsi-vnfpkgm` and :doc:`../cli/cli-etsi-vnflcm`.
:doc:`/cli/cli-etsi-vnfpkgm` and :doc:`/cli/cli-etsi-vnflcm`.
1. Create VNF Package Info
@ -76,17 +169,23 @@ Result:
.. code-block:: console
+-------------------+----------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------+----------------------------------------------------------------------------------------------------+
| ID | e712a702-741f-4093-a971-b3ad69411ac1 |
| Links | packageContent=href=/vnfpkgm/v1/vnf_packages/e712a702-741f-4093-a971-b3ad69411ac1/package_content, |
| | self=href=s/vnfpkgm/v1/vnf_packages/e712a702-741f-4093-a971-b3ad69411ac1 |
| Onboarding State | CREATED |
| Operational State | DISABLED |
| Usage State | NOT_IN_USE |
| User Defined Data | |
+-------------------+----------------------------------------------------------------------------------------------------+
+-------------------+-------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------+-------------------------------------------------------------------------------------------------+
| ID | 156f1c4f-bfe2-492b-a079-a1bad32c0c3d |
| Links | { |
| | "self": { |
| | "href": "/vnfpkgm/v1/vnf_packages/156f1c4f-bfe2-492b-a079-a1bad32c0c3d" |
| | }, |
| | "packageContent": { |
| | "href": "/vnfpkgm/v1/vnf_packages/156f1c4f-bfe2-492b-a079-a1bad32c0c3d/package_content" |
| | } |
| | } |
| Onboarding State | CREATED |
| Operational State | DISABLED |
| Usage State | NOT_IN_USE |
| User Defined Data | {} |
+-------------------+-------------------------------------------------------------------------------------------------+
After that, execute the following CLI command and confirm that
@ -99,7 +198,7 @@ VNF Package creation was successful.
.. code-block:: console
$ openstack vnf package show VNF_PACKAGE_ID \
-c 'Onboarding State' -c 'Operational State' -c 'Usage State'
-c 'Onboarding State' -c 'Operational State' -c 'Usage State'
Result:
@ -122,14 +221,14 @@ Execute the following CLI command to upload VNF Package.
.. code-block:: console
$ openstack vnf package upload --path sample_csar.zip VNF_PACKAGE_ID
$ openstack vnf package upload --path sample_vnf_package_csar.zip VNF_PACKAGE_ID
Result:
.. code-block:: console
Upload request for VNF package e712a702-741f-4093-a971-b3ad69411ac1 has been accepted.
Upload request for VNF package 156f1c4f-bfe2-492b-a079-a1bad32c0c3d has been accepted.
After that, execute the following CLI command and confirm that
@ -142,13 +241,15 @@ VNF Package uploading was successful.
'Create VNF Identifier'.
.. note::
The state of 'Onboarding State' changes in the order of
'UPLOADING', 'PROCESSING', 'ONBOARDED'.
The state of 'Onboarding State' changes in the order of
'UPLOADING', 'PROCESSING', 'ONBOARDED'.
.. code-block:: console
$ openstack vnf package show VNF_PACKAGE_ID \
-c 'Onboarding State' -c 'Operational State' -c 'Usage State' -c 'VNFD ID'
-c 'Onboarding State' -c 'Operational State' -c 'Usage State' -c 'VNFD ID'
Result:
@ -179,21 +280,29 @@ Result:
.. code-block:: console
+--------------------------+----------------------------------------------------------------------------------------------+
| Field | Value |
+--------------------------+----------------------------------------------------------------------------------------------+
| ID | 725f625e-f6b7-4bcd-b1b7-7184039fde45 |
| Instantiation State | NOT_INSTANTIATED |
| Links | instantiate=href=/vnflcm/v1/vnf_instances/725f625e-f6b7-4bcd-b1b7-7184039fde45/instantiate, |
| | self=href=/vnflcm/v1/vnf_instances/725f625e-f6b7-4bcd-b1b7-7184039fde45 |
| VNF Instance Description | None |
| VNF Instance Name | None |
| VNF Product Name | Sample VNF |
| VNF Provider | Company |
| VNF Software Version | 1.0 |
| VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
| VNFD Version | 1.0 |
+--------------------------+----------------------------------------------------------------------------------------------+
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
| ID | 810d8c9b-e467-4b06-9265-ac9dce015fce |
| Instantiation State | NOT_INSTANTIATED |
| Links | { |
| | "self": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/810d8c9b-e467-4b06-9265-ac9dce015fce" |
| | }, |
| | "instantiate": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/810d8c9b-e467-4b06-9265-ac9dce015fce/instantiate" |
| | } |
| | } |
| VNF Configurable Properties | |
| VNF Instance Description | |
| VNF Instance Name | vnf-810d8c9b-e467-4b06-9265-ac9dce015fce |
| 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 | |
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
After that, execute the following CLI command and confirm that
@ -205,8 +314,7 @@ VNF instance creation was successful.
.. code-block:: console
$ openstack vnf package show VNF_PACKAGE_ID \
-c 'Usage State'
$ openstack vnf package show VNF_PACKAGE_ID -c 'Usage State'
Result:
@ -222,8 +330,7 @@ Result:
.. code-block:: console
$ openstack vnflcm show VNF_INSTANCE_ID \
-c 'Instantiation State'
$ openstack vnflcm show VNF_INSTANCE_ID -c 'Instantiation State'
Result:
@ -246,10 +353,12 @@ These parameters will be set in the body of the instantiate request.
Required parameter:
* flavourID
* flavourId
.. note::
Details of flavourID is described in :doc:`./vnfd-sol001`.
Details of flavourId is described in :doc:`/user/vnfd-sol001`.
Optional parameters:
@ -257,28 +366,35 @@ Optional parameters:
* extVirtualLinks
* extManagedVirtualLinks
* vimConnectionInfo
* localizationLanguage
* additionalParams
* extensions
.. note::
You can skip ``vimConnectionInfo`` only when you have
the default VIM described in :doc:`../cli/cli-legacy-vim`.
You can skip ``vimConnectionInfo`` only when you have
the default VIM described in :doc:`/cli/cli-legacy-vim`.
.. note::
This operation can specify the ``vimConnectionInfo``
for the VNF instance.
Even if this operation specify multiple ``vimConnectionInfo``
associated with one VNF instance, only one of them will be used for
life cycle management operations.
This operation can specify the ``vimConnectionInfo``
for the VNF instance.
Even if this operation specify multiple ``vimConnectionInfo``
associated with one VNF instance, only one of them will be used for
life cycle management operations.
Param file with only required parameters:
An example of a param file with only required parameters:
.. code-block:: console
{
"flavourId":"simple"
"flavourId": "simple"
}
Param file with optional parameters:
An example of a param file with optional parameters:
.. code-block:: console
@ -287,47 +403,89 @@ Param file with optional parameters:
"instantiationLevelId": "instantiation_level_1",
"extVirtualLinks": [
{
"id": "net0",
"resourceId": "4bf3e646-7a24-4f04-a985-d8f4bb1203de", #Set the uuid of the network to use
"id": "279b0e12-2cc7-48d3-89dc-c58369841763",
"vimConnectionId": "4db40866-054f-472d-b559-811e5aa7195c",
"resourceProviderId": "Company",
"resourceId": "6a3aeb3a-fb8b-4d27-a5f1-4f148aeb303f",
"extCps": [
{
"cpdId": "CP1",
"cpConfig": [
{
"cpdId": "VDU1_CP1",
"cpConfig": {
"VDU1_CP1": {
"parentCpConfigId": "a9d72e2b-9b2f-48b8-9ca0-217ab3ba6f33",
"cpProtocolData": [
{
"layerProtocol": "IP_OVER_ETHERNET"
"layerProtocol": "IP_OVER_ETHERNET",
"ipOverEthernet": {
"ipAddresses": [
{
"type": "IPV4",
"numDynamicAddresses": 1,
"subnetId": "649c956c-1516-4d92-a6bc-ce936d8a880d"
}
]
}
}
]
}
]
}
}
],
"extLinkPorts": [
{
"id": "2871f033-5e38-4f5f-af26-09c6390648a8",
"resourceHandle": {
"resourceId": "389ade82-7618-4b42-bc90-5ebbac0863cf"
}
}
]
}
],
"extManagedVirtualLinks": [
{
"id": "c381e923-6208-43ac-acc9-f3afec76535a",
"vnfVirtualLinkDescId": "internalVL1",
"vimConnectionId": "4db40866-054f-472d-b559-811e5aa7195c",
"resourceProviderId": "Company",
"resourceId": "9a94da3c-239f-469d-8cf9-5313a4e3961a",
"extManagedMultisiteVirtualLinkId": "f850522e-c124-4ed9-8027-f15abc22e21d"
}
],
"vimConnectionInfo": [
{
"id": "e24f9796-a8e9-4cb0-85ce-5920dcddafa1", #Set a random uuid.
"vimId": "8a0fd79d-e224-4c27-85f5-ee79c6e0d870", #Set the uuid of the VIM to use
"id": "e24f9796-a8e9-4cb0-85ce-5920dcddafa1",
"vimId": "8a0fd79d-e224-4c27-85f5-ee79c6e0d870",
"vimType": "ETSINFV.OPENSTACK_KEYSTONE.v_2"
}
]
],
"localizationLanguage": "ja",
"additionalParams": {
"key": "value"
},
"extensions": {
"key": "value"
}
}
samlple_param_file.json used in this document is below.
.. literalinclude:: ../../../samples/etsi_getting_started/tosca/lcm_instantiate_request/sample_param_file.json
:language: json
Execute the following CLI command to instantiate VNF instance.
.. code-block:: console
$ openstack vnflcm instantiate VNF_INSTANCE_ID \
./sample_param_file.json
$ openstack vnflcm instantiate VNF_INSTANCE_ID ./sample_param_file.json
Result:
.. code-block:: console
Instantiate request for VNF Instance 725f625e-f6b7-4bcd-b1b7-7184039fde45 has been accepted.
Instantiate request for VNF Instance 810d8c9b-e467-4b06-9265-ac9dce015fce has been accepted.
After that, execute the following CLI command and confirm that
@ -337,8 +495,7 @@ VNF instance instantiation was successful.
.. code-block:: console
$ openstack vnflcm show VNF_INSTANCE_ID \
-c 'Instantiation State'
$ openstack vnflcm show VNF_INSTANCE_ID -c 'Instantiation State'
Result:
@ -352,7 +509,7 @@ Result:
+---------------------+--------------+
5. Terminate VNF
1. Terminate VNF
^^^^^^^^^^^^^^^^
Execute the following CLI command to terminate the VNF instance.
@ -366,7 +523,7 @@ Result:
.. code-block:: console
Terminate request for VNF Instance '725f625e-f6b7-4bcd-b1b7-7184039fde45' has been accepted.
Terminate request for VNF Instance '810d8c9b-e467-4b06-9265-ac9dce015fce' has been accepted.
After that, execute the following CLI command and confirm that
@ -377,7 +534,7 @@ VNF instance termination was successful.
.. code-block:: console
$ openstack vnflcm show VNF_INSTANCE_ID \
-c 'Instantiation State'
-c 'Instantiation State'
Result:
@ -405,7 +562,7 @@ Result:
.. code-block:: console
Vnf instance '725f625e-f6b7-4bcd-b1b7-7184039fde45' deleted successfully
Vnf instance '810d8c9b-e467-4b06-9265-ac9dce015fce' is deleted successfully
After that, execute the following CLI command and confirm that
@ -417,7 +574,7 @@ VNF instance deletion was successful.
.. code-block:: console
$ openstack vnf package show VNF_PACKAGE_ID \
-c 'Usage State'
-c 'Usage State'
Result:
@ -440,4 +597,5 @@ Result:
.. code-block:: console
Can not find requested vnf instance: 725f625e-f6b7-4bcd-b1b7-7184039fde45
Can not find requested vnf instance: 810d8c9b-e467-4b06-9265-ac9dce015fce

View File

@ -3,14 +3,24 @@ ETSI NFV-SOL VNF Deployment as VM with LCM Operation User Data
==============================================================
This document describes how to deploy VNF as VM with
LCM operation user data in Tacker using CLI commands.
LCM operation user data in Tacker v1 API using CLI commands.
Please check `LCM-user-data spec`_ and `NFV-SOL014 v2.8.1`_
for more information on LCM operation user data.
.. note::
Most of the content is the same as :doc:`./etsi_vnf_deployment_as_vm_with_tosca`,
but some have 'LCM operation user data' specific descriptions.
The part will be clarified with the notation [This is UserData specific part].
This is a document for Tacker v1 API.
See :doc:`/user/v2/vnf/deployment_with_user_data/index`
for Tacker v2 API.
.. note::
Most of the content is the same as
:doc:`/user/etsi_vnf_deployment_as_vm_with_tosca`,
but some have 'LCM operation user data' specific descriptions.
The part will be clarified with the notation [This is UserData specific part].
Overview
--------
@ -20,9 +30,10 @@ The diagram below shows an overview of the VNF deployment.
1. Request create VNF
A user requests tacker-server to create a VNF with tacker-client by
uploading a VNF Package and requesting ``create VNF``. The VNF Package
should contain ``BaseHOT`` and ``UserData`` in addition to ``VNFD``. The
detailed explanation of these contents can be found in :doc:`./vnf-package`.
uploading a VNF Package and requesting ``create VNF``. The VNF Package
should contain ``BaseHOT`` and ``UserData`` in addition to ``VNFD``.
The detailed explanation of these contents can be found in
:doc:`/user/vnf-package`.
2. Request instantiate VNF
@ -34,15 +45,15 @@ The diagram below shows an overview of the VNF deployment.
Upon receiving a request, tacker-server redirects it to tacker-conductor.
In tacker-conductor, the request is redirected again to an appropriate
infra-driver (in this case OpenStack infra-driver) according to the contents
of the instantiate parameters. Then, OpenStack infra-driver calls OpenStack
of the instantiate parameters. Then, OpenStack infra-driver calls OpenStack
Heat APIs to create a VM as a VNF.
4. Create a VM
OpenStack Heat creates a VM according to the API calls.
.. figure:: ../_images/etsi_vnf_deployment_as_vm_with_user_data.png
:align: left
.. figure:: /_images/etsi_vnf_deployment_as_vm_with_user_data.png
Prerequisites
-------------
@ -53,16 +64,18 @@ The following packages should be installed:
* python-tackerclient
A default VIM should be registered according to
:doc:`../cli/cli-legacy-vim`.
:doc:`/cli/cli-legacy-vim`.
The VNF Package(sample_vnf_pkg.zip) used below is prepared
by referring to :doc:`./vnf-package`.
The VNF Package(sample_vnf_package_csar.zip) used below is prepared
by referring to :doc:`/user/vnf-package`.
.. note:: [This is UserData specific part]
In order to deploy VNF using LCM operation user data,
it is necessary to include BaseHOT and UserData in the VNF Package,
which are optional in :doc:`./vnf-package`.
.. note::
[This is UserData specific part]
In order to deploy VNF using LCM operation user data,
it is necessary to include BaseHOT and UserData in the VNF Package,
which are optional in :doc:`/user/vnf-package`.
VNF Deployment Procedure as VM
@ -71,28 +84,29 @@ VNF Deployment Procedure as VM
In order to deploy VNF as a VM, it is necessary to execute
the following procedure.
Details of CLI commands are described in
:doc:`../cli/cli-etsi-vnfpkgm` and :doc:`../cli/cli-etsi-vnflcm`.
:doc:`/cli/cli-etsi-vnfpkgm` and :doc:`/cli/cli-etsi-vnflcm`.
Many procedures are the same as :doc:`./etsi_vnf_deployment_as_vm_with_tosca`,
Many procedures are the same as
:doc:`/user/etsi_vnf_deployment_as_vm_with_tosca`,
so refer to the doc for those procedures.
1. Create VNF Package Info
^^^^^^^^^^^^^^^^^^^^^^^^^^
See procedure in :doc:`./etsi_vnf_deployment_as_vm_with_tosca`.
See procedure in :doc:`/user/etsi_vnf_deployment_as_vm_with_tosca`.
2. Upload VNF Package
^^^^^^^^^^^^^^^^^^^^^
See procedure in :doc:`./etsi_vnf_deployment_as_vm_with_tosca`.
See procedure in :doc:`/user/etsi_vnf_deployment_as_vm_with_tosca`.
3. Create VNF Identifier
^^^^^^^^^^^^^^^^^^^^^^^^
See procedure in :doc:`./etsi_vnf_deployment_as_vm_with_tosca`.
See procedure in :doc:`/user/etsi_vnf_deployment_as_vm_with_tosca`.
4. Instantiate VNF
@ -108,18 +122,21 @@ Required parameter:
* additionalParams
.. note::
Details of flavourId is described in :doc:`./vnfd-sol001`.
Details of flavourId is described in :doc:`/user/vnfd-sol001`.
.. note::
[This is UserData specific part]
additionalParams is a parameter that can be described by KeyValuePairs.
By setting the following two parameters in this parameter,
instantiate using LCM operation user data becomes possible.
For file_name.py and class_name, set the file name and class name
described in Prerequisites.
* lcm-operation-user-data: ./UserData/file_name.py
* lcm-operation-user-data-class: class_name
[This is UserData specific part]
additionalParams is a parameter that can be described by KeyValuePairs.
By setting the following two parameters in this parameter,
instantiate using LCM operation user data becomes possible.
For file_name.py and class_name, set the file name and class name
described in Prerequisites.
* lcm-operation-user-data: ./UserData/file_name.py
* lcm-operation-user-data-class: class_name
Optional parameters:
@ -129,17 +146,21 @@ Optional parameters:
* vimConnectionInfo
.. note::
You can skip ``vimConnectionInfo`` only when you have
the default VIM described in :doc:`../cli/cli-legacy-vim`.
You can skip ``vimConnectionInfo`` only when you have
the default VIM described in :doc:`/cli/cli-legacy-vim`.
.. note::
This operation can specify the ``vimConnectionInfo``
for the VNF instance.
Even if this operation specify multiple ``vimConnectionInfo``
associated with one VNF instance, only one of them will be used for
life cycle management operations.
Param file with only required parameters:
This operation can specify the ``vimConnectionInfo``
for the VNF instance.
Even if this operation specify multiple ``vimConnectionInfo``
associated with one VNF instance, only one of them will be used for
life cycle management operations.
An example of a param file with only required parameters:
.. code-block:: console
@ -151,7 +172,8 @@ Param file with only required parameters:
}
}
Param file with optional parameters:
An example of a param file with optional parameters:
.. code-block:: console
@ -203,19 +225,24 @@ Param file with optional parameters:
}
samlple_param_file.json used in this document is below.
.. literalinclude:: ../../../samples/etsi_getting_started/userdata/lcm_instantiate_request/sample_param_file.json
:language: json
Execute the following CLI command to instantiate the VNF instance.
.. code-block:: console
$ openstack vnflcm instantiate VNF_INSTANCE_ID \
./sample_param_file.json
$ openstack vnflcm instantiate VNF_INSTANCE_ID ./sample_param_file.json
Result:
.. code-block:: console
Instantiate request for VNF Instance 725f625e-f6b7-4bcd-b1b7-7184039fde45 has been accepted.
Instantiate request for VNF Instance 810d8c9b-e467-4b06-9265-ac9dce015fce has been accepted.
After that, execute the following CLI command and confirm that
@ -225,8 +252,7 @@ VNF instance instantiation was successful.
.. code-block:: console
$ openstack vnflcm show VNF_INSTANCE_ID \
-c 'Instantiation State'
$ openstack vnflcm show VNF_INSTANCE_ID -c 'Instantiation State'
Result:
@ -243,14 +269,14 @@ Result:
5. Terminate VNF
^^^^^^^^^^^^^^^^
See procedure in :doc:`./etsi_vnf_deployment_as_vm_with_tosca`.
See procedure in :doc:`/user/etsi_vnf_deployment_as_vm_with_tosca`.
6. Delete VNF Identifier
^^^^^^^^^^^^^^^^^^^^^^^^
See procedure in :doc:`./etsi_vnf_deployment_as_vm_with_tosca`.
See procedure in :doc:`/user/etsi_vnf_deployment_as_vm_with_tosca`.
.. _LCM-user-data spec : https://specs.openstack.org/openstack/tacker-specs/specs/ussuri/lcm-operation-with-lcm-operation-user-data.html
.. _NFV-SOL014 v2.8.1 : https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/014/02.08.01_60/gs_NFV-SOL014v020801p.pdf

View File

@ -2,7 +2,13 @@
ETSI NFV-SOL VNF error-handling
===============================
This document describes how to error-handling VNF in Tacker.
This document describes how to error-handling VNF in Tacker v1 API.
.. note::
This is a document for Tacker v1 API.
See :doc:`/user/v2/error_handling` for Tacker v2 API.
Prerequisites
-------------
@ -13,14 +19,17 @@ The following packages should be installed:
* python-tackerclient
A default VIM should be registered according to
:doc:`../cli/cli-legacy-vim`.
:doc:`/cli/cli-legacy-vim`.
The VNF Package(sample_vnf_pkg.zip) used below is prepared
by referring to :doc:`./vnf-package`.
The VNF Package(sample_vnf_package_csar.zip) used below is prepared
by referring to :doc:`/user/vnf-package`.
Execute up to "Instantiate VNF" in the procedure of
:doc:`./etsi_vnf_deployment_as_vm_with_tosca`.
In other words, the procedure after "Terminate VNF" is not executed.
The procedure of prepare for healing operation that from "register VIM" to
"Instantiate VNF", basically refer to
:doc:`/user/etsi_vnf_deployment_as_vm_with_tosca` or
:doc:`/user/etsi_vnf_deployment_as_vm_with_user_data`.
This procedure uses an example using the sample VNF package.
VNF Error-handling Procedures
@ -30,7 +39,7 @@ As mentioned in Prerequisites, the VNF must be created
before performing error-handling.
Details of CLI commands are described in
:doc:`../cli/cli-etsi-vnflcm`.
:doc:`/cli/cli-etsi-vnflcm`.
There are some operations to error-handling VNF.
@ -46,17 +55,10 @@ First, the method of specifying the ID will be described.
Identify VNF_LCM_OP_OCC_ID
~~~~~~~~~~~~~~~~~~~~~~~~~~
To identify the VNF_LCM_OP_OCC_ID, you can get with the following ways.
* to check with CLI
* to check with notification API body
You can choose both ways.
This case uses openstack CLI:
The VNF_LCM_OP_OCC_ID can be obtained via CLI.
Details of CLI commands are described in
:doc:`../cli/cli-etsi-vnflcm`.
:doc:`/cli/cli-etsi-vnflcm`.
Before checking the "VNF_LCM_OP_OCC_ID", you should get VNF_INSTANCE_ID first.
@ -69,232 +71,49 @@ Result:
.. code-block:: console
+--------------------------------------+-----------------+--------------------------------------+-----------------+
| ID | Operation State | VNF Instance ID | Operation |
+--------------------------------------+-----------------+--------------------------------------+-----------------+
| 304538dd-d754-4661-9f17-5496dab9693d | FAILED_TEMP | 3aa5c054-c162-4d5e-9808-0bc30f92a4c7 | INSTANTIATE |
+--------------------------------------+-----------------+--------------------------------------+-----------------+
For this case, check notification API body:
In checking with Notification API, you should execute the following steps:
* Create a new subscription
* Execute LCM operations, such as 'Creates a new VNF instance resource'.
The procedure for executing the API using the curl command is shown below.
First, the method of generating Keystone-tokens will be described.
See `Keystone API reference`_. for details on Keystone APIs.
For **<username>** and **<password>**, **<project_name>**,
set values according to your environment.
Prepare get_token.json file to get token:
.. code-block:: json
{
"auth": {
"identity": {
"methods": [
"password"
],
"password": {
"user": {
"name": "<username>",
"password": "<password>",
"domain": {
"name": "Default"
}
}
}
},
"scope": {
"project": {
"name": "<project_name>",
"domain": {
"name": "Default"
}
}
}
}
}
Get token:
.. code-block:: console
$ curl -i -X POST -H "Content-Type: application/json" -d @./get_token.json "$OS_AUTH_URL/v3/auth/tokens"
Result:
.. code-block:: console
HTTP/1.1 201 CREATED
Date: Tue, 17 Nov 2020 08:01:44 GMT
Server: Apache/2.4.41 (Ubuntu)
Content-Type: application/json
Content-Length: 7187
X-Subject-Token: gAAAAABfs4No8WVYIPagnJvnnImNHq_918oLgOiJwSXqXGJKfv_FEcgfeZajIl0NCk7Pr6YMn1Sa96ZhOnWioKGrOxBSEGVxgYqBFx3bFfKAHVmzgoEaN6zfHZvbm1QJgoeg1QV5i-VjfeeQRWZptYqd3yWMLzrWSfVBER9pL-nRi0CvMXJM0yE
Vary: X-Auth-Token
x-openstack-request-id: req-6b19a1ee-0eb0-4aa8-97e7-c54d750c9b64
Connection: close
...snip response-body...
Set the value of **X-Subject-Token** included in the above result to
the environment variable **$OS_AUTH_TOKEN**.
.. code-block:: console
$ export OS_AUTH_TOKEN="gAAAAABfs4No8WVYIPagnJvnnImNHq_918oLgOiJwSXqXGJKfv_FEcgfeZajIl0NCk7Pr6YMn1Sa96ZhOnWioKGrOxBSEGVxgYqBFx3bFfKAHVmzgoEaN6zfHZvbm1QJgoeg1QV5i-VjfeeQRWZptYqd3yWMLzrWSfVBER9pL-nRi0CvMXJM0yE"
Create subscription:
.. code-block:: console
$ curl -g -i -X POST http://127.0.0.1:9890/vnflcm/v1/subscriptions \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Auth-Token: $OS_AUTH_TOKEN" \
-d '{"callbackUri": "http://127.0.0.1/"}'
Result:
.. code-block:: console
HTTP/1.1 201 Created
Content-Length: 199
Location: http://localhost:9890//vnflcm/v1/subscriptions/5bd3b81d-a6e9-45e7-922e-adc26328322d
Content-Type: application/json
X-Openstack-Request-Id: req-5f98782d-ca47-4144-a413-bd9641302f77
Date: Mon, 21 Dec 2020 08:21:47 GMT
{"id": "5bd3b81d-a6e9-45e7-922e-adc26328322d", "callbackUri": "http://127.0.0.1/", "_links": {"self": {"href": "http://localhost:9890//vnflcm/v1/subscriptions/5bd3b81d-a6e9-45e7-922e-adc26328322d"}}}
Show subscription:
.. code-block:: console
$ curl -g -i -X GET http://127.0.0.1:9890/vnflcm/v1/subscriptions/{subscriptionId} \
-H "Accept: application/json" \
-H "X-Auth-Token: $OS_AUTH_TOKEN"
Result:
.. code-block:: console
HTTP/1.1 200 OK
Content-Length: 213
Content-Type: application/json
X-Openstack-Request-Id: req-2d7503dc-1f75-40de-9d75-7c01180aee89
Date: Mon, 21 Dec 2020 08:22:59 GMT
{"id": "5bd3b81d-a6e9-45e7-922e-adc26328322d", "filter": {}, "callbackUri": "http://127.0.0.1/", "_links": {"self": {"href": "http://localhost:9890//vnflcm/v1/subscriptions/5bd3b81d-a6e9-45e7-922e-adc26328322d"}}}
Show VNF LCM operation occurrence:
.. code-block:: console
$ curl -g -i -X GET http://127.0.0.1:9890/vnflcm/v1/vnf_lcm_op_occs/{vnfLcmOpOccId} \
-H "Accept: application/json" \
-H "X-Auth-Token: $OS_AUTH_TOKEN"
Result:
.. code-block:: console
HTTP/1.1 200 OK
Content-Length: 3082
Content-Type: application/json
X-Openstack-Request-Id: req-d0720ffc-e7ee-4ee2-af61-a9a4a91c67cb
Date: Mon, 21 Dec 2020 08:30:25 GMT
{"id": "e3dc7530-e699-46ed-b65e-32911af1e414", "operationState": "FAILED_TEMP", "stateEnteredTime": "2020-12-21 06:52:06+00:00",
...snip response-body...
$ openstack vnflcm op list
+--------------------------------------+-----------------+--------------------------------------+-------------+
| ID | Operation State | VNF Instance ID | Operation |
+--------------------------------------+-----------------+--------------------------------------+-------------+
| c7afb90a-351b-4d33-a945-8f937deeadb4 | FAILED_TEMP | d45ae5cb-121b-4420-bc97-6a00f5fa63b6 | INSTANTIATE |
+--------------------------------------+-----------------+--------------------------------------+-------------+
Error-handling can be executed only when **operationState** is **FAILED_TMP**.
With the above LCM operation trigger, 'Notification' is sent to
the **callbackUri** set in 'Create a new subscription'.
If the Subscription is registered, the above operation trigger
that caused the FAILED_TEMP send a 'Notification' to the **callbackUri**
of the Subscription.
**vnfLcmOpOccId** included in this 'Notification' corresponds
to VNF_LCM_OP_OCC_ID.
See `VNF LCM v1 API`_ and `VNF LCM v2 API`_
for details on the APIs used here.
See `VNF LCM v1 API`_ for details on the APIs used here.
Rollback VNF LCM Operation
~~~~~~~~~~~~~~~~~~~~~~~~~~
.. note::
Rollback of Scale-Out has a difference in operation result between v1 and v2.
In v1, the oldest VNFc(VM) is deleted. In v2, the newest VNFc(VM) is deleted.
.. list-table::
:widths: 10 40 15 15 10 10
:widths: 10 40 15 15
:header-rows: 1
* - LCM Operation
- Description of Rollback
- Precondition
- Postcondition
- Support in v1
- Support in v2
* - Instantiate
- | VNFM removes all VMs and resources.
| e.g. Tacker executes Heat stack-delete for deletion of the target VM.
- FAILED_TEMP
- ROLLED_BACK or FAILED_TEMP
- X
- X
* - Scale-out
- | VNFM reverts changes of VMs and resources specified in the middle of scale-out operation.
| There are differences in the operation results of v1 and v2. See note.
| As a result, the oldest VNFc(VM) is deleted.
| e.g. Tacker reverts desired_capacity and executes Heat stack-update.
- FAILED_TEMP
- ROLLED_BACK or FAILED_TEMP
- X
- X
* - Modify
- VNFM reverts the update of the VNF instance information.
- FAILED_TEMP
- ROLLED_BACK or FAILED_TEMP
-
- X
* - Change external connectivity
- | VNFM reverts changes of the external connectivity for VNF instances.
| e.g. Tacker reverts stack parameters and executes Heat stack-update.
- FAILED_TEMP
- ROLLED_BACK or FAILED_TEMP
-
- X
* - Change Current VNF Package
- | VNFM reverts changes of current vnf package for VNF instances.
| e.g. Tacker reverts stack parameters and executes Heat stack-update.
- FAILED_TEMP
- ROLLED_BACK or FAILED_TEMP
-
- X
.. note::
| In some cases, Rollback of Change external connectivity cannot recover
the IP address and Port Id of virtual resources.
| If the operation fails before performing VIM processing: updating stack,
the IP address and Port Id will be recovered by its rollback operation.
| Otherwise, dynamic IP address and Port Id are not recovered
by rollback operation.
This manual describes the following operations as use cases for
rollback operations.
@ -315,7 +134,8 @@ Result:
.. code-block:: console
Failed to delete vnf instance with ID '3aa5c054-c162-4d5e-9808-0bc30f92a4c7': Vnf 3aa5c054-c162-4d5e-9808-0bc30f92a4c7 in status ERROR. Cannot delete while the vnf is in this state.
Failed to delete vnf instance with ID 'd45ae5cb-121b-4420-bc97-6a00f5fa63b6': Vnf d45ae5cb-121b-4420-bc97-6a00f5fa63b6 in status ERROR. Cannot delete while the vnf is in this state.
Failed to delete 1 of 1 vnf instances.
Therefore, "Rollback VNF lifecycle management operation" with
@ -330,7 +150,7 @@ Result:
.. code-block:: console
Rollback request for LCM operation 304538dd-d754-4661-9f17-5496dab9693d has been accepted
Rollback request for LCM operation c7afb90a-351b-4d33-a945-8f937deeadb4 has been accepted
If "Rollback VNF lifecycle management operation" is successful,
@ -345,64 +165,45 @@ Result:
.. code-block:: console
Vnf instance '3aa5c054-c162-4d5e-9808-0bc30f92a4c7' deleted successfully
Vnf instance 'd45ae5cb-121b-4420-bc97-6a00f5fa63b6' is deleted successfully
Fail VNF LCM Operation
~~~~~~~~~~~~~~~~~~~~~~
.. list-table::
:widths: 10 40 15 15 10 10
:widths: 10 40 15 15
:header-rows: 1
* - LCM Operation
- Description of Fail
- Precondition
- Postcondition
- Support in v1
- Support in v2
* - Instantiate
- Tacker simply changes LCM operation state to "FAILED" on Tacker-DB.
- FAILED_TEMP
- FAILED
- X
- X
* - Terminate
- Tacker simply changes LCM operation state to "FAILED" on Tacker-DB.
- FAILED_TEMP
- FAILED
- X
- X
* - Heal
- Tacker simply changes LCM operation state to "FAILED" on Tacker-DB.
- FAILED_TEMP
- FAILED
- X
- X
* - Scale
- Tacker simply changes LCM operation state to "FAILED" on Tacker-DB.
- FAILED_TEMP
- FAILED
- X
- X
* - Modify
- Tacker simply changes LCM operation state to "FAILED" on Tacker-DB.
- FAILED_TEMP
- FAILED
- X
- X
* - Change external connectivity
- Tacker simply changes LCM operation state to "FAILED" on Tacker-DB.
- FAILED_TEMP
- FAILED
- X
- X
* - Change Current VNF Package
- Tacker simply changes LCM operation state to "FAILED" on Tacker-DB.
- FAILED_TEMP
- FAILED
-
- X
This manual describes the following operations as use cases for
fail operations.
@ -423,7 +224,8 @@ Result:
.. code-block:: console
Failed to delete vnf instance with ID '3aa5c054-c162-4d5e-9808-0bc30f92a4c7': Vnf 3aa5c054-c162-4d5e-9808-0bc30f92a4c7 in status ERROR. Cannot delete while the vnf is in this state.
Failed to delete vnf instance with ID 'd45ae5cb-121b-4420-bc97-6a00f5fa63b6': Vnf d45ae5cb-121b-4420-bc97-6a00f5fa63b6 in status ERROR. Cannot delete while the vnf is in this state.
Failed to delete 1 of 1 vnf instances.
Therefore, "Fail VNF lifecycle management operation" with
@ -438,7 +240,59 @@ Result:
.. code-block:: console
Fail request for LCM operation 304538dd-d754-4661-9f17-5496dab9693d has been accepted
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Error | { |
| | "title": "", |
| | "status": 500, |
| | "detail": "ProblemDetails(created_at=<?>,deleted=0,deleted_at=<?>,detail='Vnf instantiation wait failed for vnf d45ae5cb-121b-4420-bc97-6a00f5fa63b6, error: VNF Create Resource CREATE failed: ResourceInError: |
| | resources.VDU1.resources.ril4bssciahp.resources.VDU1: Went to status ERROR due to \"Message: Build of instance 6dacc4a4-948f-4f40-97cf-2caeecbba013 aborted: privsep helper command exited non-zero (1), Code: |
| | 500\"',status=500,title='',updated_at=<?>)" |
| | } |
| ID | c7afb90a-351b-4d33-a945-8f937deeadb4 |
| Is Automatic Invocation | False |
| Is Cancel Pending | False |
| Links | { |
| | "self": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_lcm_op_occs/c7afb90a-351b-4d33-a945-8f937deeadb4" |
| | }, |
| | "vnfInstance": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/d45ae5cb-121b-4420-bc97-6a00f5fa63b6" |
| | }, |
| | "retry": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_lcm_op_occs/c7afb90a-351b-4d33-a945-8f937deeadb4/retry" |
| | }, |
| | "rollback": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_lcm_op_occs/c7afb90a-351b-4d33-a945-8f937deeadb4/rollback" |
| | }, |
| | "grant": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_lcm_op_occs/c7afb90a-351b-4d33-a945-8f937deeadb4/grant" |
| | }, |
| | "fail": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_lcm_op_occs/c7afb90a-351b-4d33-a945-8f937deeadb4/fail" |
| | } |
| | } |
| Operation | INSTANTIATE |
| Operation State | FAILED |
| Start Time | 2023-12-27 07:05:59+00:00 |
| State Entered Time | 2024-01-18 01:40:55.105358+00:00 |
| VNF Instance ID | d45ae5cb-121b-4420-bc97-6a00f5fa63b6 |
| grantId | None |
| operationParams | "{\"flavourId\": \"simple\", \"instantiationLevelId\": \"instantiation_level_1\", \"extVirtualLinks\": [{\"id\": \"91bcff6d-4703-4ba9-b1c2-009e6db92a9c\", \"resourceId\": \"3019b1e7-99d8-4748-97ac-104922bc78d9\", |
| | \"vimConnectionId\": \"79a97d01-e5f3-4eaa-b2bc-8f513ecb8a56\", \"extCps\": [{\"cpdId\": \"VDU1_CP1\", \"cpConfig\": [{\"linkPortId\": \"6b7c0b3a-cc2d-4b94-9f6f-81df69a7cc2f\"}]}, {\"cpdId\": \"VDU2_CP1\", \"cpConfig\": |
| | [{\"linkPortId\": \"02d867e7-b955-4b4a-b92f-c78c7ede63bf\"}]}], \"extLinkPorts\": [{\"id\": \"6b7c0b3a-cc2d-4b94-9f6f-81df69a7cc2f\", \"resourceHandle\": {\"vimConnectionId\": \"79a97d01-e5f3-4eaa-b2bc-8f513ecb8a56\", |
| | \"resourceId\": \"972a375d-921f-46f5-bfdb-19af95fc49e1\"}}, {\"id\": \"02d867e7-b955-4b4a-b92f-c78c7ede63bf\", \"resourceHandle\": {\"vimConnectionId\": \"79a97d01-e5f3-4eaa-b2bc-8f513ecb8a56\", \"resourceId\": |
| | \"b853b5c5-cd97-4dfb-8750-cac6e5c62477\"}}]}, {\"id\": \"a96d2f5b-c01a-48e1-813c-76132965042c\", \"resourceId\": \"589a045a-65d9-4f4d-a9b3-35aa655374d0\", \"vimConnectionId\": \"79a97d01-e5f3-4eaa-b2bc-8f513ecb8a56\", |
| | \"extCps\": [{\"cpdId\": \"VDU1_CP2\", \"cpConfig\": [{\"cpProtocolData\": [{\"layerProtocol\": \"IP_OVER_ETHERNET\", \"ipOverEthernet\": {\"ipAddresses\": [{\"type\": \"IPV4\", \"fixedAddresses\": [\"22.22.1.10\"], |
| | \"subnetId\": \"d290cae3-0dbc-44a3-a043-1a50ded04a64\"}]}}]}]}, {\"cpdId\": \"VDU2_CP2\", \"cpConfig\": [{\"cpProtocolData\": [{\"layerProtocol\": \"IP_OVER_ETHERNET\", \"ipOverEthernet\": {\"ipAddresses\": [{\"type\": |
| | \"IPV4\", \"fixedAddresses\": [\"22.22.1.20\"], \"subnetId\": \"d290cae3-0dbc-44a3-a043-1a50ded04a64\"}]}}]}]}]}], \"extManagedVirtualLinks\": [{\"id\": \"8f9d8da0-2386-4f00-bbb0-860f50d32a5a\", \"vnfVirtualLinkDescId\": |
| | \"internalVL1\", \"resourceId\": \"0e498d08-ed3a-4212-83e0-1b6808f6fcb6\"}, {\"id\": \"11d68761-aab7-419c-955c-0c6497f13692\", \"vnfVirtualLinkDescId\": \"internalVL2\", \"resourceId\": \"38a8d4ba- |
| | ac1b-41a2-a92b-ff2a3e5e9b12\"}], \"vimConnectionInfo\": [{\"id\": \"79a97d01-e5f3-4eaa-b2bc-8f513ecb8a56\", \"vimType\": \"ETSINFV.OPENSTACK_KEYSTONE.v_2\", \"vimConnectionId\": \"79a97d01-e5f3-4eaa-b2bc-8f513ecb8a56\", |
| | \"interfaceInfo\": {\"endpoint\": \"http://127.0.0.1/identity\"}, \"accessInfo\": {\"username\": \"nfv_user\", \"region\": \"RegionOne\", \"password\": \"devstack\", \"tenant\": \"1994d69783d64c00aadab564038c2fd7\"}}], |
| | \"additionalParams\": {\"lcm-operation-user-data\": \"./UserData/lcm_user_data.py\", \"lcm-operation-user-data-class\": \"SampleUserData\"}}" |
| resourceChanges | {} |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
If "Fail VNF lifecycle management operation" is successful,
@ -453,64 +307,45 @@ Result:
.. code-block:: console
Vnf instance '3aa5c054-c162-4d5e-9808-0bc30f92a4c7' deleted successfully
Vnf instance 'd45ae5cb-121b-4420-bc97-6a00f5fa63b6' is deleted successfully
Retry VNF LCM Operation
~~~~~~~~~~~~~~~~~~~~~~~
.. list-table::
:widths: 10 40 15 15 10 10
:widths: 10 40 15 15
:header-rows: 1
* - LCM Operation
- Description of Fail
- Precondition
- Postcondition
- Support in v1
- Support in v2
* - Instantiate
- VNFM retries a Instantiate operation.
- FAILED_TEMP
- COMPLETED or FAILED_TEMP
- X
- X
* - Terminate
- VNFM retries a Terminate operation.
- FAILED_TEMP
- COMPLETED or FAILED_TEMP
- X
- X
* - Heal
- VNFM retries a Heal operation.
- FAILED_TEMP
- COMPLETED or FAILED_TEMP
- X
- X
* - Scale
- VNFM retries a Scale operation.
- FAILED_TEMP
- COMPLETED or FAILED_TEMP
- X
- X
* - Modify
- VNFM retries a Modify operation.
- FAILED_TEMP
- COMPLETED or FAILED_TEMP
- X
- X
* - Change external connectivity
- VNFM retries a Change external connectivity operation.
- FAILED_TEMP
- COMPLETED or FAILED_TEMP
- X
- X
* - Change Current VNF Package
- VNFM retries a Change Current VNF Package operation.
- FAILED_TEMP
- COMPLETED or FAILED_TEMP
-
- X
This manual describes the following operations as use cases for
retry operations.
@ -533,193 +368,11 @@ Result:
.. code-block:: console
Retry request for LCM operation 304538dd-d754-4661-9f17-5496dab9693d has been accepted
Retry request for LCM operation c7afb90a-351b-4d33-a945-8f937deeadb4 has been accepted
If "Retry VNF lifecycle management operation" is successful,
then another LCM can be operational.
Error-handling of MgmtDriver
----------------------------
This section only applies to the `VNF LCM v2 API`_.
Error-handling includes Retry, Rollback and Fail operations.
* For the fail operation, it will not perform LCM when it is executed,
so there is no need to use MgmtDriver.
* For the retry operation, it will perform the LCM again when it is executed,
so as long as the LCM is configured with MgmtDriver, the MgmtDriver will
also be called during the retry operation, and no additional configuration
is required.
* For the rollback operation,
because there is no definition of ``rollback_start`` and ``rollback_end`` in
``6.7 Interface Types`` of `NFV-SOL001 v3.3.1`_, so when the rollback
operation is performed, MgmtDriver will not be called.
The VNFD in the VNF Package must be modified before calling MgmtDriver in the
rollback operation.
.. note::
In the MgmtDriver, the user saves the data that needs to be kept
when the LCM fails in the ``user_script_err_handling_data`` variable.
It is saved in the corresponding VNF_LCM_OP_OCC, and can be viewed through
`Show VNF LCM OP OCC`_.
During error-handling (retry or rollback), use the data in the
``user_script_err_handling_data`` variable to perform corresponding
processing.
Modifications of VNF Package
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Users need to make the following modifications when creating a `VNF Package`_.
The rollback operation currently supports multiple `LCM operations`_.
The following takes the rollback operations of instantiate and scale-out
as examples to demonstrate how to modify VNFD.
.. note::
The following provides the sample files ``v2_sample2_df_simple.yaml`` and
``v2_sample2_types.yaml`` that need to be modified, which are stored in
the Definitions directory of the VNF Package.
* ``v2_sample2_df_simple.yaml`` corresponds to
`Topology Template Files`_ in VNFD.
* ``v2_sample2_types.yaml`` corresponds to
`User defined types definition file`_ in VNFD.
* In ``v2_sample2_df_simple.yaml``, ``xxx_rollback_start`` and
``xxx_rollback_end`` need to be added under
``topology_template.node_templates.VNF.interfaces.Vnflcm``.
The following is the content of ``v2_sample2_df_simple.yaml``, the unmodified
part is replaced by "``...``" :
.. code-block:: yaml
topology_template:
...
node_templates:
VNF:
type: company.provider.VNF
properties:
flavour_description: A simple flavour
interfaces:
Vnflcm:
instantiate_start:
implementation: mgmt-driver-script
instantiate_end:
implementation: mgmt-driver-script
heal_start:
implementation: mgmt-driver-script
heal_end:
implementation: mgmt-driver-script
scale_start:
implementation: mgmt-driver-script
scale_end:
implementation: mgmt-driver-script
terminate_start:
implementation: mgmt-driver-script
terminate_end:
implementation: mgmt-driver-script
change_external_connectivity_start:
implementation: mgmt-driver-script
change_external_connectivity_end:
implementation: mgmt-driver-script
modify_information_start:
implementation: mgmt-driver-script
modify_information_end:
implementation: mgmt-driver-script
instantiate_rollback_start:
implementation: mgmt-driver-script
instantiate_rollback_end:
implementation: mgmt-driver-script
scale_rollback_start:
implementation: mgmt-driver-script
scale_rollback_end:
implementation: mgmt-driver-script
artifacts:
mgmt-driver-script:
description: Sample MgmtDriver Script
type: tosca.artifacts.Implementation.Python
file: ../Scripts/mgmt_driver_script.py
.. note::
If some definitions of ``xxx_start`` and ``xxx_end`` are added in VNFD,
corresponding ``xxx_start`` and ``xxx_end`` functions must also be
added in MgmtDriver.
* In ``v2_sample2_types.yaml``, the definition of ``interface_types`` needs to
be added, and the definition of ``type`` needs to be modified under
``node_types.company.provider.VNF.interfaces.Vnflcm``.
The following is the content of ``v2_sample2_types.yaml``, the unmodified
part is replaced by "``...``" :
.. code-block:: yaml
interface_types:
sample.test.Vnflcm:
derived_from: tosca.interfaces.nfv.Vnflcm
instantiate_start:
description: Invoked before instantiate
instantiate_end:
description: Invoked after instantiate
heal_start:
description: Invoked before heal
heal_end:
description: Invoked after heal
scale_start:
description: Invoked before scale
scale_end:
description: Invoked after scale
terminate_start:
description: Invoked before terminate
terminate_end:
description: Invoked after terminate
change_external_connectivity_start:
description: Invoked before change_external_connectivity
change_external_connectivity_end:
description: Invoked after change_external_connectivity
modify_information_start:
description: Invoked before modify_information
modify_information_end:
description: Invoked after modify_information
instantiate_rollback_start:
description: Invoked before instantiate_rollback
instantiate_rollback_end:
description: Invoked after instantiate_rollback
scale_rollback_start:
description: Invoked before scale_rollback
scale_rollback_end:
description: Invoked after scale_rollback
node_types:
company.provider.VNF:
...
interfaces:
Vnflcm:
type: sample.test.Vnflcm
After the above modification, MgmtDriver can also be called in error-handling.
.. note::
In the process of error-handling, the specific action of MgmtDriver
needs to be customized by the user or provider.
.. _VNF LCM v1 API : https://docs.openstack.org/api-ref/nfv-orchestration/v1/vnflcm.html
.. _VNF LCM v2 API : https://docs.openstack.org/api-ref/nfv-orchestration/v2/vnflcm.html
.. _Keystone API reference : https://docs.openstack.org/api-ref/identity/v3/#password-authentication-with-scoped-authorization
.. _NFV-SOL001 v3.3.1 : https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/001/03.03.01_60/gs_nfv-sol001v030301p.pdf
.. _Show VNF LCM OP OCC : https://docs.openstack.org/api-ref/nfv-orchestration/v2/vnflcm.html#show-vnf-lcm-operation-occurrence-v2
.. _VNF Package : https://docs.openstack.org/tacker/latest/user/vnf-package.html
.. _LCM operations : https://docs.openstack.org/tacker/latest/user/etsi_vnf_error_handling.html#rollback-vnf-lcm-operation
.. _User defined types definition file : https://docs.openstack.org/tacker/latest/user/vnfd-sol001.html#user-defined-types-definition-file
.. _Topology Template Files : https://docs.openstack.org/tacker/latest/user/vnfd-sol001.html#topology-template-file-with-deployment-flavour
.. _VNF LCM v1 API: https://docs.openstack.org/api-ref/nfv-orchestration/v1/vnflcm.html

View File

@ -2,7 +2,13 @@
ETSI NFV-SOL VNF Healing
========================
This document describes how to heal VNF in Tacker.
This document describes how to heal VNF in Tacker v1 API.
.. note::
This is a document for Tacker v1 API.
See :doc:`/user/v2/vnf/heal/index` for Tacker v2 API.
Overview
--------
@ -17,17 +23,16 @@ The diagram below shows an overview of the VNF healing.
2. Call OpenStack Heat API
Upon receiving a request from tacker-client, tacker-server redirects it to
tacker-conductor. In tacker-conductor, the request is redirected again to
tacker-conductor. In tacker-conductor, the request is redirected again to
an appropriate infra-driver (in this case OpenStack infra-driver) according
to the contents of the instantiate parameters. Then, OpenStack infra-driver
to the contents of the instantiate parameters. Then, OpenStack infra-driver
calls OpenStack Heat APIs.
3. Re-create VMs
OpenStack Heat re-creates VMs according to the API calls.
.. figure:: ../_images/etsi_vnf_healing.png
:align: left
.. figure:: /_images/etsi_vnf_healing.png
Prerequisites
@ -39,14 +44,17 @@ The following packages should be installed:
* python-tackerclient
A default VIM should be registered according to
:doc:`../cli/cli-legacy-vim`.
:doc:`/cli/cli-legacy-vim`.
The VNF Package(sample_vnf_pkg.zip) used below is prepared
by referring to :doc:`./vnf-package`.
The VNF Package(sample_vnf_package_csar.zip) used below is prepared
by referring to :doc:`/user/vnf-package`.
Execute up to "Instantiate VNF" in the procedure of
:doc:`./etsi_vnf_deployment_as_vm_with_tosca`.
In other words, the procedure after "Terminate VNF" is not executed.
The procedure of prepare for healing operation that from "register VIM" to
"Instantiate VNF", basically refer to
:doc:`/user/etsi_vnf_deployment_as_vm_with_tosca` or
:doc:`/user/etsi_vnf_deployment_as_vm_with_user_data`.
This procedure uses an example using the sample VNF package.
Healing Target VNF Instance
@ -64,193 +72,525 @@ Result:
.. code-block:: console
+--------------------------+-------------------------------------------------------------------------------------------------+
| Field | Value |
+--------------------------+-------------------------------------------------------------------------------------------------+
| ID | 9e086f34-b3c9-4986-b5e5-609a5ac4c1f9 |
| Instantiated Vnf Info | { |
| | "flavourId": "simple", |
| | "vnfState": "STARTED", |
| | "extCpInfo": [ |
| | { |
| | "id": "241e6022-c9be-4ad6-b7a7-ecb32de20475", |
| | "cpdId": "CP1", |
| | "extLinkPortId": null, |
| | "associatedVnfcCpId": "b07ba349-1366-4d14-91e9-07842cdfa7ab", |
| | "cpProtocolInfo": [ |
| | { |
| | "layerProtocol": "IP_OVER_ETHERNET" |
| | } |
| | ] |
| | } |
| | ], |
| | "extVirtualLinkInfo": [ |
| | { |
| | "id": "net0", |
| | "resourceHandle": { |
| | "vimConnectionId": null, |
| | "resourceId": "1948231e-bbf0-4ff9-a692-40f8d6d5c90d", |
| | "vimLevelResourceType": null |
| | } |
| | } |
| | ], |
| | "vnfcResourceInfo": [ |
| | { |
| | "id": "b07ba349-1366-4d14-91e9-07842cdfa7ab", |
| | "vduId": "VDU1", |
| | "computeResource": { |
| | "vimConnectionId": "13bef9df-7c54-4b37-9da0-1256953e7f60", |
| | "resourceId": "794b9460-d799-4398-98a4-413fb04d2051", |
| | "vimLevelResourceType": "OS::Nova::Server" |
| | }, |
| | "storageResourceIds": [], |
| | "vnfcCpInfo": [ |
| | { |
| | "id": "f7297196-a024-4a90-9393-aadeb7de1fb3", |
| | "cpdId": "CP1", |
| | "vnfExtCpId": null, |
| | "vnfLinkPortId": "cf733c70-8dc2-46b8-8d76-2ebd0bb5bd07", |
| | "cpProtocolInfo": [ |
| | { |
| | "layerProtocol": "IP_OVER_ETHERNET" |
| | } |
| | ] |
| | }, |
| | { |
| | "id": "f3851831-ed25-4e73-b913-6725085c7484", |
| | "cpdId": "CP2", |
| | "vnfExtCpId": null, |
| | "vnfLinkPortId": "8cc28f47-ee72-420e-b4e8-26913d60bf55" |
| | } |
| | ] |
| | }, |
| | { |
| | "id": "aae43bc1-a54e-46e8-9371-59c1ef5fc84d", |
| | "vduId": "VDU2", |
| | "computeResource": { |
| | "vimConnectionId": "13bef9df-7c54-4b37-9da0-1256953e7f60", |
| | "resourceId": "20e10aed-16e9-4f7c-ad0c-1e885cc1200e", |
| | "vimLevelResourceType": "OS::Nova::Server" |
| | }, |
| | "storageResourceIds": [ |
| | "21703823-33b3-4f06-a52c-28b455146a4a" |
| | ], |
| | "vnfcCpInfo": [ |
| | { |
| | "id": "d0088ed3-1639-4f3b-a369-3baae7e86540", |
| | "cpdId": "CP3", |
| | "vnfExtCpId": null, |
| | "vnfLinkPortId": "d5fe9f7b-f50d-49dc-a3c8-ded2843005e4" |
| | } |
| | ] |
| | } |
| | ], |
| | "vnfVirtualLinkResourceInfo": [ |
| | { |
| | "id": "45588051-a413-41a0-a55c-b31fb50fb351", |
| | "vnfVirtualLinkDescId": "internalVL2", |
| | "networkResource": { |
| | "vimConnectionId": "13bef9df-7c54-4b37-9da0-1256953e7f60", |
| | "resourceId": "f45802ae-7fff-4c6e-b62f-3d55baec4c6b", |
| | "vimLevelResourceType": "OS::Neutron::Net" |
| | }, |
| | "vnfLinkPorts": [ |
| | { |
| | "id": "8cc28f47-ee72-420e-b4e8-26913d60bf55", |
| | "resourceHandle": { |
| | "vimConnectionId": "13bef9df-7c54-4b37-9da0-1256953e7f60", |
| | "resourceId": "e020ad8f-3f85-4d13-98c1-3ea476bf2d1a", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "f3851831-ed25-4e73-b913-6725085c7484" |
| | }, |
| | { |
| | "id": "d5fe9f7b-f50d-49dc-a3c8-ded2843005e4", |
| | "resourceHandle": { |
| | "vimConnectionId": "13bef9df-7c54-4b37-9da0-1256953e7f60", |
| | "resourceId": "8f1588e5-4410-40eb-84ee-28336a6a0212", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "d0088ed3-1639-4f3b-a369-3baae7e86540" |
| | } |
| | ] |
| | }, |
| | { |
| | "id": "66f3fa97-4046-4fa4-b1ff-19295501021f", |
| | "vnfVirtualLinkDescId": "net0", |
| | "networkResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "1948231e-bbf0-4ff9-a692-40f8d6d5c90d", |
| | "vimLevelResourceType": "OS::Neutron::Net" |
| | }, |
| | "vnfLinkPorts": [ |
| | { |
| | "id": "cf733c70-8dc2-46b8-8d76-2ebd0bb5bd07", |
| | "resourceHandle": { |
| | "vimConnectionId": "13bef9df-7c54-4b37-9da0-1256953e7f60", |
| | "resourceId": "1db39a17-bbae-4074-8623-8a8026b51647", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "f7297196-a024-4a90-9393-aadeb7de1fb3" |
| | } |
| | ] |
| | } |
| | ], |
| | "virtualStorageResourceInfo": [ |
| | { |
| | "id": "21703823-33b3-4f06-a52c-28b455146a4a", |
| | "virtualStorageDescId": "VirtualStorage", |
| | "storageResource": { |
| | "vimConnectionId": "13bef9df-7c54-4b37-9da0-1256953e7f60", |
| | "resourceId": "c6231ea2-6a90-4ba4-b38b-778a5d7110ee", |
| | "vimLevelResourceType": "OS::Cinder::Volume" |
| | } |
| | } |
| | ], |
| | "vnfcInfo": [ |
| | { |
| | "id": "4c999b33-3004-4b44-a826-49d07f5becb9", |
| | "vduId": "VDU1", |
| | "vnfcState": "STARTED" |
| | }, |
| | { |
| | "id": "d8f83af0-1b4d-4f57-b53c-fd028849be8f", |
| | "vduId": "VDU2", |
| | "vnfcState": "STARTED" |
| | } |
| | ], |
| | "additionalParams": {} |
| | } |
| Instantiation State | INSTANTIATED |
| Links | { |
| | "self": { |
| | "href": "/vnflcm/v1/vnf_instances/9e086f34-b3c9-4986-b5e5-609a5ac4c1f9" |
| | }, |
| | "terminate": { |
| | "href": "/vnflcm/v1/vnf_instances/9e086f34-b3c9-4986-b5e5-609a5ac4c1f9/terminate" |
| | }, |
| | "heal": { |
| | "href": "/vnflcm/v1/vnf_instances/9e086f34-b3c9-4986-b5e5-609a5ac4c1f9/heal" |
| | }, |
| | "changeExtConn": { |
| | "href": "/vnflcm/v1/vnf_instances/9e086f34-b3c9-4986-b5e5-609a5ac4c1f9/change_ext_conn" |
| | } |
| | } |
| VIM Connection Info | [] |
| VNF Instance Description | None |
| VNF Instance Name | vnf-9e086f34-b3c9-4986-b5e5-609a5ac4c1f9 |
| 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 | |
+--------------------------+-------------------------------------------------------------------------------------------------+
+-----------------------------+----------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------+
| ID | c3f9c200-7f52-42c5-9c64-6032faa3faf8 |
| Instantiated Vnf Info | { |
| | "flavourId": "simple", |
| | "vnfState": "STARTED", |
| | "scaleStatus": [ |
| | { |
| | "aspectId": "worker_instance", |
| | "scaleLevel": 0 |
| | } |
| | ], |
| | "extCpInfo": [ |
| | { |
| | "id": "d7c14d6f-3bac-4e11-a512-5101b4933545", |
| | "cpdId": "VDU1_CP1", |
| | "extLinkPortId": null, |
| | "associatedVnfcCpId": "b0f677ce-93db-416a-839b-998707338d14", |
| | "cpProtocolInfo": [] |
| | }, |
| | { |
| | "id": "e3513495-c555-4a1f-a9cc-07a0feae2720", |
| | "cpdId": "VDU2_CP1", |
| | "extLinkPortId": null, |
| | "associatedVnfcCpId": "9da6945b-d9a3-4001-a03a-7b239b7e7084", |
| | "cpProtocolInfo": [] |
| | }, |
| | { |
| | "id": "53c187aa-d05c-4995-9518-3119ac02ee66", |
| | "cpdId": "VDU1_CP2", |
| | "extLinkPortId": null, |
| | "associatedVnfcCpId": "b0f677ce-93db-416a-839b-998707338d14", |
| | "cpProtocolInfo": [ |
| | { |
| | "layerProtocol": "IP_OVER_ETHERNET", |
| | "ipOverEthernet": { |
| | "macAddress": null, |
| | "ipAddresses": [ |
| | { |
| | "type": "IPV4", |
| | "subnetId": "d290cae3-0dbc-44a3-a043-1a50ded04a64", |
| | "isDynamic": false, |
| | "addresses": [ |
| | "22.22.1.10" |
| | ] |
| | } |
| | ] |
| | } |
| | } |
| | ] |
| | }, |
| | { |
| | "id": "9fcec4e1-e808-4dc6-b048-79ec88d0aa40", |
| | "cpdId": "VDU2_CP2", |
| | "extLinkPortId": null, |
| | "associatedVnfcCpId": "9da6945b-d9a3-4001-a03a-7b239b7e7084", |
| | "cpProtocolInfo": [ |
| | { |
| | "layerProtocol": "IP_OVER_ETHERNET", |
| | "ipOverEthernet": { |
| | "macAddress": null, |
| | "ipAddresses": [ |
| | { |
| | "type": "IPV4", |
| | "subnetId": "d290cae3-0dbc-44a3-a043-1a50ded04a64", |
| | "isDynamic": false, |
| | "addresses": [ |
| | "22.22.1.20" |
| | ] |
| | } |
| | ] |
| | } |
| | } |
| | ] |
| | } |
| | ], |
| | "extVirtualLinkInfo": [ |
| | { |
| | "id": "91bcff6d-4703-4ba9-b1c2-009e6db92a9c", |
| | "resourceHandle": { |
| | "vimConnectionId": "79a97d01-e5f3-4eaa-b2bc-8f513ecb8a56", |
| | "resourceId": "3019b1e7-99d8-4748-97ac-104922bc78d9", |
| | "vimLevelResourceType": null |
| | }, |
| | "extLinkPorts": [ |
| | { |
| | "id": "6b7c0b3a-cc2d-4b94-9f6f-81df69a7cc2f", |
| | "resourceHandle": { |
| | "vimConnectionId": "79a97d01-e5f3-4eaa-b2bc-8f513ecb8a56", |
| | "resourceId": "972a375d-921f-46f5-bfdb-19af95fc49e1", |
| | "vimLevelResourceType": null |
| | }, |
| | "cpInstanceId": "9fcec4e1-e808-4dc6-b048-79ec88d0aa40" |
| | }, |
| | { |
| | "id": "02d867e7-b955-4b4a-b92f-c78c7ede63bf", |
| | "resourceHandle": { |
| | "vimConnectionId": "79a97d01-e5f3-4eaa-b2bc-8f513ecb8a56", |
| | "resourceId": "b853b5c5-cd97-4dfb-8750-cac6e5c62477", |
| | "vimLevelResourceType": null |
| | }, |
| | "cpInstanceId": "9fcec4e1-e808-4dc6-b048-79ec88d0aa40" |
| | } |
| | ] |
| | }, |
| | { |
| | "id": "a96d2f5b-c01a-48e1-813c-76132965042c", |
| | "resourceHandle": { |
| | "vimConnectionId": "79a97d01-e5f3-4eaa-b2bc-8f513ecb8a56", |
| | "resourceId": "589a045a-65d9-4f4d-a9b3-35aa655374d0", |
| | "vimLevelResourceType": null |
| | } |
| | } |
| | ], |
| | "extManagedVirtualLinkInfo": [ |
| | { |
| | "id": "8f9d8da0-2386-4f00-bbb0-860f50d32a5a", |
| | "vnfVirtualLinkDescId": "internalVL1", |
| | "networkResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "0e498d08-ed3a-4212-83e0-1b6808f6fcb6", |
| | "vimLevelResourceType": "OS::Neutron::Net" |
| | }, |
| | "vnfLinkPorts": [ |
| | { |
| | "id": "f5de777b-22e9-480a-a044-5359cc8b6263", |
| | "resourceHandle": { |
| | "vimConnectionId": "c637c425-62e8-432f-94f4-bff8d3323e29", |
| | "resourceId": "ddb45b78-385d-4c18-aec3-10bf6bafb840", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "a98f1c4b-f4c9-4603-8813-4a9dbb003950" |
| | }, |
| | { |
| | "id": "d754bcb0-5ab4-4715-9469-e946ec69733e", |
| | "resourceHandle": { |
| | "vimConnectionId": "c637c425-62e8-432f-94f4-bff8d3323e29", |
| | "resourceId": "29de4ae6-1004-4607-9023-818efacba3ce", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "c408c3a8-924b-4570-a896-ddb5bd56d14a" |
| | } |
| | ] |
| | }, |
| | { |
| | "id": "11d68761-aab7-419c-955c-0c6497f13692", |
| | "vnfVirtualLinkDescId": "internalVL2", |
| | "networkResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "38a8d4ba-ac1b-41a2-a92b-ff2a3e5e9b12", |
| | "vimLevelResourceType": "OS::Neutron::Net" |
| | }, |
| | "vnfLinkPorts": [ |
| | { |
| | "id": "1b664cfb-6c8b-4f02-a535-f683fe414e31", |
| | "resourceHandle": { |
| | "vimConnectionId": "c637c425-62e8-432f-94f4-bff8d3323e29", |
| | "resourceId": "2215cb28-9876-4c43-a71d-c63ae42a7ab4", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "f16e20d7-cb86-4b4d-a4fa-f27802eaf628" |
| | }, |
| | { |
| | "id": "65c35b4c-1a8b-4495-a396-73d09f4cebea", |
| | "resourceHandle": { |
| | "vimConnectionId": "c637c425-62e8-432f-94f4-bff8d3323e29", |
| | "resourceId": "0019f288-38b3-4247-89fc-51ecf7663401", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "269b2b44-7577-45b5-8038-1e67d34dea41" |
| | } |
| | ] |
| | } |
| | ], |
| | "vnfcResourceInfo": [ |
| | { |
| | "id": "b0f677ce-93db-416a-839b-998707338d14", |
| | "vduId": "VDU1", |
| | "computeResource": { |
| | "vimConnectionId": "c637c425-62e8-432f-94f4-bff8d3323e29", |
| | "resourceId": "2bd41386-1971-425c-9f27-310c7a4d6181", |
| | "vimLevelResourceType": "OS::Nova::Server" |
| | }, |
| | "storageResourceIds": [], |
| | "vnfcCpInfo": [ |
| | { |
| | "id": "c86cef0a-150d-4eff-a21f-a48c6fcfa258", |
| | "cpdId": "VDU1_CP1", |
| | "vnfExtCpId": "6b7c0b3a-cc2d-4b94-9f6f-81df69a7cc2f", |
| | "vnfLinkPortId": "f2105dd9-fed4-43dd-8d74-fcf0199cb716" |
| | }, |
| | { |
| | "id": "426c0473-2de1-42dc-ae1f-ff4cf4d8b29b", |
| | "cpdId": "VDU1_CP2", |
| | "vnfExtCpId": null, |
| | "vnfLinkPortId": "9925668e-ceea-45ef-817a-25d19572a494", |
| | "cpProtocolInfo": [ |
| | { |
| | "layerProtocol": "IP_OVER_ETHERNET", |
| | "ipOverEthernet": { |
| | "macAddress": null, |
| | "ipAddresses": [ |
| | { |
| | "type": "IPV4", |
| | "subnetId": "d290cae3-0dbc-44a3-a043-1a50ded04a64", |
| | "isDynamic": false, |
| | "addresses": [ |
| | "22.22.1.10" |
| | ] |
| | } |
| | ] |
| | } |
| | } |
| | ] |
| | }, |
| | { |
| | "id": "a98f1c4b-f4c9-4603-8813-4a9dbb003950", |
| | "cpdId": "VDU1_CP3", |
| | "vnfExtCpId": null, |
| | "vnfLinkPortId": "f5de777b-22e9-480a-a044-5359cc8b6263" |
| | }, |
| | { |
| | "id": "f16e20d7-cb86-4b4d-a4fa-f27802eaf628", |
| | "cpdId": "VDU1_CP4", |
| | "vnfExtCpId": null, |
| | "vnfLinkPortId": "1b664cfb-6c8b-4f02-a535-f683fe414e31" |
| | }, |
| | { |
| | "id": "89dd97c3-ef2d-4df5-a18a-f542e573a5bd", |
| | "cpdId": "VDU1_CP5", |
| | "vnfExtCpId": null, |
| | "vnfLinkPortId": "1a8d6c49-40bb-4f24-96e7-6efba6001671" |
| | } |
| | ] |
| | }, |
| | { |
| | "id": "9da6945b-d9a3-4001-a03a-7b239b7e7084", |
| | "vduId": "VDU2", |
| | "computeResource": { |
| | "vimConnectionId": "c637c425-62e8-432f-94f4-bff8d3323e29", |
| | "resourceId": "777515dd-35c9-4f06-ad6b-f79323097e0f", |
| | "vimLevelResourceType": "OS::Nova::Server" |
| | }, |
| | "storageResourceIds": [], |
| | "vnfcCpInfo": [ |
| | { |
| | "id": "12ea4352-66a5-47a4-989f-d4d06d5bab1a", |
| | "cpdId": "VDU2_CP1", |
| | "vnfExtCpId": "02d867e7-b955-4b4a-b92f-c78c7ede63bf", |
| | "vnfLinkPortId": "6043706d-6173-40ef-8bc5-519868ce9fe4" |
| | }, |
| | { |
| | "id": "b6a56d88-da99-4036-872f-f10759b00ed8", |
| | "cpdId": "VDU2_CP2", |
| | "vnfExtCpId": null, |
| | "vnfLinkPortId": "bfd0d3ad-1f9c-4102-b446-c7f33881b136", |
| | "cpProtocolInfo": [ |
| | { |
| | "layerProtocol": "IP_OVER_ETHERNET", |
| | "ipOverEthernet": { |
| | "macAddress": null, |
| | "ipAddresses": [ |
| | { |
| | "type": "IPV4", |
| | "subnetId": "d290cae3-0dbc-44a3-a043-1a50ded04a64", |
| | "isDynamic": false, |
| | "addresses": [ |
| | "22.22.1.20" |
| | ] |
| | } |
| | ] |
| | } |
| | } |
| | ] |
| | }, |
| | { |
| | "id": "c408c3a8-924b-4570-a896-ddb5bd56d14a", |
| | "cpdId": "VDU2_CP3", |
| | "vnfExtCpId": null, |
| | "vnfLinkPortId": "d754bcb0-5ab4-4715-9469-e946ec69733e" |
| | }, |
| | { |
| | "id": "269b2b44-7577-45b5-8038-1e67d34dea41", |
| | "cpdId": "VDU2_CP4", |
| | "vnfExtCpId": null, |
| | "vnfLinkPortId": "65c35b4c-1a8b-4495-a396-73d09f4cebea" |
| | }, |
| | { |
| | "id": "bb1ed2d3-da19-4b45-b326-cf9e76fd788a", |
| | "cpdId": "VDU2_CP5", |
| | "vnfExtCpId": null, |
| | "vnfLinkPortId": "46cd8f09-d877-491b-8928-345ec6461637" |
| | } |
| | ] |
| | } |
| | ], |
| | "vnfVirtualLinkResourceInfo": [ |
| | { |
| | "id": "b3244c22-2365-476e-bc7b-40cbaee45ce1", |
| | "vnfVirtualLinkDescId": "internalVL1", |
| | "networkResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "0e498d08-ed3a-4212-83e0-1b6808f6fcb6", |
| | "vimLevelResourceType": "OS::Neutron::Net" |
| | }, |
| | "vnfLinkPorts": [ |
| | { |
| | "id": "f5de777b-22e9-480a-a044-5359cc8b6263", |
| | "resourceHandle": { |
| | "vimConnectionId": "c637c425-62e8-432f-94f4-bff8d3323e29", |
| | "resourceId": "ddb45b78-385d-4c18-aec3-10bf6bafb840", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "a98f1c4b-f4c9-4603-8813-4a9dbb003950" |
| | }, |
| | { |
| | "id": "d754bcb0-5ab4-4715-9469-e946ec69733e", |
| | "resourceHandle": { |
| | "vimConnectionId": "c637c425-62e8-432f-94f4-bff8d3323e29", |
| | "resourceId": "29de4ae6-1004-4607-9023-818efacba3ce", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "c408c3a8-924b-4570-a896-ddb5bd56d14a" |
| | } |
| | ] |
| | }, |
| | { |
| | "id": "c9182342-bfc4-4ba8-9e26-02fd0565db4d", |
| | "vnfVirtualLinkDescId": "internalVL2", |
| | "networkResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "38a8d4ba-ac1b-41a2-a92b-ff2a3e5e9b12", |
| | "vimLevelResourceType": "OS::Neutron::Net" |
| | }, |
| | "vnfLinkPorts": [ |
| | { |
| | "id": "1b664cfb-6c8b-4f02-a535-f683fe414e31", |
| | "resourceHandle": { |
| | "vimConnectionId": "c637c425-62e8-432f-94f4-bff8d3323e29", |
| | "resourceId": "2215cb28-9876-4c43-a71d-c63ae42a7ab4", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "f16e20d7-cb86-4b4d-a4fa-f27802eaf628" |
| | }, |
| | { |
| | "id": "65c35b4c-1a8b-4495-a396-73d09f4cebea", |
| | "resourceHandle": { |
| | "vimConnectionId": "c637c425-62e8-432f-94f4-bff8d3323e29", |
| | "resourceId": "0019f288-38b3-4247-89fc-51ecf7663401", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "269b2b44-7577-45b5-8038-1e67d34dea41" |
| | } |
| | ] |
| | }, |
| | { |
| | "id": "81ed1791-a1c2-46fb-a999-dd9d601b06ec", |
| | "vnfVirtualLinkDescId": "internalVL3", |
| | "networkResource": { |
| | "vimConnectionId": null, |
| | "resourceId": "", |
| | "vimLevelResourceType": null |
| | }, |
| | "vnfLinkPorts": [ |
| | { |
| | "id": "1a8d6c49-40bb-4f24-96e7-6efba6001671", |
| | "resourceHandle": { |
| | "vimConnectionId": "c637c425-62e8-432f-94f4-bff8d3323e29", |
| | "resourceId": "84d7fc8c-fb52-4593-875b-bf303ec5fc8c", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "89dd97c3-ef2d-4df5-a18a-f542e573a5bd" |
| | }, |
| | { |
| | "id": "46cd8f09-d877-491b-8928-345ec6461637", |
| | "resourceHandle": { |
| | "vimConnectionId": "c637c425-62e8-432f-94f4-bff8d3323e29", |
| | "resourceId": "65650d05-a562-4c5f-84d2-e9304ef68377", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "bb1ed2d3-da19-4b45-b326-cf9e76fd788a" |
| | } |
| | ] |
| | }, |
| | { |
| | "id": "1d1a0824-5c4d-461e-9a29-5e72db1e5855", |
| | "vnfVirtualLinkDescId": "91bcff6d-4703-4ba9-b1c2-009e6db92a9c", |
| | "networkResource": { |
| | "vimConnectionId": "79a97d01-e5f3-4eaa-b2bc-8f513ecb8a56", |
| | "resourceId": "3019b1e7-99d8-4748-97ac-104922bc78d9", |
| | "vimLevelResourceType": "OS::Neutron::Net" |
| | }, |
| | "vnfLinkPorts": [ |
| | { |
| | "id": "f2105dd9-fed4-43dd-8d74-fcf0199cb716", |
| | "resourceHandle": { |
| | "vimConnectionId": "c637c425-62e8-432f-94f4-bff8d3323e29", |
| | "resourceId": "f0cf8bfd-261a-4c54-b783-42cce6d90859", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "c86cef0a-150d-4eff-a21f-a48c6fcfa258" |
| | }, |
| | { |
| | "id": "6043706d-6173-40ef-8bc5-519868ce9fe4", |
| | "resourceHandle": { |
| | "vimConnectionId": "c637c425-62e8-432f-94f4-bff8d3323e29", |
| | "resourceId": "6a349003-66a1-4bfa-bd4b-83705957482a", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "12ea4352-66a5-47a4-989f-d4d06d5bab1a" |
| | } |
| | ] |
| | }, |
| | { |
| | "id": "d8fc6199-c9d6-4e74-b896-c44018fa4382", |
| | "vnfVirtualLinkDescId": "a96d2f5b-c01a-48e1-813c-76132965042c", |
| | "networkResource": { |
| | "vimConnectionId": "79a97d01-e5f3-4eaa-b2bc-8f513ecb8a56", |
| | "resourceId": "589a045a-65d9-4f4d-a9b3-35aa655374d0", |
| | "vimLevelResourceType": "OS::Neutron::Net" |
| | }, |
| | "vnfLinkPorts": [ |
| | { |
| | "id": "9925668e-ceea-45ef-817a-25d19572a494", |
| | "resourceHandle": { |
| | "vimConnectionId": "c637c425-62e8-432f-94f4-bff8d3323e29", |
| | "resourceId": "53700068-3c4b-444b-b4eb-bbaa887a0e28", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "426c0473-2de1-42dc-ae1f-ff4cf4d8b29b" |
| | }, |
| | { |
| | "id": "bfd0d3ad-1f9c-4102-b446-c7f33881b136", |
| | "resourceHandle": { |
| | "vimConnectionId": "c637c425-62e8-432f-94f4-bff8d3323e29", |
| | "resourceId": "136f1448-feb7-480d-8d92-15d7e4d02f37", |
| | "vimLevelResourceType": "OS::Neutron::Port" |
| | }, |
| | "cpInstanceId": "b6a56d88-da99-4036-872f-f10759b00ed8" |
| | } |
| | ] |
| | } |
| | ], |
| | "vnfcInfo": [ |
| | { |
| | "id": "b9b73267-40ce-468f-87ab-a6653cee664f", |
| | "vduId": "VDU1", |
| | "vnfcState": "STARTED" |
| | }, |
| | { |
| | "id": "1842c052-b6af-45bb-b976-f99cd1212182", |
| | "vduId": "VDU2", |
| | "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/c3f9c200-7f52-42c5-9c64-6032faa3faf8" |
| | }, |
| | "terminate": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/c3f9c200-7f52-42c5-9c64-6032faa3faf8/terminate" |
| | }, |
| | "heal": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/c3f9c200-7f52-42c5-9c64-6032faa3faf8/heal" |
| | }, |
| | "changeExtConn": { |
| | "href": "http://localhost:9890/vnflcm/v1/vnf_instances/c3f9c200-7f52-42c5-9c64-6032faa3faf8/change_ext_conn" |
| | } |
| | } |
| VIM Connection Info | [ |
| | { |
| | "id": "79a97d01-e5f3-4eaa-b2bc-8f513ecb8a56", |
| | "vimId": null, |
| | "vimType": "ETSINFV.OPENSTACK_KEYSTONE.v_2", |
| | "interfaceInfo": { |
| | "endpoint": "http://127.0.0.1/identity" |
| | }, |
| | "accessInfo": { |
| | "region": "RegionOne", |
| | "tenant": "1994d69783d64c00aadab564038c2fd7", |
| | "password": "devstack", |
| | "username": "nfv_user" |
| | }, |
| | "extra": {} |
| | }, |
| | { |
| | "id": "700a68db-0789-49e0-97d5-9824d5eeb272", |
| | "vimId": "c637c425-62e8-432f-94f4-bff8d3323e29", |
| | "vimType": "openstack", |
| | "interfaceInfo": {}, |
| | "accessInfo": {}, |
| | "extra": {} |
| | } |
| | ] |
| VNF Configurable Properties | |
| VNF Instance Description | |
| VNF Instance Name | vnf-c3f9c200-7f52-42c5-9c64-6032faa3faf8 |
| VNF Product Name | Sample VNF |
| VNF Provider | Company |
| VNF Software Version | 1.0 |
| VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d7000321 |
| VNFD Version | 1.0 |
| metadata | tenant=nfv |
| vnfPkgId | |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------+
.. note::
The value set for 'VNF Instance Name' corresponds to 'Stack Name'
managed by Heat.
In this manual, it corresponds to **vnf-9e086f34-b3c9-4986-b5e5-609a5ac4c1f9**.
The value set for 'VNF Instance Name' corresponds to 'Stack Name'
managed by Heat.
In this manual, it corresponds to **vnf-c3f9c200-7f52-42c5-9c64-6032faa3faf8**.
VNF Healing Procedure
@ -260,7 +600,7 @@ As mentioned in **Prerequisites** and **Healing target VNF instance**,
the VNF must be instantiated before healing.
Details of CLI commands are described in
:doc:`../cli/cli-etsi-vnflcm`.
:doc:`/cli/cli-etsi-vnflcm`.
There are two main methods for VNF healing.
@ -268,47 +608,11 @@ There are two main methods for VNF healing.
* Healing specified with VNFC instances
.. note::
A VNFC is a 'VNF Component', and one VNFC basically
corresponds to one VDU in the VNF.
For more information on VNFC, see `NFV-SOL002 v2.6.1`_.
A VNFC is a 'VNF Component', and one VNFC basically
corresponds to one VDU in the VNF.
For more information on VNFC, see `NFV-SOL002 v2.6.1`_.
The client can specify the target resources for healing
with two parameters in the API request.
- *vnfcInstanceId* is a list which indicates VNFC instances
for which a healing action is requested.
- *all* indicates whether network resources and storage resources
are included in the heal target. This is set in the attribute
of *additionalParams*.
With the combination of these parameters,
Tacker supports the following patterns of healing.
- Pattern A. *vnfcInstanceId* is included in the request.
- Pattern A-1. *all = False* is included in the request or *all* is not
included in the request.
- Only specified VNFC instances are healed.
- Pattern A-2. *all = True* are included in the request.
- Specified VNFC instances and storage resources are healed.
- Pattern B. *vnfcInstanceId* is not included in the request.
- Pattern B-1. *all = False* is included in the request or *all* is not
included in the request.
- All VNFC instances included in the VNF instance are healed.
- Pattern B-2. *all = True* are included in the request.
- All resources included in the VNF instance are healed.
It includes VNFC instances, network resources, and storage resources
but not external virtual networks.
.. note::
*all* option is not supported by the version 1 API.
How to Heal of the Entire VNF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -339,11 +643,11 @@ Result:
.. code-block:: console
+--------------------------------------+------------------------------------------+-----------------+
| ID | Stack Name | Stack Status |
+--------------------------------------+------------------------------------------+-----------------+
| 5322e9c4-b5ac-439e-8ed4-d0710816f318 | vnf-9e086f34-b3c9-4986-b5e5-609a5ac4c1f9 | CREATE_COMPLETE |
+--------------------------------------+------------------------------------------+-----------------+
+--------------------------------------+---------------------------------------------+-----------------+
| ID | Stack Name | Stack Status |
+--------------------------------------+---------------------------------------------+-----------------+
| 00d1871d-4acc-4d6b-99bc-cc68ad0b8a6a | vnflcm_c3f9c200-7f52-42c5-9c64-6032faa3faf8 | CREATE_COMPLETE |
+--------------------------------------+---------------------------------------------+-----------------+
Healing execution of the entire VNF:
@ -357,7 +661,7 @@ Result:
.. code-block:: console
Heal request for VNF Instance 9e086f34-b3c9-4986-b5e5-609a5ac4c1f9 has been accepted.
Heal request for VNF Instance 0c3644ff-b207-4a6a-9d3a-d1295cda153a has been accepted.
Stack information after healing:
@ -371,15 +675,16 @@ Result:
.. code-block:: console
+--------------------------------------+------------------------------------------+-----------------+
| ID | Stack Name | Stack Status |
+--------------------------------------+------------------------------------------+-----------------+
| ad077101-b093-4785-9ca5-cc7c1379bb10 | vnf-9e086f34-b3c9-4986-b5e5-609a5ac4c1f9 | CREATE_COMPLETE |
+--------------------------------------+------------------------------------------+-----------------+
+--------------------------------------+---------------------------------------------+-----------------+
| ID | Stack Name | Stack Status |
+--------------------------------------+---------------------------------------------+-----------------+
| c220dd92-034e-4e7f-bea3-e5e7e95b145c | vnflcm_c3f9c200-7f52-42c5-9c64-6032faa3faf8 | CREATE_COMPLETE |
+--------------------------------------+---------------------------------------------+-----------------+
.. note::
'ID' has changed from the ID before healing.
'Stack Status' transitions to CREATE_COMPLETE.
'ID' has changed from the ID before healing.
'Stack Status' transitions to CREATE_COMPLETE.
How to Heal Specified with VNFC Instances
@ -389,18 +694,21 @@ Extract the value of vnfcResourceInfo -> id from 'Instantiated Vnf Info'
in **Healing target VNF instance**.
This is the VNFC instance ID.
This manual shows an example of healing VDU1 as VNFC.
In this manual, **b07ba349-1366-4d14-91e9-07842cdfa7ab** corresponds to
the ``VNFC_instance_ID`` of VDU1.
.. code-block:: console
.. note:: In the case of version 1 API,
``VNFC_INSTANCE_ID`` is ``instantiatedVnfInfo.vnfcResourceInfo.id``.
In the case of version 2 API,
``VNFC_INSTANCE_ID`` is ``instantiatedVnfInfo.vnfcInfo.id``.
$ openstack vnflcm show c3f9c200-7f52-42c5-9c64-6032faa3faf8 \
-f json | jq '."Instantiated Vnf Info".vnfcResourceInfo[].id'
"b0f677ce-93db-416a-839b-998707338d14"
"9da6945b-d9a3-4001-a03a-7b239b7e7084"
This manual shows an example of healing VDU1 as VNFC.
In this manual, **b0f677ce-93db-416a-839b-998707338d14** corresponds to
the VNFC instance ID of VDU1.
When healing specified with VNFC instances, the following
APIs are executed from Tacker to Heat.
See `Heat API reference`_. for details on Heat APIs.
See `Heat API reference`_ for details on Heat APIs.
* stack resource mark unhealthy
* stack update
@ -410,11 +718,12 @@ resource_status of VDU1 before and after healing.
This is to confirm that the resource ID of this VDU1 has changed
before and after healing, and that the re-creation has been
completed successfully.
See `Heat CLI reference`_. for details on Heat CLI commands.
See `Heat CLI reference`_ for details on Heat CLI commands.
.. note::
Note that 'vnfc-instance-id' managed by Tacker and
'physical-resource-id' managed by Heat are different.
Note that 'vnfc-instance-id' managed by Tacker and
'physical-resource-id' managed by Heat are different.
VDU1 information before healing:
@ -422,7 +731,7 @@ VDU1 information before healing:
.. code-block:: console
$ openstack stack resource show HEAT_STACK_ID \
VDU_NAME -c physical_resource_id -c resource_status
VDU_NAME -c physical_resource_id -c resource_status
Result:
@ -432,7 +741,7 @@ Result:
+----------------------+--------------------------------------+
| Field | Value |
+----------------------+--------------------------------------+
| physical_resource_id | b3393a22-a064-43d0-b021-e8549a62b366 |
| physical_resource_id | 6b89f9c9-ebd8-49ca-8e2c-c01838daeb95 |
| resource_status | CREATE_COMPLETE |
+----------------------+--------------------------------------+
@ -441,27 +750,27 @@ Healing execution of VDU1:
.. code-block:: console
$ openstack vnflcm heal VNF_INSTANCE_ID \
--vnfc-instance VNFC_INSTANCE_ID
$ openstack vnflcm heal VNF_INSTANCE_ID --vnfc-instance VNFC_INSTANCE_ID
Result:
.. code-block:: console
Heal request for VNF Instance 9e086f34-b3c9-4986-b5e5-609a5ac4c1f9 has been accepted.
Heal request for VNF Instance c3f9c200-7f52-42c5-9c64-6032faa3faf8 has been accepted.
.. note::
It is possible to specify multiple VNFC instance IDs in '--vnfc-instance' option.
It is possible to specify multiple VNFC instance IDs in '--vnfc-instance' option.
VDU1 information before healing:
VDU1 information after healing:
.. code-block:: console
$ openstack stack resource show HEAT_STACK_ID \
VDU_NAME -c physical_resource_id -c resource_status
VDU_NAME -c physical_resource_id -c resource_status
Result:
@ -471,13 +780,15 @@ Result:
+----------------------+--------------------------------------+
| Field | Value |
+----------------------+--------------------------------------+
| physical_resource_id | 794b9460-d799-4398-98a4-413fb04d2051 |
| resource_status | CREATE_COMPLETE |
| physical_resource_id | 6b89f9c9-ebd8-49ca-8e2c-c01838daeb95 |
| resource_status | UPDATE_COMPLETE |
+----------------------+--------------------------------------+
.. note::
'physical_resource_id' has changed from the ID before healing.
'resource_status' transitions to CREATE_COMPLETE.
'physical_resource_id' has not changed from the ID before healing.
'resource_status' transitions to UPDATE_COMPLETE.
.. _NFV-SOL002 v2.6.1 : https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/002/02.06.01_60/gs_NFV-SOL002v020601p.pdf

View File

@ -2,7 +2,13 @@
ETSI NFV-SOL VNF Scaling
========================
This document describes how to scale VNF in Tacker.
This document describes how to scale VNF in Tacker v1 API.
.. note::
This is a document for Tacker v1 API.
See :doc:`/user/v2/vnf/scale/index` for Tacker v2 API.
Overview
--------
@ -17,22 +23,23 @@ The diagram below shows an overview of the VNF scaling.
2. Call OpenStack Heat API
Upon receiving a request from tacker-client, tacker-server redirects it to
tacker-conductor. In tacker-conductor, the request is redirected again to
tacker-conductor. In tacker-conductor, the request is redirected again to
an appropriate infra-driver (in this case OpenStack infra-driver) according
to the contents of the instantiate parameters. Then, OpenStack infra-driver
to the contents of the instantiate parameters. Then, OpenStack infra-driver
calls OpenStack Heat APIs.
3. Change the number of VMs
OpenStack Heat change the number of VMs according to the API calls.
.. figure:: ../_images/etsi_vnf_scaling.png
:align: left
.. figure:: /_images/etsi_vnf_scaling.png
.. note:: Scale API version 1 supports is_reverse option.
Scale-in operation with this option deletes VNF from the last
registered VM. Scale API version 2 does not support this option
because it deletes VM in this order by default.
.. note::
Scale API version 1 supports is_reverse option.
Scale-in operation with this option deletes VNF from the last
registered VM.
Prerequisites
@ -44,15 +51,16 @@ The following packages should be installed:
* python-tackerclient
A default VIM should be registered according to
:doc:`../cli/cli-legacy-vim`.
:doc:`/cli/cli-legacy-vim`.
The VNF Package(sample_vnf_pkg.zip) used below is prepared
by referring to :doc:`./vnf-package`.
The VNF Package(sample_vnf_package_csar.zip) used below is prepared
by referring to :doc:`/user/vnf-package`.
Execute up to "Instantiate VNF" in the procedure of
:doc:`./etsi_vnf_deployment_as_vm_with_tosca` or
:doc:`./etsi_vnf_deployment_as_vm_with_user_data`.
In other words, the procedure after "Terminate VNF" is not executed.
The procedure of prepare for scaling operation that from "register VIM" to
"Instantiate VNF", basically refer to
:doc:`/user/etsi_vnf_deployment_as_vm_with_user_data`.
This procedure uses an example using the sample VNF package.
VNF Scaling Procedure
@ -62,7 +70,7 @@ As mentioned in Prerequisites, the VNF must be instantiated
before performing scaling.
Details of CLI commands are described in
:doc:`../cli/cli-etsi-vnflcm`.
:doc:`/cli/cli-etsi-vnflcm`.
There are two main methods for VNF scaling.
@ -92,21 +100,6 @@ corresponds to ASPECT_ID.
vdu_profile:
min_number_of_instances: 1
max_number_of_instances: 3
capabilities:
virtual_compute:
properties:
requested_additional_capabilities:
properties:
requested_additional_capability_name: m1.tiny
support_mandatory: true
target_performance_parameters:
entry_schema: test
virtual_memory:
virtual_mem_size: 512 MB
virtual_cpu:
num_virtual_cpu: 1
virtual_local_storage:
- size_of_storage: 3 GB
...snip VNFD...
@ -167,7 +160,9 @@ corresponds to ASPECT_ID.
...snip VNFD...
.. note:: See `NFV-SOL001 v2.6.1`_ annex A.6 for details about ASPECT_ID.
.. note::
See `NFV-SOL001 v2.6.1`_ annex A.6 for details about ASPECT_ID.
How to Scale Out VNF
@ -191,13 +186,13 @@ Result:
.. code-block:: console
+--------------------------------------+-----------------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
| ID | Stack Name | Stack Status | Parent |
+--------------------------------------+-----------------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
| 43b183c8-53cc-430f-b4e8-b0e1adc4e702 | vnflcm_edd306c3-647c-412c-a033-74aa40118038-VDU1_scale_group-5w6gwjuqjpsx-rlitsss7zfsx-oa4wsjz5yfcf | CREATE_COMPLETE | b96169b5-d692-4b5c-81b2-86010775180e |
| b96169b5-d692-4b5c-81b2-86010775180e | vnflcm_edd306c3-647c-412c-a033-74aa40118038-VDU1_scale_group-5w6gwjuqjpsx | CREATE_COMPLETE | 6f48a8cf-0acb-4271-ae72-562c903f5381 |
| 6f48a8cf-0acb-4271-ae72-562c903f5381 | vnflcm_edd306c3-647c-412c-a033-74aa40118038 | CREATE_COMPLETE | None |
+--------------------------------------+-----------------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
+--------------------------------------+-----------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
| ID | Stack Name | Stack Status | Parent |
+--------------------------------------+-----------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
| 3315a9f5-9c55-45ec-8b52-91875856c6e6 | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a-VDU1_scale-3x6qwnzbj6ep | CREATE_COMPLETE | e9d4576f-950c-4076-a54d-35b5cf43ebdd |
| 1b0bd450-3154-4301-b004-46a8b21152c1 | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a-VDU1_scale-3x6qwnzbj6ep-gfrxqjt6nfqb-2ufs4pbsedui | CREATE_COMPLETE | 3315a9f5-9c55-45ec-8b52-91875856c6e6 |
| e9d4576f-950c-4076-a54d-35b5cf43ebdd | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a | CREATE_COMPLETE | None |
+--------------------------------------+-----------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
Scale-out VNF can be executed by the following CLI command.
@ -211,7 +206,7 @@ Result:
.. code-block:: console
Scale request for VNF Instance edd306c3-647c-412c-a033-74aa40118038 has been accepted.
Scale request for VNF Instance 0c3644ff-b207-4a6a-9d3a-d1295cda153a has been accepted.
Stack information after scale-out:
@ -225,45 +220,55 @@ Result:
.. code-block:: console
+--------------------------------------+-----------------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
| ID | Stack Name | Stack Status | Parent |
+--------------------------------------+-----------------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
| 44c364a0-1928-4717-bd95-43a74a5fe520 | vnflcm_edd306c3-647c-412c-a033-74aa40118038-VDU1_scale_group-5w6gwjuqjpsx-prjzcxxskx4i-bwx6egqcdlqg | CREATE_COMPLETE | b96169b5-d692-4b5c-81b2-86010775180e |
| 43b183c8-53cc-430f-b4e8-b0e1adc4e702 | vnflcm_edd306c3-647c-412c-a033-74aa40118038-VDU1_scale_group-5w6gwjuqjpsx-rlitsss7zfsx-oa4wsjz5yfcf | UPDATE_COMPLETE | b96169b5-d692-4b5c-81b2-86010775180e |
| b96169b5-d692-4b5c-81b2-86010775180e | vnflcm_edd306c3-647c-412c-a033-74aa40118038-VDU1_scale_group-5w6gwjuqjpsx | UPDATE_COMPLETE | 6f48a8cf-0acb-4271-ae72-562c903f5381 |
| 6f48a8cf-0acb-4271-ae72-562c903f5381 | vnflcm_edd306c3-647c-412c-a033-74aa40118038 | CREATE_COMPLETE | None |
+--------------------------------------+-----------------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
+--------------------------------------+-----------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
| ID | Stack Name | Stack Status | Parent |
+--------------------------------------+-----------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
| 909dc6a6-f60a-4410-84a1-9cfbfb788be1 | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a-VDU1_scale-3x6qwnzbj6ep-cvfcy4h2rmuh-6zmqn6ason36 | CREATE_COMPLETE | 3315a9f5-9c55-45ec-8b52-91875856c6e6 |
| 3315a9f5-9c55-45ec-8b52-91875856c6e6 | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a-VDU1_scale-3x6qwnzbj6ep | UPDATE_COMPLETE | e9d4576f-950c-4076-a54d-35b5cf43ebdd |
| 1b0bd450-3154-4301-b004-46a8b21152c1 | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a-VDU1_scale-3x6qwnzbj6ep-gfrxqjt6nfqb-2ufs4pbsedui | UPDATE_COMPLETE | 3315a9f5-9c55-45ec-8b52-91875856c6e6 |
| e9d4576f-950c-4076-a54d-35b5cf43ebdd | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a | CREATE_COMPLETE | None |
+--------------------------------------+-----------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
Stack details:
.. code-block:: console
$ openstack stack resource list b96169b5-d692-4b5c-81b2-86010775180e
$ openstack stack resource list 3315a9f5-9c55-45ec-8b52-91875856c6e6
+---------------+--------------------------------------+---------------+-----------------+----------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time |
+---------------+--------------------------------------+---------------+-----------------+----------------------+
| rlitsss7zfsx | 43b183c8-53cc-430f-b4e8-b0e1adc4e702 | VDU1.yaml | UPDATE_COMPLETE | 2021-01-06T05:24:50Z |
| prjzcxxskx4i | 44c364a0-1928-4717-bd95-43a74a5fe520 | VDU1.yaml | CREATE_COMPLETE | 2021-01-06T05:24:49Z |
| gfrxqjt6nfqb | 1b0bd450-3154-4301-b004-46a8b21152c1 | VDU1.yaml | UPDATE_COMPLETE | 2023-12-28T02:36:50Z |
| cvfcy4h2rmuh | 909dc6a6-f60a-4410-84a1-9cfbfb788be1 | VDU1.yaml | CREATE_COMPLETE | 2023-12-28T02:36:50Z |
+---------------+--------------------------------------+---------------+-----------------+----------------------+
$ openstack stack resource list 43b183c8-53cc-430f-b4e8-b0e1adc4e702
+----------------+--------------------------------------+------------------------+-----------------+----------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time |
+----------------+--------------------------------------+------------------------+-----------------+----------------------+
| VDU1 | 82fd8c7d-7a55-449e-b563-457c6c59e9ac | OS::Nova::Server | CREATE_COMPLETE | 2021-01-06T05:15:35Z |
+----------------+--------------------------------------+------------------------+-----------------+----------------------+
$ openstack stack resource list 1b0bd450-3154-4301-b004-46a8b21152c1
+---------------+--------------------------------------+-------------------+-----------------+----------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time |
+---------------+--------------------------------------+-------------------+-----------------+----------------------+
| VDU1 | f32848eb-598f-4158-8896-5ea9479456de | OS::Nova::Server | CREATE_COMPLETE | 2023-12-28T02:32:04Z |
| VDU1_CP4 | e21dc5cc-eb46-4cf9-a352-7aa3cf659af7 | OS::Neutron::Port | CREATE_COMPLETE | 2023-12-28T02:32:04Z |
| VDU1_CP2 | 0988d9dc-97ba-43be-944d-185e316785f9 | OS::Neutron::Port | CREATE_COMPLETE | 2023-12-28T02:32:04Z |
| VDU1_CP3 | d125eec4-4e85-43cb-9887-cd5373b0abae | OS::Neutron::Port | CREATE_COMPLETE | 2023-12-28T02:32:04Z |
| VDU1_CP5 | 16e66a58-c75c-4afe-be4f-e7eaafdfa506 | OS::Neutron::Port | CREATE_COMPLETE | 2023-12-28T02:32:04Z |
| VDU1_CP1 | d581db6b-eac8-49cf-99e0-3c494450b33b | OS::Neutron::Port | CREATE_COMPLETE | 2023-12-28T02:32:04Z |
+---------------+--------------------------------------+-------------------+-----------------+----------------------+
$ openstack stack resource list 44c364a0-1928-4717-bd95-43a74a5fe520
+----------------+--------------------------------------+------------------------+-----------------+----------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time |
+----------------+--------------------------------------+------------------------+-----------------+----------------------+
| VDU1 | 073fc301-49a5-41ff-953f-5fa6736414ed | OS::Nova::Server | CREATE_COMPLETE | 2021-01-06T05:24:49Z |
+----------------+--------------------------------------+------------------------+-----------------+----------------------+
$ openstack stack resource list 909dc6a6-f60a-4410-84a1-9cfbfb788be1
+---------------+--------------------------------------+-------------------+-----------------+----------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time |
+---------------+--------------------------------------+-------------------+-----------------+----------------------+
| VDU1 | e92cb6ca-72bb-46c8-91f1-531eb1d01315 | OS::Nova::Server | CREATE_COMPLETE | 2023-12-28T02:36:52Z |
| VDU1_CP4 | 838a673d-d684-4eaa-92ff-78f1d145b4e1 | OS::Neutron::Port | CREATE_COMPLETE | 2023-12-28T02:36:52Z |
| VDU1_CP2 | e10f8b96-7e90-4232-b8aa-ec72b9a39d55 | OS::Neutron::Port | CREATE_COMPLETE | 2023-12-28T02:36:52Z |
| VDU1_CP3 | 40960abd-5a3d-439f-8f2d-4ad70b5eb1ea | OS::Neutron::Port | CREATE_COMPLETE | 2023-12-28T02:36:52Z |
| VDU1_CP5 | b71a8b32-5ce4-48fb-9cf5-8bb6328b3679 | OS::Neutron::Port | CREATE_COMPLETE | 2023-12-28T02:36:52Z |
| VDU1_CP1 | 35344427-eff6-47e3-820b-11782996e805 | OS::Neutron::Port | CREATE_COMPLETE | 2023-12-28T02:36:52Z |
+---------------+--------------------------------------+-------------------+-----------------+----------------------+
It can be seen that the child-stack (ID: 44c364a0-1928-4717-bd95-43a74a5fe520)
with the parent-stack (ID: b96169b5-d692-4b5c-81b2-86010775180e)
It can be seen that the child-stack (ID: 909dc6a6-f60a-4410-84a1-9cfbfb788be1)
with the parent-stack (ID: 3315a9f5-9c55-45ec-8b52-91875856c6e6)
is increased by the scaling out operation.
@ -288,14 +293,14 @@ Result:
.. code-block:: console
+--------------------------------------+-----------------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
| ID | Stack Name | Stack Status | Parent |
+--------------------------------------+-----------------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
| 44c364a0-1928-4717-bd95-43a74a5fe520 | vnflcm_edd306c3-647c-412c-a033-74aa40118038-VDU1_scale_group-5w6gwjuqjpsx-prjzcxxskx4i-bwx6egqcdlqg | CREATE_COMPLETE | b96169b5-d692-4b5c-81b2-86010775180e |
| 43b183c8-53cc-430f-b4e8-b0e1adc4e702 | vnflcm_edd306c3-647c-412c-a033-74aa40118038-VDU1_scale_group-5w6gwjuqjpsx-rlitsss7zfsx-oa4wsjz5yfcf | UPDATE_COMPLETE | b96169b5-d692-4b5c-81b2-86010775180e |
| b96169b5-d692-4b5c-81b2-86010775180e | vnflcm_edd306c3-647c-412c-a033-74aa40118038-VDU1_scale_group-5w6gwjuqjpsx | UPDATE_COMPLETE | 6f48a8cf-0acb-4271-ae72-562c903f5381 |
| 6f48a8cf-0acb-4271-ae72-562c903f5381 | vnflcm_edd306c3-647c-412c-a033-74aa40118038 | CREATE_COMPLETE | None |
+--------------------------------------+-----------------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
+--------------------------------------+-----------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
| ID | Stack Name | Stack Status | Parent |
+--------------------------------------+-----------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
| 909dc6a6-f60a-4410-84a1-9cfbfb788be1 | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a-VDU1_scale-3x6qwnzbj6ep-cvfcy4h2rmuh-6zmqn6ason36 | CREATE_COMPLETE | 3315a9f5-9c55-45ec-8b52-91875856c6e6 |
| 3315a9f5-9c55-45ec-8b52-91875856c6e6 | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a-VDU1_scale-3x6qwnzbj6ep | UPDATE_COMPLETE | e9d4576f-950c-4076-a54d-35b5cf43ebdd |
| 1b0bd450-3154-4301-b004-46a8b21152c1 | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a-VDU1_scale-3x6qwnzbj6ep-gfrxqjt6nfqb-2ufs4pbsedui | UPDATE_COMPLETE | 3315a9f5-9c55-45ec-8b52-91875856c6e6 |
| e9d4576f-950c-4076-a54d-35b5cf43ebdd | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a | CREATE_COMPLETE | None |
+--------------------------------------+-----------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
Scale-in VNF can be executed by the following CLI command.
@ -309,7 +314,7 @@ Result:
.. code-block:: console
Scale request for VNF Instance edd306c3-647c-412c-a033-74aa40118038 has been accepted.
Scale request for VNF Instance 0c3644ff-b207-4a6a-9d3a-d1295cda153a has been accepted.
Stack information after scale-in:
@ -323,18 +328,18 @@ Result:
.. code-block:: console
+--------------------------------------+-----------------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
| ID | Stack Name | Stack Status | Parent |
+--------------------------------------+-----------------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
| 44c364a0-1928-4717-bd95-43a74a5fe520 | vnflcm_edd306c3-647c-412c-a033-74aa40118038-VDU1_scale_group-5w6gwjuqjpsx-prjzcxxskx4i-bwx6egqcdlqg | UPDATE_COMPLETE | b96169b5-d692-4b5c-81b2-86010775180e |
| b96169b5-d692-4b5c-81b2-86010775180e | vnflcm_edd306c3-647c-412c-a033-74aa40118038-VDU1_scale_group-5w6gwjuqjpsx | UPDATE_COMPLETE | 6f48a8cf-0acb-4271-ae72-562c903f5381 |
| 6f48a8cf-0acb-4271-ae72-562c903f5381 | vnflcm_edd306c3-647c-412c-a033-74aa40118038 | CREATE_COMPLETE | None |
+--------------------------------------+-----------------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
+--------------------------------------+-----------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
| ID | Stack Name | Stack Status | Parent |
+--------------------------------------+-----------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
| 909dc6a6-f60a-4410-84a1-9cfbfb788be1 | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a-VDU1_scale-3x6qwnzbj6ep-cvfcy4h2rmuh-6zmqn6ason36 | UPDATE_COMPLETE | 3315a9f5-9c55-45ec-8b52-91875856c6e6 |
| 3315a9f5-9c55-45ec-8b52-91875856c6e6 | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a-VDU1_scale-3x6qwnzbj6ep | UPDATE_COMPLETE | e9d4576f-950c-4076-a54d-35b5cf43ebdd |
| e9d4576f-950c-4076-a54d-35b5cf43ebdd | vnflcm_0c3644ff-b207-4a6a-9d3a-d1295cda153a | CREATE_COMPLETE | None |
+--------------------------------------+-----------------------------------------------------------------------------------------------+-----------------+--------------------------------------+
There were two child-stacks(ID: 44c364a0-1928-4717-bd95-43a74a5fe520
and ID: 43b183c8-53cc-430f-b4e8-b0e1adc4e702) with
a parent-stack(ID: b96169b5-d692-4b5c-81b2-86010775180e),
There were two child-stacks(ID: 1b0bd450-3154-4301-b004-46a8b21152c1
and ID: 909dc6a6-f60a-4410-84a1-9cfbfb788be1) with
a parent-stack(ID: 3315a9f5-9c55-45ec-8b52-91875856c6e6),
it can be seen that one of them is decreased by the scale-in operation.

View File

@ -2,7 +2,13 @@
ETSI NFV-SOL VNF Update
=======================
This document describes how to update VNF in Tacker.
This document describes how to update VNF in Tacker v1 API.
.. note::
This is a document for Tacker v1 API.
See :doc:`/user/v2/vnf/update` for Tacker v2 API.
Prerequisites
-------------
@ -13,13 +19,13 @@ The following packages should be installed:
* python-tackerclient
A default VIM should be registered according to
:doc:`../cli/cli-legacy-vim`.
:doc:`/cli/cli-legacy-vim`.
The VNF Package(sample_vnf_pkg.zip) used below is prepared
by referring to :doc:`./vnf-package`.
The VNF Package(sample_vnf_package_csar.zip) used below is prepared
by referring to :doc:`/user/vnf-package`.
Execute before "Instantiate VNF" in the procedure of
:doc:`./etsi_vnf_deployment_as_vm_with_tosca`.
:doc:`/user/etsi_vnf_deployment_as_vm_with_tosca`.
VNF Update Procedures
@ -29,7 +35,7 @@ As mentioned in Prerequisites, the VNF must be created
before performing update.
Details of CLI commands are described in
:doc:`../cli/cli-etsi-vnflcm`.
:doc:`/cli/cli-etsi-vnflcm`.
For update VNF instance, you need to prepare a JSON-formatted definition file.
@ -39,7 +45,9 @@ For update VNF instance, you need to prepare a JSON-formatted definition file.
"vnfInstanceName": "sample"
}
.. note::
sample_param_file.json contains the VNF name as an example.
For v1 update operation, the following attributes of
``VnfInfoModificationRequest`` are not supported.
@ -50,14 +58,6 @@ For update VNF instance, you need to prepare a JSON-formatted definition file.
* vnfcInfoModifications
* vimConnectionInfo
.. note::
The v2 update operation can change the ``vimConnectionInfo``
associated with an existing VNF instance.
Even if update operation specify multiple ``vimConnectionInfo``
associated with one VNF instance, only one of them will be used for life
cycle management operations.
It is not possible to delete the key of registered ``vimConnectionInfo``.
How to Update VNF
~~~~~~~~~~~~~~~~~
@ -78,11 +78,11 @@ Result:
.. code-block:: console
+-------------------+-------+
| Field | Value |
+-------------------+-------+
| VNF Instance Name | None |
+-------------------+-------+
+-------------------+------------------------------------------+
| Field | Value |
+-------------------+------------------------------------------+
| VNF Instance Name | vnf-810d8c9b-e467-4b06-9265-ac9dce015fce |
+-------------------+------------------------------------------+
Update VNF can be executed by the following CLI command.
@ -96,9 +96,11 @@ Result:
.. code-block:: console
Update vnf:c64ea0fd-a90c-4754-95f4-dc0751db519d
Update vnf:810d8c9b-e467-4b06-9265-ac9dce015fce
.. note::
Create a parameter file that describes the resource information to be
changed in advance.
@ -114,25 +116,18 @@ Result:
.. code-block:: console
+-------------------+---------+
| Field | Value |
+-------------------+---------+
| VNF Instance Name | sample |
+-------------------+---------+
+-------------------+--------+
| Field | Value |
+-------------------+--------+
| VNF Instance Name | sample |
+-------------------+--------+
You can confirm that the VNF Instance Name has been changed by the update
operation.
If the ``vnfdId`` is not changed by update operation, the current value
shall be updated using the request parameter.
The following attributes are updated by performing JSON Merge Patch with the
values set in the request parameter to the current values.
* vnfConfigurableProperties
* metadata
* extensions
If the ``vnfdId`` is requested to be changed by v1 update operation, the
following attributes of VNF instance shall be updated in addition to those

View File

@ -24,6 +24,7 @@ Getting Started
.. toctree::
:maxdepth: 2
v2/getting_started/index
etsi_getting_started
@ -33,5 +34,6 @@ Use Case Guide
.. toctree::
:maxdepth: 3
v2/use_case_guide
etsi_use_case_guide
encrypt_vim_auth_with_barbican

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,736 @@
===============================================================
ETSI NFV-SOL CNF Auto Healing With Prometheus via FM Interfaces
===============================================================
This document describes how to auto heal CNF in Tacker v2 API with
Prometheus via Fault Management Interfaces.
Overview
--------
Using the Fault Management interfaces, there are two ways to implement
auto heal, Polling Mode and Notification Mode.
The diagram below shows an overview of the CNF auto healing.
1. Create FM subscription(Notification Mode)
NFVO sends a request to Tacker to create a FM subscription.
2. Collect metrics
Prometheus collects metrics and decides whether triggering alert
is needed or not.
3. POST alert
Prometheus sends alerts to Tacker.
4. Convert alert to alarm
Tacker receives informed alerts, converts them to alarms, and saves
them to Tacker DB.
5. Get Alarms and return result(Polling Mode)
NFVO sends a request at regular intervals to get the alarm in
the Tacker. Tacker searches Tacker DB with the query condition
specified by NFVO, and returns the alarm that matches the
condition to NFVO.
6. Send alarm notification(Notification Mode)
VnffmDriver finds all FM subscriptions in the DB and matches the
alerts to them. If there is a FM subscription that can match
successfully, the alarm is sent to the specified path of the
NFVO. If the match is not successful, the processing ends.
7. Heal
NFVO recognizes the failure of the CNF from the alarm and sends
a heal request to the Tacker.
8. Call Kubernetes API
In tacker-conductor, the request is redirected again to an
appropriate infra-driver (in this case Kubernetes infra-driver)
according to the contents of the instantiate parameters. Then,
Kubernetes infra-driver calls Kubernetes APIs.
9. Create a new pod
Kubernetes Master adds the number of Pods according to the
API calls.
10. Delete the old pod
Kubernetes Master deletes the number of Pods according to the
API calls.
.. figure:: img/auto_heal_fm.svg
Prerequisites
-------------
* The following packages should be installed:
* tacker
* python-tackerclient
At least one VNF instance with status of ``INSTANTIATED`` is required.
You can refer to :doc:`/user/v2/cnf/deployment/index` for the
procedure to instantiate VNF.
The VNF Package used can refer to `the sample`_.
* The following third-party services should be installed
* NFVO
* Prometheus(including Alertmanager)
Each operator has its own NFVO, there is no restriction here, as long as
it conforms to `ETSI NFV-SOL 002 v3.3.1`_ and `ETSI NFV-SOL 003 v3.3.1`_,
it can be used.
For the installation of Prometheus and Alertmanager, please refer to
the `Prometheus official website`_.
How to configure Prometheus Plugin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Prometheus Plugin is disabled by default in Tacker.
For it to work, we need to find ``fault_management`` in
``tacker.conf`` and change its value to ``True``.
.. code-block:: console
$ vi /etc/tacker/tacker.conf
...
[prometheus_plugin]
fault_management = True
[v2_vnfm]
# Enable https access to notification server from Tacker (boolean value)
notification_verify_cert = true
...
After modifying the configuration file, don't forget to restart the
Tacker service to take effect.
.. code-block:: console
$ sudo systemctl stop devstack@tacker
$ sudo systemctl restart devstack@tacker-conductor
$ sudo systemctl start devstack@tacker
How to configure Prometheus
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unlike auto scale via PM interfaces, auto heal via FM interfaces does not
need to login Prometheus server via SSH to modify its configuration.
Users need to manually modify the configuration file of Prometheus, and
then it will monitor the specified resources.
For the setting method of Prometheus configuration file, please refer to
`Prometheus Configuration`_ for details.
The following is the content of a sample ``prometheus.yml``:
.. code-block:: yaml
global:
scrape_interval: 15s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets:
- <IP of Alertmanager>:9093
rule_files:
- "tacker-samplevnf-rules.yaml"
scrape_configs:
- job_name: "kube-state-metrics"
static_configs:
- targets: ["<IP of Kubernetes>:<port of metrics>"]
The following is the content of a sample ``tacker-samplevnf-rules.json``:
.. code-block:: yaml
groups:
- name: example
rules:
- alert: KubePodCrashLooping
annotations:
probable_cause: The server cannot be connected.
fault_type: Server Down
fault_details: fault details
expr: |
rate(kube_pod_container_status_restarts_total{job="kube-state-metrics"}[10m]) * 60 * 5 > 0
for: 5m
labels:
receiver_type: tacker
function_type: vnffm
vnf_instance_id: <VNF instance ID>
perceived_severity: WARNING
event_type: EQUIPMENT_ALARM
The following is the content of a sample ``alertmanager.yml``:
.. code-block:: yaml
route:
group_by: ['cluster']
group_wait: 30s
group_interval: 2m
repeat_interval: 1h
receiver: 'web.boo'
routes:
- match:
alertname: KubePodCrashLooping
receiver: 'web.boo'
receivers:
- name: 'web.boo'
webhook_configs:
- url: 'http://<IP of Tacker>:9890/alert'
inhibit_rules:
- source_match:
severity: 'critical'
target_match:
severity: 'warning'
equal: ['dev', 'instance']
How does NFVO Auto Heal CNF
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Through the FM interfaces, there are two modes to auto heal the CNF.
Polling Mode
^^^^^^^^^^^^
This mode is where NFVO actively sends a get alarms request to Tacker
at an interval.
According to the content of the response, confirm the VNFC instance ID
of the CNF in which the problem occurred.
The following is an example of a response to a get alarms request:
.. code-block:: json
[
{
"id": "de8e74e8-1845-40dd-892c-cb7a67c26f9f",
"managedObjectId": "c21fd71b-2866-45f6-89d0-70c458a5c32e",
"vnfcInstanceIds": [
"VDU1-curry-probe-test001-798d577c96-5624p"
],
"alarmRaisedTime": "2023-12-08T13:16:30Z",
"alarmChangedTime": "",
"alarmClearedTime": "",
"alarmAcknowledgedTime": "",
"ackState": "UNACKNOWLEDGED",
"perceivedSeverity": "CRITICAL",
"eventTime": "2023-12-08T13:16:00Z",
"eventType": "PROCESSING_ERROR_ALARM",
"faultType": "fault_type",
"probableCause": "Process Terminated",
"isRootCause": "false",
"correlatedAlarmIds": [],
"faultDetails": [
"fingerprint: 5ee739bb8840a190",
"detail: fault_details"
],
"_links": {
"self": {
"href": "http://127.0.0.1:9890/vnffm/v1/alarms/de8e74e8-1845-40dd-892c-cb7a67c26f9f"
},
"objectInstance": {
"href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/c21fd71b-2866-45f6-89d0-70c458a5c32e"
}
}
}
]
.. note::
The value of ``managedObjectId`` is the VNF instance ID.
The value of ``vnfcInstanceIds`` is the VNFC instance IDs.
Then send a heal request specifying the VNFC instance ID to Tacker.
The format of the heal request can refer to `heal request`_.
Notification Mode
^^^^^^^^^^^^^^^^^
This mode is that NFVO will create a FM subscription on Tacker.
In this FM subscription, multiple filter conditions can be set, so that
the VNF instance that has been instantiated in Tacker can be matched.
Create FM subscription can be executed by the following CLI command.
.. code-block:: console
$ openstack vnffm sub create sample_param_file.json --os-tacker-api-version 2
The content of the sample ``sample_param_file.json`` in this document is
as follows:
.. code-block:: json
{
"filter": {
"vnfInstanceSubscriptionFilter": {
"vnfdIds": [
"4d5ffa3b-9dde-45a9-a805-659dc8df0c02"
],
"vnfProductsFromProviders": [
{
"vnfProvider": "Company",
"vnfProducts": [
{
"vnfProductName": "Sample VNF",
"versions": [
{
"vnfSoftwareVersion": 1.0,
"vnfdVersions": [1.0, 2.0]
}
]
}
]
}
],
"vnfInstanceIds": [
"aad7d2fe-ed51-47da-a20d-7b299860607e"
],
"vnfInstanceNames": [
"test"
]
},
"notificationTypes": [
"AlarmNotification"
],
"faultyResourceTypes": [
"COMPUTE"
],
"perceivedSeverities": [
"WARNING"
],
"eventTypes": [
"EQUIPMENT_ALARM"
],
"probableCauses": [
"The server cannot be connected."
]
},
"callbackUri": "http://127.0.0.1:9890/vnffm/v1/subscriptions/407cb9c5-60f2-43e8-a43a-925c0323c3eb",
"authentication": {
"authType": [
"BASIC",
"OAUTH2_CLIENT_CREDENTIALS",
"OAUTH2_CLIENT_CERT"
],
"paramsBasic": {
"userName": "nfvo",
"password": "nfvopwd"
},
"paramsOauth2ClientCredentials": {
"clientId": "auth_user_name",
"clientPassword": "auth_password",
"tokenEndpoint": "token_endpoint"
},
"paramsOauth2ClientCert": {
"clientId": "auth_user_name",
"certificateRef": {
"type": "x5t#S256",
"value": "certificate_fingerprint"
},
"tokenEndpoint": "token_endpoint"
}
}
}
Here is an example of create FM subscription:
.. code-block:: console
$ openstack vnffm sub create sample_param_file.json --os-tacker-api-version 2
+--------------+-----------------------------------------------------------------------------------------------------+
| Field | Value |
+--------------+-----------------------------------------------------------------------------------------------------+
| Callback Uri | http://127.0.0.1:9890/vnffm/v1/subscriptions/407cb9c5-60f2-43e8-a43a-925c0323c3eb |
| Filter | { |
| | "vnfInstanceSubscriptionFilter": { |
| | "vnfdIds": [ |
| | "4d5ffa3b-9dde-45a9-a805-659dc8df0c02" |
| | ], |
| | "vnfProductsFromProviders": [ |
| | { |
| | "vnfProvider": "Company", |
| | "vnfProducts": [ |
| | { |
| | "vnfProductName": "Sample VNF", |
| | "versions": [ |
| | { |
| | "vnfSoftwareVersion": "1.0", |
| | "vnfdVersions": [ |
| | "1.0", |
| | "2.0" |
| | ] |
| | } |
| | ] |
| | } |
| | ] |
| | } |
| | ], |
| | "vnfInstanceIds": [ |
| | "aad7d2fe-ed51-47da-a20d-7b299860607e" |
| | ], |
| | "vnfInstanceNames": [ |
| | "test" |
| | ] |
| | }, |
| | "notificationTypes": [ |
| | "AlarmNotification" |
| | ], |
| | "faultyResourceTypes": [ |
| | "COMPUTE" |
| | ], |
| | "perceivedSeverities": [ |
| | "WARNING" |
| | ], |
| | "eventTypes": [ |
| | "EQUIPMENT_ALARM" |
| | ], |
| | "probableCauses": [ |
| | "The server cannot be connected." |
| | ] |
| | } |
| ID | a7a18ac6-a668-4d94-8ba0-f04c20cfeacd |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnffm/v1/subscriptions/407cb9c5-60f2-43e8-a43a-925c0323c3eb" |
| | } |
| | } |
+--------------+-----------------------------------------------------------------------------------------------------+
After the FM subscription is created, whenever Prometheus sends an alert
to Tacker, Tacker will find a matching FM subscription based on the
information in the alert.
The following is an example of the request body that Prometheus sends
an alert:
.. code-block:: json
{
"receiver": "receiver",
"status": "firing",
"alerts": [
{
"status": "firing",
"labels": {
"receiver_type": "tacker",
"function_type": "vnffm",
"vnf_instance_id": "c21fd71b-2866-45f6-89d0-70c458a5c32e",
"pod": "VDU1-curry-probe-test001-798d577c96-5624p",
"perceived_severity": "CRITICAL",
"event_type": "PROCESSING_ERROR_ALARM"
},
"annotations": {
"fault_type": "fault_type",
"probable_cause": "Process Terminated",
"fault_details": "fault_details"
},
"startsAt": "2023-12-08T13:16:00Z",
"endsAt": "0001-01-01T00:00:00Z",
"generatorURL": "http://192.168.121.35:9090/graph?g0.expr=up%7Bjob%3D%22node%22%7D+%3D%3D+0&g0.tab=1",
"fingerprint": "5ee739bb8840a190"
}
],
"groupLabels": {},
"commonLabels": {
"alertname": "NodeInstanceDown",
"job": "node"
},
"commonAnnotations": {
"description": "sample"
},
"externalURL": "http://192.168.121.35:9093",
"version": "4",
"groupKey": "{}:{}",
"truncatedAlerts": 0
}
Finally, a notification is sent to the Callback Uri (i.e. NFVO) in the FM
subscription. NFVO sends a heal request to Tacker according to the
content in the notification.
The format of the heal request can refer to `heal request`_.
The following is an example of the request body that Tacker sends
a notification:
.. code-block:: json
{
"id": "0ab777dc-b3a0-42d6-85c1-e5f80711b988",
"notificationType": "AlarmNotification",
"subscriptionId": "0155c914-8573-463c-a97a-aef5a3ca9c72",
"timeStamp": "2023-12-08T13:16:30Z",
"alarm": {
"id": "de8e74e8-1845-40dd-892c-cb7a67c26f9f",
"managedObjectId": "c21fd71b-2866-45f6-89d0-70c458a5c32e",
"vnfcInstanceIds": ["VDU1-curry-probe-test001-798d577c96-5624p"],
"alarmRaisedTime": "2023-12-08T13:16:30+00:00",
"ackState": "UNACKNOWLEDGED",
"perceivedSeverity": "CRITICAL",
"eventTime": "2023-12-08T13:16:00Z",
"eventType": "PROCESSING_ERROR_ALARM",
"faultType": "fault_type",
"probableCause": "Process Terminated",
"isRootCause": false,
"faultDetails": [
"fingerprint: 5ee739bb8840a190",
"detail: fault_details"
],
"_links": {
"self": {
"href": "http://127.0.0.1:9890/vnffm/v1/alarms/de8e74e8-1845-40dd-892c-cb7a67c26f9f"
},
"objectInstance":{
"href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/c21fd71b-2866-45f6-89d0-70c458a5c32e"
}
}
},
"_links": {
"subscription": {
"href": "http://127.0.0.1:9890/vnffm/v1/subscriptions/0155c914-8573-463c-a97a-aef5a3ca9c72"
}
}
}
How to use the CLI of FM interfaces
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get all alarms
^^^^^^^^^^^^^^
Get all alarms can be executed by the following CLI command.
.. code-block:: console
$ openstack vnffm alarm list --os-tacker-api-version 2
Here is an example of getting all alarms:
.. code-block:: console
$ openstack vnffm alarm list --os-tacker-api-version 2
+--------------------------------------+--------------------------------------+----------------+------------------------+--------------------+--------------------+
| ID | Managed Object Id | Ack State | Event Type | Perceived Severity | Probable Cause |
+--------------------------------------+--------------------------------------+----------------+------------------------+--------------------+--------------------+
| de8e74e8-1845-40dd-892c-cb7a67c26f9f | c21fd71b-2866-45f6-89d0-70c458a5c32e | UNACKNOWLEDGED | PROCESSING_ERROR_ALARM | CRITICAL | Process Terminated |
+--------------------------------------+--------------------------------------+----------------+------------------------+--------------------+--------------------+
Get the specified alarm
^^^^^^^^^^^^^^^^^^^^^^^
Get the specified alarm can be executed by the following CLI command.
.. code-block:: console
$ openstack vnffm alarm show ALARM_ID --os-tacker-api-version 2
Here is an example of getting the specified alarm:
.. code-block:: console
$ openstack vnffm alarm show de8e74e8-1845-40dd-892c-cb7a67c26f9f --os-tacker-api-version 2
+----------------------------+------------------------------------------------------------------------------------------------------+
| Field | Value |
+----------------------------+------------------------------------------------------------------------------------------------------+
| Ack State | UNACKNOWLEDGED |
| Alarm Acknowledged Time | |
| Alarm Changed Time | |
| Alarm Cleared Time | |
| Alarm Raised Time | 2023-12-08T13:16:30Z |
| Correlated Alarm Ids | |
| Event Time | 2023-12-08T13:16:00Z |
| Event Type | PROCESSING_ERROR_ALARM |
| Fault Details | [ |
| | "fingerprint: 5ee739bb8840a190", |
| | "detail: fault_details" |
| | ] |
| Fault Type | fault_type |
| ID | de8e74e8-1845-40dd-892c-cb7a67c26f9f |
| Is Root Cause | False |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnffm/v1/alarms/de8e74e8-1845-40dd-892c-cb7a67c26f9f" |
| | }, |
| | "objectInstance": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/c21fd71b-2866-45f6-89d0-70c458a5c32e" |
| | } |
| | } |
| Managed Object Id | c21fd71b-2866-45f6-89d0-70c458a5c32e |
| Perceived Severity | CRITICAL |
| Probable Cause | Process Terminated |
| Root Cause Faulty Resource | |
| Vnfc Instance Ids | [ |
| | "VDU1-curry-probe-test001-798d577c96-5624p" |
| | ] |
+----------------------------+------------------------------------------------------------------------------------------------------+
Change target Alarm
^^^^^^^^^^^^^^^^^^^
Change the ackState of the alarm can be executed by the following CLI
command.
.. code-block:: console
$ openstack vnffm alarm update ALARM_ID --ack-state ACKNOWLEDGED --os-tacker-api-version 2
.. note::
The value of ``--ack-state`` can only be ``ACKNOWLEDGED`` or
``UNACKNOWLEDGED``.
Here is an example of changing target alarm:
.. code-block:: console
$ openstack vnffm alarm update de8e74e8-1845-40dd-892c-cb7a67c26f9f --ack-state ACKNOWLEDGED --os-tacker-api-version 2
+-----------+--------------+
| Field | Value |
+-----------+--------------+
| Ack State | ACKNOWLEDGED |
+-----------+--------------+
Create a new FM subscription
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The creation of FM subscription has been introduced in the
`Notification Mode`_ above, and the use case of the CLI command
can be referred to there.
Get all FM subscriptions
^^^^^^^^^^^^^^^^^^^^^^^^
Get all FM subscriptions can be executed by the following CLI command.
.. code-block:: console
$ openstack vnffm sub list --os-tacker-api-version 2
Here is an example of getting all FM subscriptions:
.. code-block:: console
$ openstack vnffm sub list --os-tacker-api-version 2
+--------------------------------------+-------------------------------------------------------------------------------------+
| ID | Callback Uri |
+--------------------------------------+-------------------------------------------------------------------------------------+
| d6da0fff-a032-429e-8560-06e8af685e2c | http://127.0.0.1:9990/notification/callbackuri/c21fd71b-2866-45f6-89d0-70c458a5c32e |
+--------------------------------------+-------------------------------------------------------------------------------------+
Get the specified FM subscription
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Get the specified FM subscription can be executed by the following CLI command.
.. code-block:: console
$ openstack vnffm sub show FM_SUBSCRIPTION_ID --os-tacker-api-version 2
Here is an example of getting the specified FM subscription:
.. code-block:: console
$ openstack vnffm sub show d6da0fff-a032-429e-8560-06e8af685e2c --os-tacker-api-version 2
+--------------+-----------------------------------------------------------------------------------------------------+
| Field | Value |
+--------------+-----------------------------------------------------------------------------------------------------+
| Callback Uri | http://127.0.0.1:9990/notification/callbackuri/c21fd71b-2866-45f6-89d0-70c458a5c32e |
| Filter | { |
| | "vnfInstanceSubscriptionFilter": { |
| | "vnfInstanceIds": [ |
| | "c21fd71b-2866-45f6-89d0-70c458a5c32e" |
| | ] |
| | } |
| | } |
| ID | d6da0fff-a032-429e-8560-06e8af685e2c |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnffm/v1/subscriptions/d6da0fff-a032-429e-8560-06e8af685e2c" |
| | } |
| | } |
+--------------+-----------------------------------------------------------------------------------------------------+
Delete the specified FM subscription
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Delete the specified FM subscription can be executed by the following CLI
command.
.. code-block:: console
$ openstack vnffm sub delete FM_SUBSCRIPTION_ID --os-tacker-api-version 2
Here is an example of deleting the specified FM subscription:
.. code-block:: console
$ openstack vnffm sub delete d6da0fff-a032-429e-8560-06e8af685e2c --os-tacker-api-version 2
VNF FM subscription 'd6da0fff-a032-429e-8560-06e8af685e2c' deleted successfully
History of Checks
-----------------
The content of this document has been confirmed to work
using Prometheus 2.45 and Alertmanager 0.26.
.. _the sample:
https://opendev.org/openstack/tacker/src/branch/master/samples/tests/functional/sol_kubernetes_v2/test_instantiate_cnf_resources
.. _Prometheus Configuration: https://prometheus.io/docs/prometheus/latest/configuration/configuration/
.. _Prometheus official website: https://prometheus.io/docs/prometheus/latest/getting_started/
.. _ETSI NFV-SOL 002 v3.3.1:
https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/002/03.03.01_60/gs_nfv-sol002v030301p.pdf
.. _ETSI NFV-SOL 003 v3.3.1:
https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/03.03.01_60/gs_nfv-sol003v030301p.pdf
.. _heal request:
https://docs.openstack.org/api-ref/nfv-orchestration/v2/vnflcm.html?expanded=heal-a-vnf-instance-v2-detail#heal-a-vnf-instance-v2

View File

@ -15,7 +15,7 @@ frame "tacker" {
component "VnflcmControllerV2" as lcm_ctl
}
component "tacker-conductor" {
component "Vnfpm\ndriver" as pm_driver
component "VnfPm\nDriverV2" as pm_driver
component "Kubernetes\ninfra-driver" as infra
}
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,664 @@
===================================================================
ETSI NFV-SOL CNF Auto Scaling With Prometheus via PM Job Interfaces
===================================================================
This document describes how to auto scale CNF in Tacker v2 API with
Prometheus via Performance Management Job Interfaces.
Overview
--------
The diagram below shows an overview of the CNF auto scaling.
1. Create PM job
The NFVO sends a request to the Tacker to create a PM job.
2. Set PM job
Prometheus Plugin sets PM job to Prometheus.
3. Trigger event
Prometheus collects metrics and decides whether triggering event is
needed or not.
4. POST event
Prometheus sends POST request to Tacker with specified URI. Tacker
collects data related to the PM event.
5. Convert event to report
Tacker receives informed event, converts it to report, and saves
it to DB. Tacker also saves timestamp of the event.
6. Send report notification
VnfPmDriverV2 finds all jobs in the DB and matches the report to
job. If there is a job that can match successfully, the report is
sent to the specified path of the NFVO. If the match is not successful,
the processing ends.
7. Get PM report
The NFVO make a request for the content of the report, then make a
decision of scaling.
8. Scale
Upon receiving a request to scale VNF from NFVO, tacker-server
redirects it to tacker-conductor.
9. Call Kubernetes API
In tacker-conductor, the request is redirected again to an
appropriate infra-driver (in this case Kubernetes infra-driver)
according to the contents of the instantiate parameters. Then,
Kubernetes infra-driver calls Kubernetes APIs.
10. Change the number of Pods
Kubernetes Cluster change the number of Pods according to the
API calls.
.. figure:: img/auto_scale_pm_job.svg
Prerequisites
-------------
* The following packages should be installed:
* tacker
* python-tackerclient
At least one VNF instance with status of ``INSTANTIATED`` is required.
You can refer to :doc:`/user/v2/cnf/deployment/index` for the
procedure to instantiate VNF.
The VNF Package used can refer to `the sample`_.
* The following third-party services should be installed
* NFVO
* Prometheus(including Alertmanager)
Each operator has its own NFVO, there is no restriction here, as long as
it conforms to `ETSI NFV-SOL 002 v3.3.1`_ and `ETSI NFV-SOL 003 v3.3.1`_,
it can be used.
For the installation of Prometheus and Alertmanager, please refer to
the `official website`_.
.. note::
Tacker reloads the Prometheus configuration by sending
an HTTP POST request to the ``/-/reload`` endpoint.
Therefore, the Prometheus needs the ``--web.enable-lifecycle`` flag
to be enabled.
Please see `Prometheus CONFIGURATION`_ for details.
How to configure Prometheus Plugin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Prometheus Plugin is disabled by default in Tacker.
For it to work, we need to find ``performance_management`` in
``tacker.conf`` and change its value to ``True``.
.. code-block:: console
$ vi /etc/tacker/tacker.conf
...
[prometheus_plugin]
performance_management = True
[v2_vnfm]
# Enable https access to notification server from Tacker (boolean value)
notification_verify_cert = true
...
After modifying the configuration file, don't forget to restart the
Tacker service to take effect.
.. code-block:: console
$ sudo systemctl stop devstack@tacker
$ sudo systemctl restart devstack@tacker-conductor
$ sudo systemctl start devstack@tacker
How to create a PM job
~~~~~~~~~~~~~~~~~~~~~~
After having a CNF that can scale, we need to create a PM job. It
determines the monitoring metrics and monitoring resources to be
used by Prometheus.
.. note::
When having an NFVO client, the request is sent by NFVO.
The interface for creating PM jobs is defined in both
`ETSI NFV-SOL 002 v3.3.1`_ and `ETSI NFV-SOL 003 v3.3.1`_.
The following are the parameters required by this interface.
.. list-table:: additional params
:widths: 18 18 10 50
:header-rows: 1
* - Attribute name
- Data type
- Cardinality
- Description
* - objectType
- String
- 1
- Type of the measured object. The applicable measured object type for a
measurement is defined in clause 7.2 of `ETSI GS NFV-IFA 027`_.
* - objectInstanceIds
- Identifier
- 1..N
- Identifiers of the measured object instances for which performance
information is requested to be collected.
* - subObjectInstanceIds
- IdentifierInVnf
- 0..N
- Identifiers of the measured object instances in case of a structured
measured object.
* - criteria
- PmJobCriteria
- 1
- Criteria of the collection of performance information.
* - performanceMetric
- String
- 0..N
- This defines the types of performance metrics for the specified object
instances. Valid values are specified as "Measurement Name" values in
clause 7.2 of `ETSI GS NFV-IFA 027`_. At least one of the two
attributes (performance metric or group) shall be present.
* - performanceMetricGroup
- String
- 0..N
- Group of performance metrics. A metric group is a pre-defined list of
metrics, known to the API producer that it can decompose to individual
metrics. Valid values are specified as "Measurement Group" values in
clause 7.2 of `ETSI GS NFV-IFA 027`_. At least one of the two
attributes (performance metric or group) shall be present.
* - collectionPeriod
- UnsignedInt
- 1
- Specifies the periodicity at which the API producer will collect
performance information. The unit shall be seconds.
* - reportingPeriod
- UnsignedInt
- 1
- Specifies the periodicity at which the API producer will report to
the API consumer. about performance information. The unit shall be
seconds. The reportingPeriod should be equal to or a multiple of
the collectionPeriod.
* - reportingBoundary
- DateTime
- 0..1
- Identifies a time boundary after which the reporting will stop. The
boundary shall allow a single reporting as well as periodic reporting
up to the boundary.
* - callbackUri
- Uri
- 1
- The URI of the endpoint to send the notification to.
* - authentication
- SubscriptionAuthentication
- 0..1
- Authentication parameters to configure the use of Authorization when
sending notifications corresponding to this subscription. See as
clause 8.3.4 of `ETSI GS NFV-SOL 013`_.
* - metadata
- Structure
- 1
- Additional parameters to create PM job.
* - monitoring
- Structure
- 1
- Treats to specify such as monitoring system and driver information.
* - monitorName
- String
- 1
- In case specifying “prometheus”, backend of monitoring feature is
to be Prometheus.
* - driverType
- String
- 1
- “external”: SCP/SFTP for config file transfer.
* - targetsInfo
- Structure
- 1..N
- Information about the target monitoring system.
* - prometheusHost
- String
- 1
- FQDN or ip address of target PrometheusServer.
* - prometheusHostPort
- Int
- 1
- Port of the ssh target PrometheusServer.
* - alertRuleConfigPath
- String
- 1
- Path of alertRuleConfig path for target Prometheus.
* - prometheusReloadApiEndpoint
- String
- 1
- Endpoint url of reload API of target Prometheus.
* - authInfo
- Structure
- 1
- Define authentication information to access host.
* - ssh_username
- String
- 1
- The username of the target host for ssh.
* - ssh_password
- String
- 1
- The password of the target host for ssh.
.. note::
* If ``subObjectInstanceIds`` is present, the cardinality of the
``objectInstanceIds`` attribute shall be 1.
* ``performanceMetric`` and ``performanceMetricGroup``, at least one of
the two attributes shall be present.
* ``objectType`` has only the following values: ``Vnf``, ``Vnfc``,
``VnfIntCp``, ``VnfExtCp``.
Create PM job can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm job create sample_param_file.json --os-tacker-api-version 2
The content of the sample ``sample_param_file.json`` in this document is
as follows:
.. code-block:: json
{
"objectType": "Vnf",
"objectInstanceIds": ["a0205e7c-fdeb-4f6c-b266-962246e32626"],
"criteria": {
"performanceMetric": ["VCpuUsageMeanVnf.a0205e7c-fdeb-4f6c-b266-962246e32626"],
"performanceMetricGroup": [],
"collectionPeriod": 30,
"reportingPeriod": 60
},
"callbackUri": "http://127.0.0.1:9990/notification/callbackuri/a0205e7c-fdeb-4f6c-b266-962246e32626",
"metadata": {
"monitoring": {
"monitorName": "prometheus",
"driverType": "external",
"targetsInfo": [
{
"prometheusHost": "192.168.121.35",
"prometheusHostPort": 22,
"authInfo": {
"ssh_username": "vagrant",
"ssh_password": "vagrant"
},
"alertRuleConfigPath":
"/etc/prometheus/rules",
"prometheusReloadApiEndpoint":
"http://192.168.121.35:9090/-/reload"
}
]
}
}
}
Here is an example of create PM job:
.. code-block:: console
$ openstack vnfpm job create sample_param_file.json --os-tacker-api-version 2
+-------------------------+----------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+----------------------------------------------------------------------------------------------------------+
| Callback Uri | http://127.0.0.1:9990/notification/callbackuri/a0205e7c-fdeb-4f6c-b266-962246e32626 |
| Criteria | { |
| | "performanceMetric": [ |
| | "VCpuUsageMeanVnf.a0205e7c-fdeb-4f6c-b266-962246e32626" |
| | ], |
| | "collectionPeriod": 30, |
| | "reportingPeriod": 60 |
| | } |
| ID | 84b227dc-5ed0-411a-aff6-c830528eaec5 |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnfpm/v2/pm_jobs/84b227dc-5ed0-411a-aff6-c830528eaec5" |
| | }, |
| | "objects": [ |
| | { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/a0205e7c-fdeb-4f6c-b266-962246e32626" |
| | } |
| | ] |
| | } |
| Object Instance Ids | [ |
| | "a0205e7c-fdeb-4f6c-b266-962246e32626" |
| | ] |
| Object Type | Vnf |
| Reports | [] |
| Sub Object Instance Ids | |
+-------------------------+----------------------------------------------------------------------------------------------------------+
When creating a PM job, Tacker will modify the configuration file on the
specified Prometheus based on ``metadata``.
Then Prometheus will monitor the specified resource and send the monitored
information to Tacker.
The following is an example of the request body that Prometheus sends
information:
.. code-block:: json
{
"receiver": "receiver",
"status": "firing",
"alerts": [
{
"status": "firing",
"labels": {
"receiver_type": "tacker",
"function_type": "vnfpm",
"job_id": "84b227dc-5ed0-411a-aff6-c830528eaec5",
"metric": "VCpuUsageMeanVnf.a0205e7c-fdeb-4f6c-b266-962246e32626",
"object_instance_id": "a0205e7c-fdeb-4f6c-b266-962246e32626"
},
"annotations": {
"value": 99
},
"startsAt": "2022-06-21T23:47:36.453Z",
"endsAt": "0001-01-01T00:00:00Z",
"generatorURL": "http://192.168.121.35:9090/graph?g0.expr=up%7Bjob%3D%22node%22%7D+%3D%3D+0&g0.tab=1",
"fingerprint": "5ef77f1f8a3ecb8d"
}
],
"groupLabels": {},
"commonLabels": {
"alertname": "NodeInstanceDown",
"job": "node"
},
"commonAnnotations": {
"description": "sample"
},
"externalURL": "http://192.168.121.35:9093",
"version": "4",
"groupKey": "{}:{}",
"truncatedAlerts": 0
}
Tacker converts the received monitoring information into a report and
sends a notification request to NFVO.
The following is the request body of a sample notification request.
.. code-block:: json
{
"id": "29de3afc-0547-4f43-b921-1d6ceaf16bd4",
"notificationType": "PerformanceInformationAvailableNotification",
"timeStamp": "2023-11-20T14:25:04Z",
"pmJobId": "84b227dc-5ed0-411a-aff6-c830528eaec5",
"objectType": "Vnf",
"objectInstanceId": "a0205e7c-fdeb-4f6c-b266-962246e32626",
"_links": {
"objectInstance": {
"href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/a0205e7c-fdeb-4f6c-b266-962246e32626"
},
"pmJob": {
"href": "http://127.0.0.1:9890/vnfpm/v2/pm_jobs/84b227dc-5ed0-411a-aff6-c830528eaec5"
},
"performanceReport": {
"href": "http://127.0.0.1:9890/vnfpm/v2/pm_jobs/84b227dc-5ed0-411a-aff6-c830528eaec5/reports/eab93857-eb72-49ce-9173-628a3f00ba2d"
}
}
}
.. note::
The target URL of this notification request is the ``Callback Uri``
field in the PM job.
How does NFVO Auto Scale CNF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NFVO will send a get PM report request to Tacker according to the URL
of the report in the notification request.
The response returned by Tacker is as follows:
.. code-block:: json
{
"entries": [{
"objectType": "Vnf",
"objectInstanceId": "a0205e7c-fdeb-4f6c-b266-962246e32626",
"performanceMetric": "VCpuUsageMeanVnf.a0205e7c-fdeb-4f6c-b266-962246e32626",
"performanceValues": [{
"timeStamp": "2023-11-20T14:25:04Z",
"value": "1.0002889206831795"
}]
}]
}
NFVO will determine whether a scale operation is required based on
the report data. If needed, a scale request will be sent to Tacker.
How to use the CLI of PM interfaces
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create a PM job
^^^^^^^^^^^^^^^
The creation of PM job has been introduced in the
`How to create a PM job`_ above, and the use case of the CLI
command can be referred to there.
Get all PM jobs
^^^^^^^^^^^^^^^
Get all PM jobs can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm job list --os-tacker-api-version 2
Here is an example of getting all PM jobs:
.. code-block:: console
$ openstack vnfpm job list --os-tacker-api-version 2
+--------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| Id | Object Type | Links |
+--------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| 84b227dc-5ed0-411a-aff6-c830528eaec5 | Vnf | { |
| | | "self": { |
| | | "href": "http://127.0.0.1:9890/vnfpm/v2/pm_jobs/84b227dc-5ed0-411a-aff6-c830528eaec5" |
| | | }, |
| | | "objects": [ |
| | | { |
| | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/a0205e7c-fdeb-4f6c-b266-962246e32626" |
| | | } |
| | | ] |
| | | } |
+--------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
Get the specified PM job
^^^^^^^^^^^^^^^^^^^^^^^^
Get the specified PM job can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm job show JOB_ID --os-tacker-api-version 2
Here is an example of getting the specified PM job:
.. code-block:: console
$ openstack vnfpm job show 84b227dc-5ed0-411a-aff6-c830528eaec5 --os-tacker-api-version 2
+-------------------------+----------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+----------------------------------------------------------------------------------------------------------+
| Callback Uri | http://127.0.0.1:9990/notification/callbackuri/a0205e7c-fdeb-4f6c-b266-962246e32626 |
| Criteria | { |
| | "performanceMetric": [ |
| | "VCpuUsageMeanVnf.a0205e7c-fdeb-4f6c-b266-962246e32626" |
| | ], |
| | "collectionPeriod": 30, |
| | "reportingPeriod": 60 |
| | } |
| ID | 84b227dc-5ed0-411a-aff6-c830528eaec5 |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnfpm/v2/pm_jobs/84b227dc-5ed0-411a-aff6-c830528eaec5" |
| | }, |
| | "objects": [ |
| | { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/a0205e7c-fdeb-4f6c-b266-962246e32626" |
| | } |
| | ] |
| | } |
| Object Instance Ids | [ |
| | "a0205e7c-fdeb-4f6c-b266-962246e32626" |
| | ] |
| Object Type | Vnf |
| Reports | [] |
| Sub Object Instance Ids | |
+-------------------------+----------------------------------------------------------------------------------------------------------+
Change target PM job
^^^^^^^^^^^^^^^^^^^^
Updating a PM job can only change two fields, callbackUri and authentication.
It can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm job update JOB_ID sample_param_file.json --os-tacker-api-version 2
The content of the sample ``sample_param_file.json`` in this document is
as follows:
.. code-block:: json
{
"callbackUri": "http://127.0.0.1:9990/notification/callbackuri/a0205e7c-fdeb-4f6c-b266-962246e32626-update"
}
Here is an example of changing target PM job:
.. code-block:: console
$ openstack vnfpm job update 84b227dc-5ed0-411a-aff6-c830528eaec5 sample_param_file.json --os-tacker-api-version 2
+----------------+--------------------------------------------------------------------------------------------+
| Field | Value |
+----------------+--------------------------------------------------------------------------------------------+
| Authentication | |
| Callback Uri | http://127.0.0.1:9990/notification/callbackuri/a0205e7c-fdeb-4f6c-b266-962246e32626-update |
+----------------+--------------------------------------------------------------------------------------------+
Delete the specified PM job
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Delete the specified PM job can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm job delete JOB_ID --os-tacker-api-version 2
Here is an example of deleting the specified PM job:
.. code-block:: console
$ openstack vnfpm job delete 84b227dc-5ed0-411a-aff6-c830528eaec5 --os-tacker-api-version 2
VNF PM job '84b227dc-5ed0-411a-aff6-c830528eaec5' deleted successfully
Get the specified PM report
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Get the specified PM report can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm report show JOB_ID REPORT_ID --os-tacker-api-version 2
Here is an example of getting the specified PM report:
.. code-block:: console
$ openstack vnfpm report show 84b227dc-5ed0-411a-aff6-c830528eaec5 eab93857-eb72-49ce-9173-628a3f00ba2d --os-tacker-api-version 2
+---------+---------------------------------------------------------------------------------------+
| Field | Value |
+---------+---------------------------------------------------------------------------------------+
| Entries | [ |
| | { |
| | "objectType": "Vnf", |
| | "objectInstanceId": "a0205e7c-fdeb-4f6c-b266-962246e32626", |
| | "performanceMetric": "VCpuUsageMeanVnf.a0205e7c-fdeb-4f6c-b266-962246e32626", |
| | "performanceValues": [ |
| | { |
| | "timeStamp": "2023-11-20T14:25:04Z", |
| | "value": "1.0002889206831795" |
| | } |
| | ] |
| | } |
| | ] |
+---------+---------------------------------------------------------------------------------------+
History of Checks
-----------------
The content of this document has been confirmed to work
using Prometheus 2.45 and Alertmanager 0.26.
.. _ETSI NFV-SOL 002 v3.3.1:
https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/002/03.03.01_60/gs_nfv-sol002v030301p.pdf
.. _ETSI NFV-SOL 003 v3.3.1:
https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/03.03.01_60/gs_nfv-sol003v030301p.pdf
.. _official website: https://prometheus.io/docs/prometheus/latest/getting_started/
.. _Prometheus CONFIGURATION:
https://prometheus.io/docs/prometheus/latest/configuration/configuration
.. _the sample:
https://opendev.org/openstack/tacker/src/branch/master/samples/tests/functional/sol_kubernetes_v2/test_instantiate_cnf_resources
.. _ETSI GS NFV-IFA 027:
https://www.etsi.org/deliver/etsi_gs/NFV-IFA/001_099/027/03.03.01_60/gs_nfv-ifa027v030301p.pdf
.. _ETSI GS NFV-SOL 013:
https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/013/03.04.01_60/gs_nfv-sol013v030401p.pdf

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,566 @@
=========================================================================
ETSI NFV-SOL CNF Auto Scaling With Prometheus via PM Threshold Interfaces
=========================================================================
This document describes how to auto scale CNF in Tacker v2 API with
Prometheus via Performance Management Threshold Interfaces.
Overview
--------
The diagram below shows an overview of the CNF auto scaling.
1. Create PM threshold
The NFVO sends a request to the Tacker to create a PM threshold.
2. Set PM threshold
Prometheus Plugin sets PM threshold to Prometheus.
3. Trigger threshold event
Prometheus collects metrics and decides whether triggering threshold event
is needed or not.
4. POST threshold event
Prometheus sends POST request to Tacker with specified URI. Tacker
collects data related to the PM threshold event.
5. Convert threshold event to threshold state
Tacker receives informed threshold event, converts it to threshold state,
and saves it to DB.
6. Send threshold state notification
VnfPmDriverV2 finds all thresholds in the DB and matches the threshold
state to threshold. If the crossingDirection of threshold state is ``UP``
or ``DOWN``, the notification is sent to the specified path of the NFVO.
If the match is not successful or the situation does not exist, the
processing ends.
7. Scale
Upon receiving a request to scale VNF from NFVO, tacker-server
redirects it to tacker-conductor.
8. Call Kubernetes API
In tacker-conductor, the request is redirected again to an
appropriate infra-driver (in this case Kubernetes infra-driver)
according to the contents of the instantiate parameters. Then,
Kubernetes infra-driver calls Kubernetes APIs.
9. Change the number of Pods
Kubernetes Master change the number of Pods according to the
API calls.
.. figure:: img/auto_scale_pm_th.svg
Prerequisites
-------------
* The following packages should be installed:
* tacker
* python-tackerclient
At least one VNF instance with status of ``INSTANTIATED`` is required.
You can refer to :doc:`/user/v2/cnf/deployment/index` for the
procedure to instantiate VNF.
The VNF Package used can refer to `the sample`_.
* The following third-party services should be installed
* NFVO
* Prometheus(including Alertmanager)
Each operator has its own NFVO, there is no restriction here, as long as
it conforms to `ETSI NFV-SOL 002 v3.3.1`_ and `ETSI NFV-SOL 003 v3.3.1`_,
it can be used.
For the installation of Prometheus and Alertmanager, please refer to
the `official website`_.
How to configure Prometheus Plugin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please refer to ``How to configure Prometheus Plugin``
in :doc:`/user/v2/cnf/auto_scale_pm_job/index` to enable the
Prometheus Plugin.
How to create a PM threshold
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
After having a CNF that can scale, we need to create a PM threshold. It
determines the monitoring metrics and monitoring resources to be
used by Prometheus.
.. note::
When having an NFVO client, the request is sent by NFVO.
The interface for creating PM thresholds is defined in both
`ETSI NFV-SOL 002 v3.3.1`_ and `ETSI NFV-SOL 003 v3.3.1`_.
The following are the parameters required by this interface.
.. list-table:: additional params
:widths: 18 18 10 50
:header-rows: 1
* - Attribute name
- Data type
- Cardinality
- Description
* - objectType
- String
- 1
- Type of the measured object. The applicable measured object type for a
measurement is defined in clause 7.2 of `ETSI GS NFV-IFA 027`_.
* - objectInstanceId
- Identifier
- 1
- Identifiers of the measured object instances for which performance
information is requested to be collected.
* - subObjectInstanceIds
- IdentifierInVnf
- 0..N
- Identifiers of the measured object instances in case of a structured
measured object.
* - criteria
- ThresholdCriteria
- 1
- Criteria of the collection of performance information.
* - performanceMetric
- String
- 1
- This defines the types of performance metrics for the specified object
instances. Valid values are specified as "Measurement Name" values in
clause 7.2 of `ETSI GS NFV-IFA 027`_.
* - thresholdType
- String
- 1
- This defines the type of threshold. This attribute determines which other
attributes are present in the data structure.
* - simpleThresholdDetails
- Structure
- 0..1
- Details of a simple threshold. Shall be present if
thresholdType="SIMPLE".
* - thresholdValue
- Float
- 1
- The threshold value. Shall be represented as a floating point number.
* - hysteresis
- Float
- 1
- The hysteresis of the threshold. Shall be represented as a non-negative
floating point number.
* - callbackUri
- Uri
- 1
- The URI of the endpoint to send the notification to.
* - authentication
- SubscriptionAuthentication
- 0..1
- Authentication parameters to configure the use of Authorization when
sending notifications corresponding to this subscription. See as
clause 8.3.4 of `ETSI GS NFV-SOL 013`_.
* - metadata
- Structure
- 1
- Additional parameters to create PM threshold.
* - monitoring
- Structure
- 1
- Treats to specify such as monitoring system and driver information.
* - monitorName
- String
- 1
- In case specifying "prometheus", backend of monitoring feature is
to be Prometheus.
* - driverType
- String
- 1
- "external": SCP/SFTP for config file transfer.
* - targetsInfo
- Structure
- 1..N
- Information about the target monitoring system.
* - prometheusHost
- String
- 1
- FQDN or ip address of target PrometheusServer.
* - prometheusHostPort
- Int
- 1
- Port of the ssh target PrometheusServer.
* - alertRuleConfigPath
- String
- 1
- Path of alertRuleConfig path for target Prometheus.
* - prometheusReloadApiEndpoint
- String
- 1
- Endpoint url of reload API of target Prometheus.
* - authInfo
- Structure
- 1
- Define authentication information to access host.
* - ssh_username
- String
- 1
- The username of the target host for ssh.
* - ssh_password
- String
- 1
- The password of the target host for ssh.
.. note::
* ``objectType`` has only the following values: ``Vnf``, ``Vnfc``,
``VnfIntCp``, ``VnfExtCp``.
Create PM threshold can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm threshold create sample_param_file.json --os-tacker-api-version 2
The content of the sample ``sample_param_file.json`` in this document is
as follows:
.. code-block:: json
{
"objectType": "Vnf",
"objectInstanceId": "c21fd71b-2866-45f6-89d0-70c458a5c32e",
"criteria": {
"performanceMetric": "VCpuUsageMeanVnf.c21fd71b-2866-45f6-89d0-70c458a5c32e",
"thresholdType": "SIMPLE",
"simpleThresholdDetails": {
"thresholdValue": 1,
"hysteresis": 0.5
}
},
"callbackUri": "http://127.0.0.1:9990/notification/callbackuri/c21fd71b-2866-45f6-89d0-70c458a5c32e",
"metadata": {
"monitoring": {
"monitorName": "prometheus",
"driverType": "external",
"targetsInfo": [
{
"prometheusHost": "192.168.121.35",
"prometheusHostPort": 22,
"authInfo": {
"ssh_username": "vagrant",
"ssh_password": "vagrant"
},
"alertRuleConfigPath":
"/etc/prometheus/rules",
"prometheusReloadApiEndpoint":
"http://192.168.121.35:9090/-/reload"
}
]
}
}
}
.. note::
Tacker reloads the Prometheus configuration by sending
an HTTP POST request to the ``/-/reload`` endpoint.
Therefore, the Prometheus needs the ``--web.enable-lifecycle`` flag
to be enabled.
Please see `Prometheus CONFIGURATION`_ for details.
Here is an example of create PM threshold:
.. code-block:: console
$ openstack vnfpm threshold create sample_param_file.json --os-tacker-api-version 2
+-------------------------+------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+------------------------------------------------------------------------------------------------------+
| Callback Uri | http://127.0.0.1:9990/notification/callbackuri/c21fd71b-2866-45f6-89d0-70c458a5c32e |
| Criteria | { |
| | "performanceMetric": "VCpuUsageMeanVnf.c21fd71b-2866-45f6-89d0-70c458a5c32e", |
| | "thresholdType": "SIMPLE", |
| | "simpleThresholdDetails": { |
| | "thresholdValue": 1.0, |
| | "hysteresis": 0.5 |
| | } |
| | } |
| ID | 135db472-4f7b-4d55-abaf-27a3ab4d7ba1 |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnfpm/v2/thresholds/135db472-4f7b-4d55-abaf-27a3ab4d7ba1" |
| | }, |
| | "object": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/c21fd71b-2866-45f6-89d0-70c458a5c32e" |
| | } |
| | } |
| Object Instance Id | c21fd71b-2866-45f6-89d0-70c458a5c32e |
| Object Type | Vnf |
| Sub Object Instance Ids | |
+-------------------------+------------------------------------------------------------------------------------------------------+
When creating a PM threshold, Tacker will modify the configuration file on the
specified Prometheus based on ``metadata``.
Then Prometheus will monitor the specified resource and send the monitored
information to Tacker.
The following is an example of the request body that Prometheus sends
information:
.. code-block:: json
{
"receiver": "receiver",
"status": "firing",
"alerts": [
{
"status": "firing",
"labels": {
"receiver_type": "tacker",
"function_type": "vnfpm_threshold",
"threshold_id": "135db472-4f7b-4d55-abaf-27a3ab4d7ba1",
"metric": "VCpuUsageMeanVnf.c21fd71b-2866-45f6-89d0-70c458a5c32e",
"object_instance_id": "c21fd71b-2866-45f6-89d0-70c458a5c32e"
},
"annotations": {
"value": 99
},
"startsAt": "2022-12-15T23:47:36.453Z",
"endsAt": "0001-01-01T00:00:00Z",
"generatorURL": "http://192.168.121.35:9090/graph?g0.expr=up%7Bjob%3D%22node%22%7D+%3D%3D+0&g0.tab=1",
"fingerprint": "5ef77f1f8a3ecb8d"
}
],
"groupLabels": {},
"commonLabels": {
"alertname": "NodeInstanceDown",
"job": "node"
},
"commonAnnotations": {
"description": "sample"
},
"externalURL": "http://192.168.121.35:9093",
"version": "4",
"groupKey": "{}:{}",
"truncatedAlerts": 0
}
Tacker converts the received monitoring information into a threshold state and
sends a notification request to NFVO.
The following is the request body of a sample notification request.
.. code-block:: json
{
"id": "0aa6500e-cdee-41f7-aadd-af80f7622ebc",
"notificationType": "ThresholdCrossedNotification",
"timeStamp": "2023-12-06T09:08:06Z",
"thresholdId": "135db472-4f7b-4d55-abaf-27a3ab4d7ba1",
"crossingDirection": "DOWN",
"objectType": "Vnf",
"objectInstanceId": "c21fd71b-2866-45f6-89d0-70c458a5c32e",
"performanceMetric": "VCpuUsageMeanVnf.c21fd71b-2866-45f6-89d0-70c458a5c32e",
"performanceValue": "0.0004428400000000465",
"_links": {
"objectInstance": {
"href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/c21fd71b-2866-45f6-89d0-70c458a5c32e"
},
"threshold": {
"href": "http://127.0.0.1:9890/vnfpm/v2/thresholds/135db472-4f7b-4d55-abaf-27a3ab4d7ba1"
}
}
}
.. note::
The target URL of this notification request is the ``Callback Uri``
field in the PM threshold.
How does NFVO Auto Scale CNF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NFVO will determine whether a scale operation is required based on
the notification data. If needed, a scale request will be sent to Tacker.
How to use the CLI of PM interfaces
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create a PM threshold
^^^^^^^^^^^^^^^^^^^^^
The creation of PM threshold has been introduced in the
`How to create a PM threshold`_ above, and the use case of the CLI
command can be referred to there.
Get all PM thresholds
^^^^^^^^^^^^^^^^^^^^^
Get all PM thresholds can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm threshold list --os-tacker-api-version 2
Here is an example of getting all PM thresholds:
.. code-block:: console
$ openstack vnfpm threshold list --os-tacker-api-version 2
+--------------------------------------+-------------+------------------------------------------------------------------------------------------------------+
| ID | Object Type | Links |
+--------------------------------------+-------------+------------------------------------------------------------------------------------------------------+
| 135db472-4f7b-4d55-abaf-27a3ab4d7ba1 | Vnf | { |
| | | "self": { |
| | | "href": "http://127.0.0.1:9890/vnfpm/v2/thresholds/135db472-4f7b-4d55-abaf-27a3ab4d7ba1" |
| | | }, |
| | | "object": { |
| | | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/c21fd71b-2866-45f6-89d0-70c458a5c32e" |
| | | } |
| | | } |
+--------------------------------------+-------------+------------------------------------------------------------------------------------------------------+
Get the specified PM threshold
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Get the specified PM threshold can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm threshold show THRESHOLD_ID --os-tacker-api-version 2
Here is an example of getting the specified PM threshold:
.. code-block:: console
$ openstack vnfpm threshold show 135db472-4f7b-4d55-abaf-27a3ab4d7ba1 --os-tacker-api-version 2
+-------------------------+------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+------------------------------------------------------------------------------------------------------+
| Callback Uri | http://127.0.0.1:9990/notification/callbackuri/c21fd71b-2866-45f6-89d0-70c458a5c32e |
| Criteria | { |
| | "performanceMetric": "VCpuUsageMeanVnf.c21fd71b-2866-45f6-89d0-70c458a5c32e", |
| | "thresholdType": "SIMPLE", |
| | "simpleThresholdDetails": { |
| | "thresholdValue": 1.0, |
| | "hysteresis": 0.5 |
| | } |
| | } |
| ID | 135db472-4f7b-4d55-abaf-27a3ab4d7ba1 |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnfpm/v2/thresholds/135db472-4f7b-4d55-abaf-27a3ab4d7ba1" |
| | }, |
| | "object": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/c21fd71b-2866-45f6-89d0-70c458a5c32e" |
| | } |
| | } |
| Object Instance Id | c21fd71b-2866-45f6-89d0-70c458a5c32e |
| Object Type | Vnf |
| Sub Object Instance Ids | |
+-------------------------+------------------------------------------------------------------------------------------------------+
Change target PM threshold
^^^^^^^^^^^^^^^^^^^^^^^^^^
Updating a PM threshold can only change two fields, callbackUri and
authentication.
It can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm threshold update THRESHOLD_ID sample_param_file.json --os-tacker-api-version 2
The content of the sample ``sample_param_file.json`` in this document is
as follows:
.. code-block:: json
{
"callbackUri": "http://127.0.0.1:9990/notification/callbackuri/c21fd71b-2866-45f6-89d0-70c458a5c32e-update"
}
Here is an example of changing target PM threshold:
.. code-block:: console
$ openstack vnfpm threshold update 135db472-4f7b-4d55-abaf-27a3ab4d7ba1 sample_param_file.json --os-tacker-api-version 2
+--------------+--------------------------------------------------------------------------------------------+
| Field | Value |
+--------------+--------------------------------------------------------------------------------------------+
| Callback Uri | http://127.0.0.1:9990/notification/callbackuri/c21fd71b-2866-45f6-89d0-70c458a5c32e-update |
+--------------+--------------------------------------------------------------------------------------------+
Delete the specified PM threshold
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Delete the specified PM threshold can be executed by the following CLI command.
.. code-block:: console
$ openstack vnfpm threshold delete THRESHOLD_ID --os-tacker-api-version 2
Here is an example of deleting the specified PM threshold:
.. code-block:: console
$ openstack vnfpm threshold delete 135db472-4f7b-4d55-abaf-27a3ab4d7ba1 --os-tacker-api-version 2
VNF PM threshold '135db472-4f7b-4d55-abaf-27a3ab4d7ba1' deleted successfully
History of Checks
-----------------
The content of this document has been confirmed to work
using Prometheus 2.45 and Alertmanager 0.26.
.. _ETSI NFV-SOL 002 v3.3.1:
https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/002/03.03.01_60/gs_nfv-sol002v030301p.pdf
.. _ETSI NFV-SOL 003 v3.3.1:
https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/03.03.01_60/gs_nfv-sol003v030301p.pdf
.. _official website: https://prometheus.io/docs/prometheus/latest/getting_started/
.. _the sample:
https://opendev.org/openstack/tacker/src/branch/master/samples/tests/functional/sol_kubernetes_v2/test_instantiate_cnf_resources
.. _ETSI GS NFV-IFA 027:
https://www.etsi.org/deliver/etsi_gs/NFV-IFA/001_099/027/03.03.01_60/gs_nfv-ifa027v030301p.pdf
.. _ETSI GS NFV-SOL 013:
https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/013/03.04.01_60/gs_nfv-sol013v030401p.pdf
.. _Prometheus CONFIGURATION:
https://prometheus.io/docs/prometheus/latest/configuration/configuration

View File

@ -1,25 +1,25 @@
@startuml
frame "python-tackerclient" {
component "tacker-client" as client
component "tacker-client" as client
}
frame "tacker" {
component "tacker-server" {
component "server" as serv
}
component "tacker-conductor" {
component "conductor" as cond
component "Kubernetes\ninfra-driver" as infra
}
component "tacker-server" {
component "server" as serv
}
component "tacker-conductor" {
component "conductor" as cond
component "Kubernetes\ninfra-driver" as infra
}
}
node "Kubernetes\nCluster\n(Master)" as k8s_m
cloud "Hardware Resources" as hw {
node "Kubernetes\nCluster\n(Worker)" as k8s_w {
node "Deployment" as ins1
node "Deployment" as ins2
}
node "Kubernetes\nCluster\n(Worker)" as k8s_w {
node "Deployment" as ins1
node "Deployment" as ins2
}
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -2,7 +2,9 @@
ETSI NFV-SOL CNF Change Current VNF Package
===========================================
This document describes how to change current VNF package for CNF in Tacker.
This document describes how to change current VNF package for CNF
in Tacker v2 API.
Overview
--------
@ -12,14 +14,14 @@ The diagram below shows an overview of changing current VNF package.
1. Request Change Current VNF Package
A user requests tacker-server to change current VNF package for VNF instance
with tacker-client by requesting ``change current vnf package``.
with tacker-client by requesting ``change current VNF package``.
2. Call Kubernetes API
Upon receiving a request from tacker-client, tacker-server redirects it to
tacker-conductor. In tacker-conductor, the request is redirected again to
tacker-conductor. In tacker-conductor, the request is redirected again to
an appropriate infra-driver (in this case Kubernetes infra-driver) according
to the contents of VNF instance. Then, Kubernetes infra-driver calls
to the contents of VNF instance. Then, Kubernetes infra-driver calls
Kubernetes APIs.
3. Change the image of Container defined in the manifest file of Deployment
@ -27,8 +29,9 @@ The diagram below shows an overview of changing current VNF package.
Kubernetes Master update the image of Container defined in the manifest
file of Deployment according to the API calls.
.. figure:: ../_images/etsi_cnf_change_current_vnf_package.png
:align: left
.. figure:: img/chg_vnfpkg.svg
Prerequisites
-------------
@ -39,10 +42,10 @@ The following packages should be installed:
* python-tackerclient
At least one VNF instance with status of ``INSTANTIATED`` is required.
You can refer to :doc:`./etsi_containerized_vnf_usage_guide` for the
You can refer to :doc:`/user/v2/cnf/deployment/index` for the
procedure to instantiate VNF.
You can also refer to :doc:`./vnf-package` for the operation of uploading
You can also refer to :doc:`/user/vnf-package` for the operation of uploading
VNF package.
The sample packages for CNF can be obtained from the following links.
@ -58,10 +61,10 @@ As mentioned in Prerequisites, the VNF must be created
before performing change current VNF package.
You need to upload the VNF package you want to change to before
executing change current vnf package.
executing change current VNF package.
Details of CLI commands are described in
:doc:`../cli/cli-etsi-vnflcm`.
:doc:`/cli/cli-etsi-vnflcm`.
For changing current VNF package, you need to prepare a JSON-formatted
definition file before running command for changing the VNF package.
@ -74,7 +77,10 @@ definition file before running command for changing the VNF package.
"vnfdId": "c6595341-a5bb-8246-53c4-7aeb843d60c5",
"additionalParams": {
"upgrade_type": "RollingUpdate",
"lcm-kubernetes-def-files": ["Files/new_kubernetes/new_deployment.yaml"],
"lcm-kubernetes-def-files": [
"Files/kubernetes/namespace.yaml",
"Files/new_kubernetes/new_deployment.yaml"
],
"vdu_params": [{
"vdu_id": "VDU2"
}]
@ -103,11 +109,13 @@ definition file before running command for changing the VNF package.
}
.. note::
Unlike Change Current Vnf Package for VNF,
Unlike Change Current VNF Package for VNF,
coordination scripts are not supported for CNF.
Therefore, lcm-operation-coordinate files need not be
specified by ``additionalParams``.
You can set following parameter in additionalParams:
.. list-table:: additionalParams
@ -130,7 +138,9 @@ You can set following parameter in additionalParams:
- 1
- VDU name of target VDU to update.
.. note::
``sample_param_file_for_specified_resources.json`` contains
all optional parameters.
@ -152,16 +162,16 @@ You can set following parameter in additionalParams:
current values.
For ``metadata``, the value set before this operation is maintained.
.. note::
Currently, this operation only supports some functions of
``Change Current VNF Package``.
* There are several ways to update deployment, but Bobcat version Tacker only
supports ``RollingUpdate`` type. You can set it via ``upgrade_type``
param.
* Currently only support update images of deployment.
* Currently unsupported updates:
* This API currently does not support increasing or decreasing the number
@ -203,12 +213,14 @@ Deployment information before operation:
$ kubectl get deployment -o wide -n curry
Result:
.. code-block:: console
NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
vdu2 2/2 2 2 20s nginx nginx app=webserver
NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
vdu2 2/2 2 2 6m40s nginx nginx app=webserver
Deployment detailed information before operation:
@ -216,13 +228,14 @@ Deployment detailed information before operation:
$ kubectl describe deployment vdu2 -n curry
Result:
.. code-block:: console
Name: vdu2
Namespace: curry
CreationTimestamp: Tue, 22 Mar 2022 03:04:03 +0000
CreationTimestamp: Thu, 07 Dec 2023 01:22:43 +0000
Labels: <none>
Annotations: deployment.kubernetes.io/revision: 1
Selector: app=webserver
@ -250,11 +263,12 @@ Result:
Available True MinimumReplicasAvailable
Progressing True NewReplicaSetAvailable
OldReplicaSets: <none>
NewReplicaSet: vdu2-674d7d8766 (2/2 replicas created)
NewReplicaSet: vdu2-749bb6cbbf (2/2 replicas created)
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ScalingReplicaSet 37s deployment-controller Scaled up replica set vdu2-674d7d8766 to 2
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ScalingReplicaSet 7m21s deployment-controller Scaled up replica set vdu2-749bb6cbbf to 2
Pods information before operation:
@ -267,24 +281,26 @@ Result:
.. code-block:: console
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
vdu2-674d7d8766-8mcb6 1/1 Running 0 72s 10.233.96.15 node2 <none> <none>
vdu2-674d7d8766-tmlhd 1/1 Running 0 72s 10.233.96.14 node2 <none> <none>
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
vdu2-749bb6cbbf-dcjpn 1/1 Running 0 9m11s 10.0.0.98 vagrant <none> <none>
vdu2-749bb6cbbf-hmsbh 1/1 Running 0 9m11s 10.0.0.116 vagrant <none> <none>
Change Current VNF Package execution of the entire VNF:
.. code-block:: console
$ openstack vnflcm change-vnfpkg VNF_INSTANCE_ID \
./sample_param_file_for_specified_resources.json \
--os-tacker-api-version 2
./sample_param_file_for_specified_resources.json \
--os-tacker-api-version 2
Result:
.. code-block:: console
Change Current VNF Package for VNF Instance f9bb1ad5-2e30-4074-86d9-3da3a636601a has been accepted.
Change Current VNF Package for VNF Instance 63936f24-d43c-42d9-b38d-3c8eff85c445 has been accepted.
Deployment information after operation:
@ -292,12 +308,14 @@ Deployment information after operation:
$ kubectl get deployment -o wide -n curry
Result:
.. code-block:: console
NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
vdu2 2/2 2 2 6m23s nginx nginx:alpine app=webserver
NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
vdu2 2/2 2 2 13m nginx nginx:alpine app=webserver
Deployment detailed information after operation:
@ -305,13 +323,14 @@ Deployment detailed information after operation:
$ kubectl describe deployment vdu2 -n curry
Result:
.. code-block:: console
Name: vdu2
Namespace: curry
CreationTimestamp: Tue, 22 Mar 2022 03:04:03 +0000
CreationTimestamp: Thu, 07 Dec 2023 01:22:43 +0000
Labels: <none>
Annotations: deployment.kubernetes.io/revision: 2
Selector: app=webserver
@ -339,40 +358,61 @@ Result:
Available True MinimumReplicasAvailable
Progressing True NewReplicaSetAvailable
OldReplicaSets: <none>
NewReplicaSet: vdu2-6696c74f5c (2/2 replicas created)
NewReplicaSet: vdu2-8556bbb5d8 (2/2 replicas created)
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ScalingReplicaSet 6m46s deployment-controller Scaled up replica set vdu2-674d7d8766 to 2
Normal ScalingReplicaSet 78s deployment-controller Scaled up replica set vdu2-6696c74f5c to 1
Normal ScalingReplicaSet 67s deployment-controller Scaled down replica set vdu2-674d7d8766 to 1
Normal ScalingReplicaSet 67s deployment-controller Scaled up replica set vdu2-6696c74f5c to 2
Normal ScalingReplicaSet 55s deployment-controller Scaled down replica set vdu2-674d7d8766 to 0
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ScalingReplicaSet 14m deployment-controller Scaled up replica set vdu2-749bb6cbbf to 2
Normal ScalingReplicaSet 104s deployment-controller Scaled up replica set vdu2-8556bbb5d8 to 1
Normal ScalingReplicaSet 91s deployment-controller Scaled down replica set vdu2-749bb6cbbf to 1 from 2
Normal ScalingReplicaSet 91s deployment-controller Scaled up replica set vdu2-8556bbb5d8 to 2 from 1
Normal ScalingReplicaSet 83s deployment-controller Scaled down replica set vdu2-749bb6cbbf to 0 from 1
.. note::
``image`` has changed from ``nginx`` to ``nginx:alpine``.
The age of deployment ``vdu2`` has not been reset, so deployment ``vdu2``
has not redeployed.
Pods information after operation:
.. code-block:: console
$ kubectl get pods -o wide -n curry
Result:
.. code-block:: console
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
vdu2-6696c74f5c-9xwvv 1/1 Running 0 114s 10.233.96.17 node2 <none> <none>
vdu2-6696c74f5c-kgtjt 1/1 Running 0 2m5s 10.233.96.16 node2 <none> <none>
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
vdu2-8556bbb5d8-2wvxj 1/1 Running 0 3m57s 10.0.0.76 vagrant <none> <none>
vdu2-8556bbb5d8-tj4vx 1/1 Running 0 3m44s 10.0.0.120 vagrant <none> <none>
.. note::
``name`` of pods has changed before and after operation.
The age of pods under deployment has been reset, so pods under
this deployment has redeployed before and after operation.
.. _VNF Package for Common instantiate: https://opendev.org/openstack/tacker/src/branch/master/samples/tests/functional/sol_kubernetes_v2/test_instantiate_cnf_resources/contents
.. _VNF Package for Change Current VNF Package: https://opendev.org/openstack/tacker/src/branch/master/samples/tests/functional/sol_kubernetes_v2/test_change_vnf_pkg_with_deployment/contents
.. _ETSI SOL002 v3.5.1: https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/002/03.05.01_60/gs_nfv-sol002v030501p.pdf
History of Checks
-----------------
The content of this document has been confirmed to work
using the following VNF Packages.
* `test_instantiate_cnf_resources for 2023.2 Bobcat`_
* `test_change_vnf_pkg_with_deployment for 2023.2 Bobcat`_
.. _VNF Package for Common instantiate:
https://opendev.org/openstack/tacker/src/branch/master/samples/tests/functional/sol_kubernetes_v2/test_instantiate_cnf_resources/contents
.. _VNF Package for Change Current VNF Package:
https://opendev.org/openstack/tacker/src/branch/master/samples/tests/functional/sol_kubernetes_v2/test_change_vnf_pkg_with_deployment/contents
.. _test_instantiate_cnf_resources for 2023.2 Bobcat:
https://opendev.org/openstack/tacker/src/branch/stable/2023.2/tacker/tests/functional/sol_kubernetes_v2/samples/test_instantiate_cnf_resources
.. _test_change_vnf_pkg_with_deployment for 2023.2 Bobcat:
https://opendev.org/openstack/tacker/src/branch/stable/2023.2/tacker/tests/functional/sol_kubernetes_v2/samples/test_change_vnf_pkg_with_deployment

View File

@ -0,0 +1,38 @@
@startuml
frame "python-tackerclient" {
component "tacker-client" as client {
package "VNF Package" as vnfpkg {
file "VNFD" as vnfd
file "CNF\nDefinition" as cnfd
}
file "Instantiate\nparameters" as inst_param
}
}
frame "tacker" {
component "tacker-server" {
component "server" as serv
}
component "tacker-conductor" {
component "conductor" as cond
component "Kubernetes\ninfra-driver" as infra
}
}
node "Kubernetes\nCluster\n(Master)" as k8s_m
cloud "Hardware Resources" as hw {
node "Kubernetes\nCluster\n(Worker)" as k8s_w {
node "Pod" as ins1
}
}
'# Relationships
vnfpkg --> serv: 1. Request\n create VNF
inst_param --> serv: 2. Request\n instantiate VNF
serv --> cond
cond --> infra
infra -right-> k8s_m: 3. Call Kubernetes\n API
k8s_m --> ins1: 4. Create a Pod
@enduml

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 16 KiB

File diff suppressed because it is too large Load Diff

View File

@ -2,12 +2,12 @@
frame "python-tackerclient" {
component "tacker-client" as client {
package "VNF Package" as vnfpkg {
file "VNFD" as vnfd
file "CNF\nDefinition" as cnfd
package "VNF Package" as vnfpkg {
file "VNFD" as vnfd
file "CNF\nDefinition" as cnfd
}
file "Instantiate\nparameters" as inst_param
}
file "Instantiate\nparameters" as inst_param
}
}
frame "tacker" {

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 18 KiB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,35 @@
@startuml
frame "python-tackerclient" {
component "tacker-client" as client
}
frame "tacker" {
component "tacker-server" {
component "server" as serv
}
component "tacker-conductor" {
component "conductor" as cond
component "Kubernetes\ninfra-driver" as infra
}
}
node "Kubernetes\nCluster\n(Master)" as k8s_m
cloud "Hardware Resources" as hw {
node "Kubernetes\nCluster\n(Worker)" as k8s_w {
node "Pod" as ins1
node "Pod" as ins2
}
}
'# Relationships
client --> serv: 1. Request\n heal VNF
serv --> cond
cond --> infra
infra -right-> k8s_m: 2. Call Kubernetes\n API
k8s_m --> ins1: 3. Re-create Pods
k8s_m --> ins2
ins1 -[hidden]right-> ins2
@enduml

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,259 @@
========================
ETSI NFV-SOL CNF Healing
========================
This document describes how to heal CNF in Tacker v2 API.
Overview
--------
The diagram below shows an overview of the CNF healing.
1. Request heal VNF
A user requests tacker-server to heal a VNF or all VNFs with tacker-client
by requesting ``heal VNF``.
2. Call Kubernetes API
Upon receiving a request from tacker-client, tacker-server redirects it to
tacker-conductor. In tacker-conductor, the request is redirected again to
an appropriate infra-driver (in this case Kubernetes infra-driver) according
to the contents of the instantiate parameters. Then, Kubernetes
infra-driver calls Kubernetes APIs.
3. Re-create Pods
Kubernetes Master re-creates Pods according to the API calls.
.. figure:: img/heal.svg
Prerequisites
-------------
The following packages should be installed:
* tacker
* python-tackerclient
Execute up to "Instantiate VNF" in the procedure of
:doc:`/user/v2/cnf/deployment/index`.
In other words, the procedure after "Terminate VNF" is not executed.
CNF Healing Procedure
---------------------
As mentioned in Prerequisites and Healing target VNF instance, the VNF must be
instantiated before healing.
Details of CLI commands are described in :doc:`/cli/cli-etsi-vnflcm`.
There are two main methods for CNF healing.
* Healing of the entire VNF
Heal entire VNF instance by termination and instantiation of the VNF.
* Healing specified with VNFC instances
Heal Pod (mapped as VNFC) that is singleton or created using controller
resources of Kubernetes such as Deployment, DaemonSet, StatefulSet and
ReplicaSet.
.. note::
A VNFC is a 'VNF Component', and one VNFC basically corresponds to
one VDU in the VNF. For more information on VNFC, see `NFV-SOL002 v3.3.1`_.
.. _Healing Target VNF Instance:
Healing Target VNF Instance
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Assuming that the following VNF instance exists,
this instance will be healed.
.. code-block:: console
$ openstack vnflcm show VNF_INSTANCE_ID --os-tacker-api-version 2 \
-f json | jq .'["Instantiated Vnf Info"]'.vnfcInfo
Result:
.. code-block:: console
[
{
"id": "VDU1-vdu1-749bb6cbbf-dcjpn",
"vduId": "VDU1",
"vnfcResourceInfoId": "vdu1-749bb6cbbf-dcjpn",
"vnfcState": "STARTED"
},
{
"id": "VDU1-vdu1-749bb6cbbf-hmsbh",
"vduId": "VDU1",
"vnfcResourceInfoId": "vdu1-749bb6cbbf-hmsbh",
"vnfcState": "STARTED"
}
]
How to Heal of the Entire VNF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Execute Heal of the entire CNF with CLI command and check the name and age of
pod information before and after healing.
This is to confirm that the name has changed and age has been new after heal.
Pod information before heal:
.. code-block:: console
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
vdu1-749bb6cbbf-dcjpn 1/1 Running 0 7h38m
vdu1-749bb6cbbf-hmsbh 1/1 Running 0 7h38m
Heal entire VNF can be executed by the following CLI command.
.. code-block:: console
$ openstack vnflcm heal VNF_INSTANCE_ID --os-tacker-api-version 2
Result:
.. code-block:: console
Heal request for VNF Instance 431b94b5-d7ba-4d1c-aa26-ecec65d7ee53 has been accepted.
Pod information after heal:
.. code-block:: console
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
vdu1-749bb6cbbf-jgjq9 1/1 Running 0 31s
vdu1-749bb6cbbf-tj4vx 1/1 Running 0 31s
All ``vnfcResourceInfo`` in ``Instantiated Vnf Info`` will be updated from
the VNF Instance displayed in :ref:`Healing Target VNF Instance`.
.. code-block:: console
$ openstack vnflcm show VNF_INSTANCE_ID --os-tacker-api-version 2 \
-f json | jq .'["Instantiated Vnf Info"]'.vnfcInfo
Result:
.. code-block:: console
[
{
"id": "VDU1-vdu1-749bb6cbbf-jgjq9",
"vduId": "VDU1",
"vnfcResourceInfoId": "vdu1-749bb6cbbf-jgjq9",
"vnfcState": "STARTED"
},
{
"id": "VDU1-vdu1-749bb6cbbf-tj4vx",
"vduId": "VDU1",
"vnfcResourceInfoId": "vdu1-749bb6cbbf-tj4vx",
"vnfcState": "STARTED"
}
]
How to Heal Specified with VNFC Instances
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Execute Heal of the partial CNF CLI command and check the name and age of pod
information before and after healing.
This is to confirm that the name has changed and age has been new after heal.
Pod information before heal:
.. code-block:: console
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
vdu1-749bb6cbbf-jgjq9 1/1 Running 0 31s
vdu1-749bb6cbbf-tj4vx 1/1 Running 0 31s
Heal specified with VNFC instances can be executed by running
:command:`openstack vnflcm heal VNF_INSTANCE_ID --vnfc-instance VNFC_INSTANCE_ID`.
.. note::
``VNFC_INSTANCE_ID`` is ``instantiatedVnfInfo.vnfcInfo.id``.
.. code-block:: console
$ openstack vnflcm heal VNF_INSTANCE_ID --vnfc-instance VNFC_INSTANCE_ID \
--os-tacker-api-version 2
Result:
.. code-block:: console
Heal request for VNF Instance 431b94b5-d7ba-4d1c-aa26-ecec65d7ee53 has been accepted.
Pod information after heal:
.. code-block:: console
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
vdu1-749bb6cbbf-6mbsl 1/1 Running 0 86s
vdu1-749bb6cbbf-tj4vx 1/1 Running 0 9m59s
.. code-block:: console
$ openstack vnflcm show VNF_INSTANCE_ID --os-tacker-api-version 2 \
-f json | jq .'["Instantiated Vnf Info"]'.vnfcInfo
Result:
.. code-block:: console
[
{
"id": "VDU1-vdu1-749bb6cbbf-6mbsl",
"vduId": "VDU1",
"vnfcResourceInfoId": "vdu1-749bb6cbbf-6mbsl",
"vnfcState": "STARTED"
},
{
"id": "VDU1-vdu1-749bb6cbbf-tj4vx",
"vduId": "VDU1",
"vnfcResourceInfoId": "vdu1-749bb6cbbf-tj4vx",
"vnfcState": "STARTED"
}
]
History of Checks
-----------------
The content of this document has been confirmed to work
using the following VNF Package.
* `test_instantiate_cnf_resources for 2023.2 Bobcat`_
.. _NFV-SOL002 v3.3.1: https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/002/03.03.01_60/gs_nfv-sol002v030301p.pdf
.. _test_instantiate_cnf_resources for 2023.2 Bobcat:
https://opendev.org/openstack/tacker/src/branch/stable/2023.2/tacker/tests/functional/sol_kubernetes_v2/samples/test_instantiate_cnf_resources

View File

@ -0,0 +1,34 @@
@startuml
frame "python-tackerclient" {
component "tacker-client" as client
}
frame "tacker" {
component "tacker-server" {
component "server" as serv
}
component "tacker-conductor" {
component "conductor" as cond
component "Kubernetes\ninfra-driver" as infra
}
}
node "Kubernetes\nCluster\n(Master)" as k8s_m
cloud "Hardware Resources" as hw {
node "Kubernetes\nCluster\n(Worker)" as k8s_w {
node "Pod" as ins1
node "Pod" as ins2
}
}
'# Relationships
client --> serv: 1. Request\n scale VNF
serv --> cond
cond --> infra
infra -right-> k8s_m: 2. Call Kubernetes\n API
k8s_m --> ins1: 3. Change the\n number of\n Pods
ins1 -[hidden]right-> ins2
@enduml

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,250 @@
========================
ETSI NFV-SOL CNF Scaling
========================
This document describes how to scale CNF in Tacker v2 API.
Overview
--------
The diagram below shows an overview of the CNF scaling.
1. Request scale VNF
A user requests tacker-server to scale a VNF or all VNFs with tacker-client
by requesting ``scale VNF``.
2. Call Kubernetes API
Upon receiving a request from tacker-client, tacker-server redirects it to
tacker-conductor. In tacker-conductor, the request is redirected again to
an appropriate infra-driver (in this case Kubernetes infra-driver) according
to the contents of the instantiate parameters. Then, Kubernetes
infra-driver calls Kubernetes APIs.
3. Change the number of Pods
Kubernetes Master change the number of Pods according to the API calls.
.. figure:: img/scale.svg
Prerequisites
-------------
The following packages should be installed:
* tacker
* python-tackerclient
Execute up to "Instantiate VNF" in the procedure of
:doc:`/user/v2/cnf/deployment/index`.
In other words, the procedure after "Terminate VNF" is not executed.
CNF Scaling Procedure
---------------------
As mentioned in Prerequisites, the VNF must be instantiated before performing
scaling.
Users can scale the number of pod replicas managed by controller resources such
as Kubernetes Deployment, StatefulSet, and ReplicaSet.
.. note::
If kind is Stateful Set and not dynamic provisioning (no-provisioner),
user must create the Persistent Volume for the maximum replicas
in advance because the increased Persistent Volume is not created
during the scale out operation.
Details of CLI commands are described in :doc:`/cli/cli-etsi-vnflcm`.
There are two main methods for CNF scaling.
* Scale out CNF
* Scale in CNF
How to Identify ASPECT_ID
~~~~~~~~~~~~~~~~~~~~~~~~~
In order to execute scaling, it is necessary to specify ``ASPECT_ID``, which is
the ID for the target scaling group.
First, the method of specifying the ID will be described.
``ASPECT_ID`` is described in VNFD included in the VNF Package.
In the following VNFD excerpt, **vdu1_aspect** corresponds to ``ASPECT_ID``.
.. code-block:: yaml
node_templates:
VNF:
type: company.provider.VNF
properties:
flavour_description: A simple flavour
VDU1:
type: tosca.nodes.nfv.Vdu.Compute
properties:
name: vdu1
description: VDU1 compute node
vdu_profile:
min_number_of_instances: 1
max_number_of_instances: 3
policies:
- scaling_aspects:
type: tosca.policies.nfv.ScalingAspects
properties:
aspects:
vdu1_aspect:
name: vdu1_aspect
description: vdu1 scaling aspect
max_scale_level: 2
step_deltas:
- delta_1
- VDU1_initial_delta:
type: tosca.policies.nfv.VduInitialDelta
properties:
initial_delta:
number_of_instances: 2
targets: [ VDU1 ]
- VDU1_scaling_aspect_deltas:
type: tosca.policies.nfv.VduScalingAspectDeltas
properties:
aspect: vdu1_aspect
deltas:
delta_1:
number_of_instances: 1
targets: [ VDU1 ]
- instantiation_levels:
type: tosca.policies.nfv.InstantiationLevels
properties:
levels:
instantiation_level_1:
description: Smallest size
scale_info:
vdu1_aspect:
scale_level: 1
instantiation_level_2:
description: Largest size
scale_info:
vdu1_aspect:
scale_level: 2
default_level: instantiation_level_1
- VDU1_instantiation_levels:
type: tosca.policies.nfv.VduInstantiationLevels
properties:
levels:
instantiation_level_1:
number_of_instances: 2
instantiation_level_2:
number_of_instances: 3
targets: [ VDU1 ]
.. note::
See `NFV-SOL001 v2.6.1`_ annex A.6 for details about ``ASPECT_ID``.
How to Scale Out CNF
~~~~~~~~~~~~~~~~~~~~
Execute Scale CLI command and check the number of replicas before and after
scaling.
This is to confirm that the number of replicas has increased after Scale-out.
An example using deployment is described.
Replicas information before scale-out:
.. code-block:: console
$ kubectl get deployment
NAME READY UP-TO-DATE AVAILABLE AGE
vdu1 2/2 2 2 7h4m
Scale-out CNF can be executed by the following CLI command.
.. code-block:: console
$ openstack vnflcm scale --type SCALE_OUT --aspect-id ASPECT_ID \
VNF_INSTANCE_ID --os-tacker-api-version 2
Result:
.. code-block:: console
Scale request for VNF Instance 431b94b5-d7ba-4d1c-aa26-ecec65d7ee53 has been accepted.
Replicas information after scale-out:
.. code-block:: console
$ kubectl get deployment
NAME READY UP-TO-DATE AVAILABLE AGE
vdu1 3/3 3 3 7h8m
How to Scale in CNF
~~~~~~~~~~~~~~~~~~~
Execute Scale CLI command and check the number of replicas before and after
scaling.
This is to confirm that the number of replicas has increased after Scale-in.
An example using deployment is described.
Replicas information before scale-out:
.. code-block:: console
$ kubectl get deployment
NAME READY UP-TO-DATE AVAILABLE AGE
vdu1 3/3 3 3 7h8m
Scale-in VNF can be executed by the following CLI command.
.. code-block:: console
$ openstack vnflcm scale --type SCALE_IN --aspect-id ASPECT_ID \
VNF_INSTANCE_ID --os-tacker-api-version 2
Result:
.. code-block:: console
Scale request for VNF Instance 431b94b5-d7ba-4d1c-aa26-ecec65d7ee53 has been accepted.
Replicas information after scale-in:
.. code-block:: console
$ kubectl get deployment
NAME READY UP-TO-DATE AVAILABLE AGE
vdu1 2/2 2 2 7h12m
History of Checks
-----------------
The content of this document has been confirmed to work
using the following VNF Package.
* `test_instantiate_cnf_resources for 2023.2 Bobcat`_
.. _NFV-SOL001 v2.6.1: https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/001/02.06.01_60/gs_NFV-SOL001v020601p.pdf
.. _test_instantiate_cnf_resources for 2023.2 Bobcat:
https://opendev.org/openstack/tacker/src/branch/stable/2023.2/tacker/tests/functional/sol_kubernetes_v2/samples/test_instantiate_cnf_resources

View File

@ -3,9 +3,10 @@ ETSI NFV-SOL CNF Update
=======================
This document describes how to update CNF in Tacker.
Please refer to the :doc:`./mgmt_driver_for_container_update`
Please refer to the :doc:`/user/v2/cnf/update_with_mgmt_driver/index`
for how to update CNF with Mgmt Driver in Tacker.
Prerequisites
-------------
@ -14,11 +15,8 @@ The following packages should be installed:
* tacker
* python-tackerclient
The procedure of prepare for scaling operation that from "register VIM" to
"Instantiate VNF", basically refer to
:doc:`./etsi_containerized_vnf_usage_guide`.
This procedure uses an example using the sample VNF package.
Execute up to "Create VNF" of "Instantiate VNF" in the procedure of
:doc:`/user/v2/cnf/deployment/index`.
CNF Update Procedures
@ -28,7 +26,7 @@ As mentioned in Prerequisites, the CNF must be created
before performing update.
Details of CLI commands are described in
:doc:`../cli/cli-etsi-vnflcm`.
:doc:`/cli/cli-etsi-vnflcm`.
For update VNF instance, you need to prepare a JSON-formatted definition file.
@ -38,19 +36,25 @@ For update VNF instance, you need to prepare a JSON-formatted definition file.
"vnfInstanceName": "sample"
}
.. note::
sample_param_file.json contains the VNF name as an example.
For v1 update operation, the following attributes of
``VnfInfoModificationRequest`` are not supported.
.. note::
sample_param_file.json contains the VNF name as an example.
The Update operation can update the following.
* vnfInstanceName
* vnfInstanceDescription
* vnfId
* vnfConfigurableProperties
* metadata
* extensions
* vnfcInfoModifications
* vimConnectionInfo
.. note::
The v2 update operation can change the ``vimConnectionInfo``
The update operation can change the ``vimConnectionInfo``
associated with an existing VNF instance.
Even if update operation specify multiple ``vimConnectionInfo``
associated with one VNF instance, only one of them will be used for life
@ -69,7 +73,8 @@ VNF instance name before update:
.. code-block:: console
$ openstack vnflcm show VNF_INSTANCE_ID -c 'VNF Instance Name'
$ openstack vnflcm show VNF_INSTANCE_ID -c 'VNF Instance Name' \
--os-tacker-api-version 2
Result:
@ -79,7 +84,7 @@ Result:
+-------------------+-------+
| Field | Value |
+-------------------+-------+
| VNF Instance Name | None |
| VNF Instance Name | |
+-------------------+-------+
@ -87,16 +92,19 @@ Update VNF can be executed by the following CLI command.
.. code-block:: console
$ openstack vnflcm update VNF_INSTANCE_ID --I sample_param_file.json
$ openstack vnflcm update VNF_INSTANCE_ID --I sample_param_file.json \
--os-tacker-api-version 2
Result:
.. code-block:: console
Update vnf:c64ea0fd-a90c-4754-95f4-dc0751db519d
Update vnf:431b94b5-d7ba-4d1c-aa26-ecec65d7ee53
.. note::
Create a parameter file that describes the resource information to be
changed in advance.
@ -105,24 +113,24 @@ VNF instance name after operation:
.. code-block:: console
$ openstack vnflcm show VNF_INSTANCE_ID -c 'VNF Instance Name'
$ openstack vnflcm show VNF_INSTANCE_ID -c 'VNF Instance Name' \
--os-tacker-api-version 2
Result:
.. code-block:: console
+-------------------+---------+
| Field | Value |
+-------------------+---------+
| VNF Instance Name | sample |
+-------------------+---------+
+-------------------+--------+
| Field | Value |
+-------------------+--------+
| VNF Instance Name | sample |
+-------------------+--------+
You can confirm that the VNF Instance Name has been changed by the update
operation.
If the ``vnfdId`` is not changed by update operation, the current value
shall be updated using the request parameter.
The following attributes are updated by performing JSON Merge Patch with the
@ -132,7 +140,7 @@ values set in the request parameter to the current values.
* metadata
* extensions
If the ``vnfdId`` is requested to be changed by v1 update operation, the
If the ``vnfdId`` is requested to be changed by update operation, the
following attributes of VNF instance shall be updated in addition to those
set in the request parameters.
These are updated with the values obtained from the VNFD associated with the
@ -144,8 +152,22 @@ new vnfdId.
* vnfdVersion
.. note::
In the v2 update operation for CNF, if "Scale" or "Heal" is performed
In the update operation for CNF, if "Scale" or "Heal" is performed
after updating ``vnfdId``, the VNF package associated with the
``vnfdId before the update`` shall be used.
Therefore, in order to maintain the update of ``vnfdId``, it is necessary to
execute "Terminate VNF" once and then "Instantiate VNF".
History of Checks
-----------------
The content of this document has been confirmed to work
using the following VNF Package.
* `test_instantiate_cnf_resources for 2023.2 Bobcat`_
.. _test_instantiate_cnf_resources for 2023.2 Bobcat:
https://opendev.org/openstack/tacker/src/branch/stable/2023.2/tacker/tests/functional/sol_kubernetes_v2/samples/test_instantiate_cnf_resources

View File

@ -0,0 +1,40 @@
@startuml
frame "python-tackerclient" {
component "tacker-client" as client
}
frame "tacker" {
component "tacker-server" {
component "server" as serv
}
component "tacker-conductor" {
component "conductor" as cond
component "mgmt-driver" as infra
}
}
node "Kubernetes\nCluster\n(Master)" as k8s_m
cloud "Hardware Resources" as hw {
node "Kubernetes\nCluster\n(Worker)" as k8s_w {
node "ConfigMap" as ins1
node "Secret" as ins2
node "Pod" as ins3
node "Deployment" as ins4
}
}
'# Relationships
client --> serv: 1. Request\n update VNF
serv --> cond
cond --> infra
infra -right-> k8s_m: 2. Call Kubernetes\n API
k8s_m --> ins1
k8s_m --> ins2: 3. Update the\n deployed resources
k8s_m --> ins3
k8s_m --> ins4
ins1 -[hidden]right-> ins2
ins2 -[hidden]right-> ins3
ins3 -[hidden]right-> ins4
@enduml

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,855 @@
========================================
ETSI NFV-SOL CNF Update with Mgmt Driver
========================================
This document describes how to update CNF with Mgmt Driver in Tacker v2 API.
Overview
--------
The diagram below shows an overview of the CNF updating.
1. Request update VNF
A user requests tacker-server to update a CNF with tacker-client
by requesting ``update VNF`` as a Modify VNF information operation.
2. Call Kubernetes API
Upon receiving a request from tacker-client, tacker-server redirects it to
tacker-conductor. In tacker-conductor, the request is redirected again to
the matching Mgmt Driver (in this case the Mgmt Driver of container update)
according to the contents of the VNFD in the VNF Package. Then, Mgmt Driver
calls Kubernetes APIs.
3. Update resources
Kubernetes Master update resources according to the API calls.
.. figure:: img/update_with_mgmt_driver.svg
Mgmt Driver Introduction
~~~~~~~~~~~~~~~~~~~~~~~~
Mgmt Driver enables Users to configure their VNF before and/or after
its VNF Lifecycle Management operation. Users can customize the logic
of Mgmt Driver by implementing their own Mgmt Driver and these
customizations are specified by "interface" definition in
`NFV-SOL001 v2.6.1`_.
The Mgmt Driver in this user guide supports updating CNF with
``modify_information_start`` and ``modify_information_end`` operation.
Use Cases
~~~~~~~~~
In this user guide, the provided sample VNF Packages will be instantiated
and then updated. The sample Mgmt Driver will update resources on
Kubernetes during update. Update the ConfigMap and Secret, and also
update the image in the Pod, Deployment, DaemonSet and ReplicaSet, and other
resources will not change.
Prerequisites
-------------
The following packages should be installed:
* tacker
* python-tackerclient
And you need to put the Mgmt Driver file in the
Scripts directory of the VNF Package.
.. note::
You can find sample Mgmt Driver file in the following path.
`tacker/sol_refactored/mgmt_drivers/container_update_mgmt_v2.py`_
You can also refer to :doc:`/user/v2/cnf/deployment/index` for the
procedure of preparation from "Prepare Kubernetes VIM" to
"Instantiate VNF".
How to Instantiate VNF for Updating
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can use the sample VNF package below to instantiate VNF to be updated.
.. code-block:: console
$ python3 -m pip install TACKER_ROOT
$ cd TACKER_ROOT/samples/tests/functional/sol_kubernetes_v2/test_cnf_container_update_before
$ vi pkggen.py
...
vim_id = "your k8s vim's id" (modify this value to your own vim Id)
...
$ python3 pkggen.py
$ ll
...
drwxr-xr-x 5 stack stack 4096 Nov 5 23:46 contents/
-rw-r--r-- 1 stack stack 1922 Nov 5 23:46 pkggen.py
-rw-rw-r-- 1 stack stack 25823 Nov 20 04:30 test_cnf_container_update_before.zip
...
.. note::
In this document, ``TACKER_ROOT`` is the root of tacker's repository on
the server.
After you have done the above, you will have the sample VNF package
`test_cnf_container_update_before.zip`.
After creating a VNF package with :command:`openstack vnf package create`,
When the Onboarding State is CREATED, the Operational
State is DISABLED, and the Usage State is NOT_IN_USE, indicate the creation is
successful.
.. code-block:: console
$ openstack vnf package create
+-------------------+-------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------+-------------------------------------------------------------------------------------------------+
| ID | 67e8b34a-d303-4ec1-acb0-e6a3bf6aae12 |
| Links | { |
| | "self": { |
| | "href": "/vnfpkgm/v1/vnf_packages/67e8b34a-d303-4ec1-acb0-e6a3bf6aae12" |
| | }, |
| | "packageContent": { |
| | "href": "/vnfpkgm/v1/vnf_packages/67e8b34a-d303-4ec1-acb0-e6a3bf6aae12/package_content" |
| | } |
| | } |
| Onboarding State | CREATED |
| Operational State | DISABLED |
| Usage State | NOT_IN_USE |
| User Defined Data | {} |
+-------------------+-------------------------------------------------------------------------------------------------+
Upload the CSAR zip file to the VNF Package by running the following command
:command:`openstack vnf package upload --path <path of vnf package> <vnf package ID>`.
Here is an example of uploading VNF package:
.. code-block:: console
$ openstack vnf package upload --path test_cnf_container_update_before.zip 67e8b34a-d303-4ec1-acb0-e6a3bf6aae12
Upload request for VNF package 67e8b34a-d303-4ec1-acb0-e6a3bf6aae12 has been accepted.
Create VNF instance by running
:command:`openstack vnflcm create <VNFD ID> --os-tacker-api-version 2`.
.. note::
The VNFD ID could be found by
:command:`openstack vnf package show <vnf package ID>` command.
Here is an example of creating VNF :
.. code-block:: console
$ openstack vnflcm create 97018ca2-bf29-4715-9e2b-6e432dd1f414
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
| ID | dec67077-b67c-46ff-b5bf-3b8d34b4ed79 |
| Instantiation State | NOT_INSTANTIATED |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/dec67077-b67c-46ff-b5bf-3b8d34b4ed79" |
| | }, |
| | "instantiate": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/dec67077-b67c-46ff-b5bf-3b8d34b4ed79/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 | 97018ca2-bf29-4715-9e2b-6e432dd1f414 |
| VNFD Version | 1.0 |
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
The following example shows the yaml files that deploys the Kubernetes
resources.
You can see resource definition files are included as a value of
``lcm-kubernetes-def-files`` in ``additionalParams`` here.
.. code-block:: console
$ cat ./instance_kubernetes.json
{
"flavourId": "simple",
"vimConnectionInfo": {
"vim1": {
"vimId": "b7e657dc-8f16-4c1c-8fa4-a7c298d6a827",
"vimType": "ETSINFV.KUBERNETES.V_1"
}
},
"additionalParams": {
"lcm-kubernetes-def-files": [
"Files/kubernetes/configmap_1.yaml",
"Files/kubernetes/deployment.yaml",
"Files/kubernetes/pod_env.yaml",
"Files/kubernetes/pod_volume.yaml",
"Files/kubernetes/replicaset.yaml",
"Files/kubernetes/secret_1.yaml",
"Files/kubernetes/configmap_3.yaml",
"Files/kubernetes/pod_env_2.yaml",
"Files/kubernetes/pod_volume_2.yaml",
"Files/kubernetes/daemonset.yaml",
"Files/kubernetes/deployment_2.yaml",
"Files/kubernetes/secret_3.yaml"
]
}
}
Instantiate VNF by running the following command
:command:`openstack vnflcm instantiate <VNF instance ID> <json file> --os-tacker-api-version 2`,
after the command above is executed.
.. code-block:: console
$ openstack vnflcm instantiate VNF_INSTANCE_ID instance_kubernetes.json --os-tacker-api-version 2
Instantiate request for VNF Instance dec67077-b67c-46ff-b5bf-3b8d34b4ed79 has been accepted.
CNF Updating Procedure
-----------------------
As mentioned in `Prerequisites`, the VNF must be instantiated before
performing updating.
Next, the user can use the original vnf package as a template to make a new
vnf package, in which the yaml of ConfigMap, Secret, Pod, Deployment, DaemonSet
and ReplicaSet can be changed.
.. note::
* The yaml of ConfigMap and Secret can be changed. The kind, namespace
and name cannot be changed, but the file name and file path can
be changed.
* The yaml of Pod, Deployment, DaemonSet and ReplicaSet can also be
changed, but only the image field can be changed, and no other fields can
be changed.
* No other yaml is allowed to be changed.
* If changes other than images are made to the yaml of Pod, Deployment,
DaemonSet and ReplicaSet , those will not take effect. However, if heal
entire VNF at this time, the resource will be based on the new yaml
during the instantiation, and all changes will take effect.
Then after creating and uploading the new vnf package, you can perform the
update operation.
After the update, the Mgmt Driver will restart the pod to update and
recreate the deployment, DaemonSet and ReplicaSet to update.
.. note::
This document provides the new vnf package, the path is
`samples/tests/functional/sol_kubernetes_v2/test_cnf_container_update_after`_
Details of CLI commands are described in :doc:`/cli/cli-etsi-vnflcm`.
How to Update CNF
~~~~~~~~~~~~~~~~~
Execute Update CLI command and check the status of the resources
before and after updating.
This is to confirm that the resources deployed in Kubernetes are updated
after update CNF.
The following is an example of the entire process.
The resources information before update:
* ConfigMap
.. code-block:: console
$ kubectl get configmaps
NAME DATA AGE
cm-data 1 70s
cm-data3 1 70s
kube-root-ca.crt 1 14d
$ kubectl describe configmaps cm-data
Name: cm-data
Namespace: default
Labels: <none>
Annotations: <none>
Data
====
cmKey1.txt:
----
configmap data
foo
bar
BinaryData
====
Events: <none>
$ kubectl describe configmaps cm-data3
Name: cm-data3
Namespace: default
Labels: <none>
Annotations: <none>
Data
====
cmKey1.txt:
----
configmap data
foo
bar
BinaryData
====
Events: <none>
* Secret
.. code-block:: console
$ kubectl get secrets
NAME TYPE DATA AGE
default-token-k8svim kubernetes.io/service-account-token 3 33m
secret-data Opaque 2 2m53s
secret-data3 Opaque 2 2m53s
$ kubectl describe secrets secret-data
Name: secret-data
Namespace: default
Labels: <none>
Annotations: <none>
Type: Opaque
Data
====
password: 15 bytes
secKey1.txt: 15 bytes
$ kubectl describe secrets secret-data3
Name: secret-data3
Namespace: default
Labels: <none>
Annotations: <none>
Type: Opaque
Data
====
password: 15 bytes
secKey1.txt: 15 bytes
* Pod
.. code-block:: console
$ kubectl get pod -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
daemonset-vdu5-jgjq9 1/1 Running 0 6m38s 10.0.0.107 vagrant <none> <none>
deployment2-vdu6-86579d6868-6mbsl 1/1 Running 0 6m38s 10.0.0.79 vagrant <none> <none>
env-test 1/1 Running 0 6m38s 10.0.0.108 vagrant <none> <none>
env-test2 1/1 Running 0 6m38s 10.0.0.97 vagrant <none> <none>
vdu1-update-6fcf66b5dd-nngts 1/1 Running 0 6m38s 10.0.0.116 vagrant <none> <none>
vdu2-update-2wvxj 1/1 Running 0 6m38s 10.0.0.91 vagrant <none> <none>
volume-test 1/1 Running 0 6m38s 10.0.0.74 vagrant <none> <none>
volume-test2 1/1 Running 0 6m38s 10.0.0.98 vagrant <none> <none>
$ kubectl describe pod volume-test
Name: volume-test
Namespace: default
...
Containers:
nginx:
Container ID: cri-o://f08eaee4d9fb0cdaaf9803fb97891ff61507239af1c6317464300bcc5d1f9f08
Image: nginx
Image ID: docker.io/library/nginx@sha256:86e53c4c16a6a276b204b0fd3a8143d86547c967dc8258b3d47c3a21bb68d3c6
...
Volumes:
cm-volume:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: cm-data
Optional: false
sec-volume:
Type: Secret (a volume populated by a Secret)
SecretName: secret-data
Optional: false
...
$ kubectl describe pod volume-test2
Name: volume-test2
Namespace: default
...
Containers:
nginx:
Container ID: cri-o://6255e5c8d0af561789919c5aa07ac90ea691b4d0a91b5f88b9c00592295e9c9b
Image: nginx
Image ID: docker.io/library/nginx@sha256:86e53c4c16a6a276b204b0fd3a8143d86547c967dc8258b3d47c3a21bb68d3c6
...
Volumes:
cm-volume:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: cm-data3
Optional: false
sec-volume:
Type: Secret (a volume populated by a Secret)
SecretName: secret-data3
Optional: false
...
* Deployment
.. code-block:: console
$ kubectl get deployments.apps -o wide
NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
deployment2-vdu6 1/1 1 1 20m nginx nginx app=webserver
vdu1-update 1/1 1 1 20m nginx nginx app=webserver
$ kubectl describe pod deployment2-vdu6-86579d6868-6mbsl
Name: deployment2-vdu6-86579d6868-6mbsl
Namespace: default
...
Containers:
nginx:
Container ID: cri-o://eece8b07f2b66760bdc57e7a3fbc073938d73b37e62401d394d058e4273cdd90
Image: nginx
Image ID: docker.io/library/nginx@sha256:86e53c4c16a6a276b204b0fd3a8143d86547c967dc8258b3d47c3a21bb68d3c6
...
Environment Variables from:
cm-data3 ConfigMap with prefix 'CM_' Optional: false
secret-data3 Secret with prefix 'SEC_' Optional: false
Environment:
CMENV: <set to the key 'cmKey1.txt' of config map 'cm-data3'> Optional: false
SECENV: <set to the key 'password' in secret 'secret-data3'> Optional: false
...
$ kubectl describe pod vdu1-update-6fcf66b5dd-nngts
Name: vdu1-update-6fcf66b5dd-nngts
Namespace: default
...
Containers:
nginx:
Container ID: cri-o://55db77c8612cbddc6041431a9fd1c065cd5251253b07e86288107043e84d9dab
Image: nginx
Image ID: docker.io/library/nginx@sha256:86e53c4c16a6a276b204b0fd3a8143d86547c967dc8258b3d47c3a21bb68d3c6
...
Environment Variables from:
cm-data ConfigMap with prefix 'CM_' Optional: false
secret-data Secret with prefix 'SEC_' Optional: false
Environment:
CMENV: <set to the key 'cmKey1.txt' of config map 'cm-data'> Optional: false
SECENV: <set to the key 'password' in secret 'secret-data'> Optional: false
...
* DaemonSet
.. code-block:: console
$ kubectl get daemonset -o wide
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE CONTAINERS IMAGES SELECTOR
daemonset-vdu5 1 1 1 1 1 <none> 27m nginx nginx app=nginx
$ kubectl describe pod daemonset-vdu5-jgjq9
Name: daemonset-vdu5-jgjq9
Namespace: default
...
Containers:
nginx:
Container ID: cri-o://0d99ecf321d715aded2ec2834f2fecc57dbb7c6eb8e7f710f193df5a0844d846
Image: nginx
Image ID: docker.io/library/nginx@sha256:86e53c4c16a6a276b204b0fd3a8143d86547c967dc8258b3d47c3a21bb68d3c6
...
Environment Variables from:
cm-data ConfigMap with prefix 'CM_' Optional: false
secret-data Secret with prefix 'SEC_' Optional: false
Environment:
CMENV: <set to the key 'cmKey1.txt' of config map 'cm-data'> Optional: false
SECENV: <set to the key 'password' in secret 'secret-data'> Optional: false
...
* ReplicaSet
.. code-block:: console
$ kubectl get replicaset -o wide
NAME DESIRED CURRENT READY AGE CONTAINERS IMAGES SELECTOR
deployment2-vdu6-86579d6868 1 1 1 32m nginx nginx app=webserver,pod-template-hash=86579d6868
vdu1-update-6fcf66b5dd 1 1 1 32m nginx nginx app=webserver,pod-template-hash=6fcf66b5dd
vdu2-update 1 1 1 32m nginx nginx app=webserver
$ kubectl describe pod vdu2-update-2wvxj
Name: vdu2-update-2wvxj
Namespace: default
...
Containers:
nginx:
Container ID: cri-o://8e24081e5e325302f1e4403bf76756b90f848a9c712e53d99f547ba6265d7ed6
Image: nginx
Image ID: docker.io/library/nginx@sha256:86e53c4c16a6a276b204b0fd3a8143d86547c967dc8258b3d47c3a21bb68d3c6
...
Volumes:
cm-volume:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: cm-data
Optional: false
sec-volume:
Type: Secret (a volume populated by a Secret)
SecretName: secret-data
Optional: false
...
Update CNF can be executed by the following CLI command.
.. code-block:: console
$ openstack vnflcm update VNF_INSTANCE_ID --I sample_param_file.json \
--os-tacker-api-version 2
The content of the sample sample_param_file.json in this document is
as follows:
.. code-block:: console
{
"vnfdId": "58bcc1c6-1400-46ec-b7fb-e508bf7e00e9",
"vnfInstanceName": "modify_vnf_after",
"metadata": {
"configmap_secret_paths": [
"Files/kubernetes/configmap_2.yaml",
"Files/kubernetes/secret_2.yaml"
]
}
}
.. note::
If you want to update ConfigMap and Secret, not only need to update
their yaml, but also need to specify the updated yaml file path in
the metadata field of the request input parameter.
Here is an example of updating CNF:
.. code-block:: console
$ openstack vnflcm update dec67077-b67c-46ff-b5bf-3b8d34b4ed79 --I sample_param_file.json
Update vnf:dec67077-b67c-46ff-b5bf-3b8d34b4ed79
The resources information after update:
* ConfigMap
.. code-block:: console
$ kubectl describe configmaps cm-data
Name: cm-data
Namespace: default
Labels: <none>
Annotations: <none>
Data
====
cmKey1.txt:
----
configmap2 data2
foo2
bar2
BinaryData
====
Events: <none>
$ kubectl describe configmaps cm-data3
Name: cm-data3
Namespace: default
Labels: <none>
Annotations: <none>
Data
====
cmKey1.txt:
----
configmap data
foo
bar
BinaryData
====
Events: <none>
* Secret
.. code-block:: console
$ kubectl describe secrets secret-data
Name: secret-data
Namespace: default
Labels: <none>
Annotations: <none>
Type: Opaque
Data
====
password: 16 bytes
secKey1.txt: 18 bytes
$ kubectl describe secret secret-data3
Name: secret-data3
Namespace: default
Labels: <none>
Annotations: <none>
Type: Opaque
Data
====
secKey1.txt: 15 bytes
password: 15 bytes
* Pod
.. code-block:: console
$ kubectl get pod -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
daemonset-vdu5-whd4s 1/1 Running 0 9m49s 10.0.0.76 vagrant <none> <none>
deployment2-vdu6-86579d6868-6mbsl 1/1 Running 0 104m 10.0.0.79 vagrant <none> <none>
env-test 1/1 Running 1 (9m52s ago) 104m 10.0.0.108 vagrant <none> <none>
env-test2 1/1 Running 0 104m 10.0.0.97 vagrant <none> <none>
vdu1-update-5d87858fc6-tfgts 1/1 Running 0 9m52s 10.0.0.71 vagrant <none> <none>
vdu2-update-tk7qp 1/1 Running 0 9m52s 10.0.0.91 vagrant <none> <none>
volume-test 1/1 Running 1 (9m52s ago) 104m 10.0.0.74 vagrant <none> <none>
volume-test2 1/1 Running 0 104m 10.0.0.98 vagrant <none> <none>
$ kubectl describe pod env-test
Name: env-test
Namespace: default
...
Containers:
nginx:
Container ID: cri-o://143924c0a3869402db7e07950cf66c6360a4298a8b575e9ea3c35cf77d48854d
Image: tomcat
Image ID: docker.io/library/tomcat@sha256:857b168692495ee6ff0d6ee89b5b479555c74401bc3c219c88644b9181f03dd5
...
Environment Variables from:
cm-data ConfigMap with prefix 'CM_' Optional: false
secret-data Secret with prefix 'SEC_' Optional: false
Environment:
CMENV: <set to the key 'cmKey1.txt' of config map 'cm-data'> Optional: false
SECENV: <set to the key 'password' in secret 'secret-data'> Optional: false
...
$ kubectl describe pod env-test2
Name: env-test2
Namespace: default
...
Containers:
nginx:
Container ID: cri-o://1ebf1f8fccfd821f55a0918657735758173ea83037edd84bf651e660afd16f82
Image: nginx
Image ID: docker.io/library/nginx@sha256:86e53c4c16a6a276b204b0fd3a8143d86547c967dc8258b3d47c3a21bb68d3c6
...
Environment Variables from:
cm-data3 ConfigMap with prefix 'CM_' Optional: false
secret-data3 Secret with prefix 'SEC_' Optional: false
Environment:
CMENV: <set to the key 'cmKey1.txt' of config map 'cm-data3'> Optional: false
SECENV: <set to the key 'password' in secret 'secret-data3'> Optional: false
...
$ kubectl describe pod volume-test
Name: volume-test
Namespace: default
...
Containers:
nginx:
Container ID: cri-o://e46b41347ddc29dbd7afee3dda324a1ac26383ab1f805635dd64895328bbe5a1
Image: cirros
Image ID: docker.io/library/cirros@sha256:a40a2b0a21536db691c8e7e055dbb92c81ad15392048abbde32fc5698e07f831
...
Volumes:
cm-volume:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: cm-data
Optional: false
sec-volume:
Type: Secret (a volume populated by a Secret)
SecretName: secret-data
Optional: false
...
$ kubectl describe pod volume-test2
Name: volume-test2
Namespace: default
...
Containers:
nginx:
Container ID: cri-o://6255e5c8d0af561789919c5aa07ac90ea691b4d0a91b5f88b9c00592295e9c9b
Image: nginx
Image ID: docker.io/library/nginx@sha256:86e53c4c16a6a276b204b0fd3a8143d86547c967dc8258b3d47c3a21bb68d3c6
...
Volumes:
cm-volume:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: cm-data3
Optional: false
sec-volume:
Type: Secret (a volume populated by a Secret)
SecretName: secret-data3
Optional: false
...
* Deployment
.. code-block:: console
$ kubectl get deployments -o wide
NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
deployment2-vdu6 1/1 1 1 114m nginx nginx app=webserver
vdu1-update 1/1 1 1 114m nginx cirros app=webserver
$ kubectl describe pod deployment2-vdu6-86579d6868-6mbsl
Name: deployment2-vdu6-86579d6868-6mbsl
Namespace: default
...
Containers:
nginx:
Container ID: cri-o://eece8b07f2b66760bdc57e7a3fbc073938d73b37e62401d394d058e4273cdd90
Image: nginx
Image ID: docker.io/library/nginx@sha256:86e53c4c16a6a276b204b0fd3a8143d86547c967dc8258b3d47c3a21bb68d3c6
...
Environment Variables from:
cm-data3 ConfigMap with prefix 'CM_' Optional: false
secret-data3 Secret with prefix 'SEC_' Optional: false
Environment:
CMENV: <set to the key 'cmKey1.txt' of config map 'cm-data3'> Optional: false
SECENV: <set to the key 'password' in secret 'secret-data3'> Optional: false Optional: false
...
$ kubectl describe pod vdu1-update-5d87858fc6-tfgts
Name: vdu1-update-5d87858fc6-tfgts
Namespace: default
...
Containers:
nginx:
Container ID: cri-o://12e4ada36be199c46971f4e41c4afc82d7cedd77c5120a8a0b751a43a884a307
Image: cirros
Image ID: docker.io/library/cirros@sha256:a40a2b0a21536db691c8e7e055dbb92c81ad15392048abbde32fc5698e07f831
...
Environment Variables from:
cm-data ConfigMap with prefix 'CM_' Optional: false
secret-data Secret with prefix 'SEC_' Optional: false
Environment:
CMENV: <set to the key 'cmKey1.txt' of config map 'cm-data'> Optional: false
SECENV: <set to the key 'password' in secret 'secret-data'> Optional: false
...
* DaemonSet
.. code-block:: console
$ kubectl get daemonset -o wide
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE CONTAINERS IMAGES SELECTOR
daemonset-vdu5 1 1 1 1 1 <none> 126m nginx cirros app=nginx
$ kubectl describe pod daemonset-vdu5-whd4s
Name: daemonset-vdu5-whd4s
Namespace: default
...
Containers:
nginx:
Container ID: cri-o://f291342b342ad106410b99212f4e934730dbdf94cc2d2daf767efd7cb7305d68
Image: cirros
Image ID: docker.io/library/cirros@sha256:a40a2b0a21536db691c8e7e055dbb92c81ad15392048abbde32fc5698e07f831
...
Environment Variables from:
cm-data ConfigMap with prefix 'CM_' Optional: false
secret-data Secret with prefix 'SEC_' Optional: false
Environment:
CMENV: <set to the key 'cmKey1.txt' of config map 'cm-data'> Optional: false
SECENV: <set to the key 'password' in secret 'secret-data'> Optional: false
...
* ReplicaSet
.. code-block:: console
$ kubectl get replicaset.apps -o wide
NAME DESIRED CURRENT READY AGE CONTAINERS IMAGES SELECTOR
deployment2-vdu6-86579d6868 1 1 1 131m nginx nginx app=webserver,pod-template-hash=86579d6868
vdu1-update-5d87858fc6 1 1 1 37m nginx cirros app=webserver,pod-template-hash=5d87858fc6
vdu1-update-6fcf66b5dd 0 0 0 131m nginx nginx app=webserver,pod-template-hash=6fcf66b5dd
vdu2-update 1 1 1 131m nginx celebdor/kuryr-demo app=webserver
$ kubectl describe pod vdu2-update-tk7qp
Name: vdu2-update-tk7qp
Namespace: default
...
Containers:
nginx:
Container ID: cri-o://05f13a7b7d171e2d68bcbceefbce0537b851bd0f0f7de60fba0d9500349d6f4d
Image: celebdor/kuryr-demo
Image ID: docker.io/celebdor/kuryr-demo@sha256:74102005010b28a4518e08215df992a46b27ffc8b50836f29d8f9c0d7c9d4135
...
Volumes:
cm-volume:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: cm-data
Optional: false
sec-volume:
Type: Secret (a volume populated by a Secret)
SecretName: secret-data
Optional: false
...
You can see that only the Pods are restarted whose ConfigMap/Secret or images
are updated. When it comes to Deployments, DaemonSets and ReplicaSets whose
ConfigMap/Secret or images are updated, their pods will be deleted and
recreated.
History of Checks
-----------------
The content of this document has been confirmed to work
using the following VNF Packages.
* `test_cnf_container_update_before for 2023.2 Bobcat`_
* `test_cnf_container_update_after for 2023.2 Bobcat`_
.. _NFV-SOL001 v2.6.1: https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/001/02.06.01_60/gs_NFV-SOL001v020601p.pdf
.. _tacker/sol_refactored/mgmt_drivers/container_update_mgmt_v2.py:
https://opendev.org/openstack/tacker/src/branch/master/tacker/sol_refactored/mgmt_drivers/container_update_mgmt_v2.py
.. _samples/tests/functional/sol_kubernetes_v2/test_cnf_container_update_after:
https://opendev.org/openstack/tacker/src/branch/master/samples/tests/functional/sol_kubernetes_v2/test_cnf_container_update_after
.. _test_cnf_container_update_before for 2023.2 Bobcat:
https://opendev.org/openstack/tacker/src/branch/stable/2023.2/tacker/tests/functional/sol_kubernetes_v2/samples/test_cnf_container_update_before
.. _test_cnf_container_update_after for 2023.2 Bobcat:
https://opendev.org/openstack/tacker/src/branch/stable/2023.2/tacker/tests/functional/sol_kubernetes_v2/samples/test_cnf_container_update_after

View File

@ -413,9 +413,7 @@ Error-handling operations:
To solve this error, you can get with the following ways.
* For the operation state of ``FAILED_TEMP``, please refer to
`VNF LCM error-handling`_.
:doc:`/user/v2/error_handling`.
* For the operation state of ``FAILED``, please perform other LCM operations
on this vnf instance until the result is ``COMPLETED``.
.. _VNF LCM error-handling: https://docs.openstack.org/tacker/latest/user/etsi_vnf_error_handling.html

View File

@ -0,0 +1,582 @@
===============================
ETSI NFV-SOL VNF error-handling
===============================
This document describes how to error-handling VNF in Tacker v2 API.
Prerequisites
-------------
The following packages should be installed:
* tacker
* python-tackerclient
Execute up to "Instantiate VNF" in the procedure of
:doc:`/user/v2/vnf/deployment_with_tosca/index` or
:doc:`/user/v2/vnf/deployment_with_user_data/index`.
In other words, the procedure after "Terminate VNF" is not executed.
VNF Error-handling Procedures
-----------------------------
As mentioned in Prerequisites, the VNF must be created
before performing error-handling.
Details of CLI commands are described in
:doc:`/cli/cli-etsi-vnflcm`.
There are some operations to error-handling VNF.
* Rollback VNF lifecycle management operation
* Fail VNF lifecycle management operation
* Retry VNF lifecycle management operation
In order to execute error-handling, it is necessary to specify
VNF_LCM_OP_OCC_ID, which is the ID for the target LCM operation.
First, the method of specifying the ID will be described.
Identify VNF_LCM_OP_OCC_ID
~~~~~~~~~~~~~~~~~~~~~~~~~~
The VNF_LCM_OP_OCC_ID can be obtained via CLI.
Details of CLI commands are described in
:doc:`/cli/cli-etsi-vnflcm`.
Before checking the "VNF_LCM_OP_OCC_ID", you should get VNF_INSTANCE_ID first.
.. code-block:: console
$ openstack vnflcm op list --os-tacker-api-version 2
Result:
.. code-block:: console
+--------------------------------------+-----------------+--------------------------------------+-------------+
| ID | Operation State | VNF Instance ID | Operation |
+--------------------------------------+-----------------+--------------------------------------+-------------+
| a7f80542-faeb-4324-ba82-c6214307e864 | FAILED_TEMP | 385fc2ff-1ef5-42f4-8196-3d913160074d | INSTANTIATE |
+--------------------------------------+-----------------+--------------------------------------+-------------+
Error-handling can be executed only when **operationState** is **FAILED_TMP**.
If the Subscription is registered, the above operation trigger
that caused the FAILED_TEMP send a 'Notification' to the **callbackUri**
of the Subscription.
**vnfLcmOpOccId** included in this 'Notification' corresponds
to VNF_LCM_OP_OCC_ID.
See `VNF LCM v2 API`_ for details on the APIs used here.
Rollback VNF LCM Operation
~~~~~~~~~~~~~~~~~~~~~~~~~~
.. list-table::
:widths: 10 40 15 15
:header-rows: 1
* - LCM Operation
- Description of Rollback
- Precondition
- Postcondition
* - Instantiate
- | VNFM removes all VMs and resources.
| e.g. Tacker executes Heat stack-delete for deletion of the target VM.
- FAILED_TEMP
- ROLLED_BACK or FAILED_TEMP
* - Scale-out
- | VNFM reverts changes of VMs and resources specified in the middle of scale-out operation.
| As a result, the newest VNFc(VM) is deleted.
| e.g. Tacker reverts desired_capacity and executes Heat stack-update.
- FAILED_TEMP
- ROLLED_BACK or FAILED_TEMP
* - Modify
- VNFM reverts the update of the VNF instance information.
- FAILED_TEMP
- ROLLED_BACK or FAILED_TEMP
* - Change external connectivity
- | VNFM reverts changes of the external connectivity for VNF instances.
| e.g. Tacker reverts stack parameters and executes Heat stack-update.
- FAILED_TEMP
- ROLLED_BACK or FAILED_TEMP
* - Change Current VNF Package
- | VNFM reverts changes of current vnf package for VNF instances.
| e.g. Tacker reverts stack parameters and executes Heat stack-update.
- FAILED_TEMP
- ROLLED_BACK or FAILED_TEMP
.. note::
In some cases, Rollback of Change external connectivity cannot recover
the IP address and Port Id of virtual resources.
If the operation fails before performing VIM processing: updating stack,
the IP address and Port Id will be recovered by its rollback operation.
Otherwise, dynamic IP address and Port Id are not recovered
by rollback operation.
This manual describes the following operations as use cases for
rollback operations.
* "Instantiate VNF" fails
* Rollback VNF lifecycle management operation
* Delete VNF
As shown below, if "Instantiate VNF" fails, "Delete VNF" cannot be executed
without executing "Rollback VNF lifecycle management operation".
.. code-block:: console
$ openstack vnflcm delete VNF_INSTANCE_ID --os-tacker-api-version 2
Result:
.. code-block:: console
Failed to delete vnf instance with ID '385fc2ff-1ef5-42f4-8196-3d913160074d': Other LCM operation of vnfInstance 385fc2ff-1ef5-42f4-8196-3d913160074d is in progress.
Failed to delete 1 of 1 vnf instances.
Therefore, "Rollback VNF lifecycle management operation" with
the following CLI command.
.. code-block:: console
$ openstack vnflcm op rollback VNF_LCM_OP_OCC_ID --os-tacker-api-version 2
Result:
.. code-block:: console
Rollback request for LCM operation a7f80542-faeb-4324-ba82-c6214307e864 has been accepted
If "Rollback VNF lifecycle management operation" is successful,
then "Delete VNF" is also successful.
.. code-block:: console
$ openstack vnflcm delete VNF_INSTANCE_ID --os-tacker-api-version 2
Result:
.. code-block:: console
Vnf instance '385fc2ff-1ef5-42f4-8196-3d913160074d' is deleted successfully
Fail VNF LCM Operation
~~~~~~~~~~~~~~~~~~~~~~
.. list-table::
:widths: 10 40 15 15
:header-rows: 1
* - LCM Operation
- Description of Fail
- Precondition
- Postcondition
* - Instantiate
- Tacker simply changes LCM operation state to "FAILED" on Tacker-DB.
- FAILED_TEMP
- FAILED
* - Terminate
- Tacker simply changes LCM operation state to "FAILED" on Tacker-DB.
- FAILED_TEMP
- FAILED
* - Heal
- Tacker simply changes LCM operation state to "FAILED" on Tacker-DB.
- FAILED_TEMP
- FAILED
* - Scale
- Tacker simply changes LCM operation state to "FAILED" on Tacker-DB.
- FAILED_TEMP
- FAILED
* - Modify
- Tacker simply changes LCM operation state to "FAILED" on Tacker-DB.
- FAILED_TEMP
- FAILED
* - Change external connectivity
- Tacker simply changes LCM operation state to "FAILED" on Tacker-DB.
- FAILED_TEMP
- FAILED
* - Change Current VNF Package
- Tacker simply changes LCM operation state to "FAILED" on Tacker-DB.
- FAILED_TEMP
- FAILED
This manual describes the following operations as use cases for
fail operations.
* "Instantiate VNF" fails
* Fail VNF lifecycle management operation
* Delete VNF
As shown below, if "Instantiate VNF" fails, "Delete VNF" cannot be executed
after executing "Fail VNF lifecycle management operation".
.. code-block:: console
$ openstack vnflcm delete VNF_INSTANCE_ID --os-tacker-api-version 2
Result:
.. code-block:: console
Failed to delete vnf instance with ID '385fc2ff-1ef5-42f4-8196-3d913160074d': Other LCM operation of vnfInstance 385fc2ff-1ef5-42f4-8196-3d913160074d is in progress.
Failed to delete 1 of 1 vnf instances.
Therefore, "Fail VNF lifecycle management operation" with
the following CLI command.
.. code-block:: console
$ openstack vnflcm op fail VNF_LCM_OP_OCC_ID \
--fit-width --os-tacker-api-version 2
Result:
.. code-block:: console
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Error | { |
| | "title": "Stack create failed", |
| | "status": 422, |
| | "detail": "Resource CREATE failed: resources.wifiut5qtngn: resources.VDU1_scale_group.Property error: resources.VDU1_CP1.properties.network: Error validating value 'errornetwork': Unable to find network with name or id |
| | 'errornetwork'" |
| | } |
| ID | a7f80542-faeb-4324-ba82-c6214307e864 |
| Is Automatic Invocation | False |
| Is Cancel Pending | False |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_lcm_op_occs/a7f80542-faeb-4324-ba82-c6214307e864" |
| | }, |
| | "vnfInstance": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/385fc2ff-1ef5-42f4-8196-3d913160074d" |
| | }, |
| | "retry": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_lcm_op_occs/a7f80542-faeb-4324-ba82-c6214307e864/retry" |
| | }, |
| | "rollback": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_lcm_op_occs/a7f80542-faeb-4324-ba82-c6214307e864/rollback" |
| | }, |
| | "fail": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_lcm_op_occs/a7f80542-faeb-4324-ba82-c6214307e864/fail" |
| | } |
| | } |
| Operation | INSTANTIATE |
| Operation State | FAILED |
| Start Time | 2023-11-14T04:32:57Z |
| State Entered Time | 2023-11-14T04:32:57Z |
| VNF Instance ID | 385fc2ff-1ef5-42f4-8196-3d913160074d |
| grantId | 008eccda-5466-4820-ae76-bdce6e128d8c |
| operationParams | { |
| | "flavourId": "simple" |
| | } |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
If "Fail VNF lifecycle management operation" is successful,
then "Delete VNF" is also successful.
.. code-block:: console
$ openstack vnflcm delete VNF_INSTANCE_ID --os-tacker-api-version 2
Result:
.. code-block:: console
Vnf instance '385fc2ff-1ef5-42f4-8196-3d913160074d' is deleted successfully
Retry VNF LCM Operation
~~~~~~~~~~~~~~~~~~~~~~~
.. list-table::
:widths: 10 40 15 15
:header-rows: 1
* - LCM Operation
- Description of Fail
- Precondition
- Postcondition
* - Instantiate
- VNFM retries a Instantiate operation.
- FAILED_TEMP
- COMPLETED or FAILED_TEMP
* - Terminate
- VNFM retries a Terminate operation.
- FAILED_TEMP
- COMPLETED or FAILED_TEMP
* - Heal
- VNFM retries a Heal operation.
- FAILED_TEMP
- COMPLETED or FAILED_TEMP
* - Scale
- VNFM retries a Scale operation.
- FAILED_TEMP
- COMPLETED or FAILED_TEMP
* - Modify
- VNFM retries a Modify operation.
- FAILED_TEMP
- COMPLETED or FAILED_TEMP
* - Change external connectivity
- VNFM retries a Change external connectivity operation.
- FAILED_TEMP
- COMPLETED or FAILED_TEMP
* - Change Current VNF Package
- VNFM retries a Change Current VNF Package operation.
- FAILED_TEMP
- COMPLETED or FAILED_TEMP
This manual describes the following operations as use cases for
retry operations.
* "Instantiate VNF" fails
* Retry VNF lifecycle management operation
As shown below, if "Instantiate VNF" fails, If you want re-execute
previous(failed) operation , you execute "Retry" operation.
Therefore, "Retry VNF lifecycle management operation" with
the following CLI command.
.. code-block:: console
$ openstack vnflcm op retry VNF_LCM_OP_OCC_ID --os-tacker-api-version 2
Result:
.. code-block:: console
Retry request for LCM operation a7f80542-faeb-4324-ba82-c6214307e864 has been accepted
If "Retry VNF lifecycle management operation" is successful,
then another LCM can be operational.
Error-handling of MgmtDriver
----------------------------
Error-handling includes Retry, Rollback and Fail operations.
* For the fail operation, it will not perform LCM when it is executed,
so there is no need to use MgmtDriver.
* For the retry operation, it will perform the LCM again when it is executed,
so as long as the LCM is configured with MgmtDriver, the MgmtDriver will
also be called during the retry operation, and no additional configuration
is required.
* For the rollback operation,
because there is no definition of ``rollback_start`` and ``rollback_end`` in
``6.7 Interface Types`` of `NFV-SOL001 v2.6.1`_, so when the rollback
operation is performed, MgmtDriver will not be called.
The VNFD in the VNF Package must be modified before calling MgmtDriver in the
rollback operation.
.. note::
In the MgmtDriver, the user saves the data that needs to be kept
when the LCM fails in the ``user_script_err_handling_data`` variable.
It is saved in the corresponding VNF_LCM_OP_OCC, and can be viewed through
`Show VNF LCM OP OCC`_.
During error-handling (retry or rollback), use the data in the
``user_script_err_handling_data`` variable to perform corresponding
processing.
Modifications of VNF Package
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Users need to make the following modifications when creating
a :doc:`/user/vnf-package`.
The rollback operation currently supports multiple
`Rollback VNF LCM Operation`_.
The following takes the rollback operations of instantiate and scale-out
as examples to demonstrate how to modify VNFD.
.. note::
The following provides the sample files ``v2_sample2_df_simple.yaml`` and
``v2_sample2_types.yaml`` that need to be modified, which are stored in
the Definitions directory of the VNF Package.
* ``v2_sample2_df_simple.yaml`` corresponds to
``4. Topology Template File with Deployment Flavour``
in :doc:`/user/vnfd-sol001`.
* ``v2_sample2_types.yaml`` corresponds to
``2. User Defined Types Definition File``
in :doc:`/user/vnfd-sol001`.
* In ``v2_sample2_df_simple.yaml``, ``xxx_rollback_start`` and
``xxx_rollback_end`` need to be added under
``topology_template.node_templates.VNF.interfaces.Vnflcm``.
The following is the content of ``v2_sample2_df_simple.yaml``, the unmodified
part is replaced by "``...``" :
.. code-block:: yaml
topology_template:
...
node_templates:
VNF:
type: company.provider.VNF
properties:
flavour_description: A simple flavour
interfaces:
Vnflcm:
instantiate_start:
implementation: mgmt-driver-script
instantiate_end:
implementation: mgmt-driver-script
heal_start:
implementation: mgmt-driver-script
heal_end:
implementation: mgmt-driver-script
scale_start:
implementation: mgmt-driver-script
scale_end:
implementation: mgmt-driver-script
terminate_start:
implementation: mgmt-driver-script
terminate_end:
implementation: mgmt-driver-script
change_external_connectivity_start:
implementation: mgmt-driver-script
change_external_connectivity_end:
implementation: mgmt-driver-script
modify_information_start:
implementation: mgmt-driver-script
modify_information_end:
implementation: mgmt-driver-script
instantiate_rollback_start:
implementation: mgmt-driver-script
instantiate_rollback_end:
implementation: mgmt-driver-script
scale_rollback_start:
implementation: mgmt-driver-script
scale_rollback_end:
implementation: mgmt-driver-script
artifacts:
mgmt-driver-script:
description: Sample MgmtDriver Script
type: tosca.artifacts.Implementation.Python
file: ../Scripts/mgmt_driver_script.py
.. note::
If some definitions of ``xxx_start`` and ``xxx_end`` are added in VNFD,
corresponding ``xxx_start`` and ``xxx_end`` functions must also be
added in MgmtDriver.
* In ``v2_sample2_types.yaml``, the definition of ``interface_types`` needs to
be added, and the definition of ``type`` needs to be modified under
``node_types.company.provider.VNF.interfaces.Vnflcm``.
The following is the content of ``v2_sample2_types.yaml``, the unmodified
part is replaced by "``...``" :
.. code-block:: yaml
interface_types:
sample.test.Vnflcm:
derived_from: tosca.interfaces.nfv.Vnflcm
instantiate_start:
description: Invoked before instantiate
instantiate_end:
description: Invoked after instantiate
heal_start:
description: Invoked before heal
heal_end:
description: Invoked after heal
scale_start:
description: Invoked before scale
scale_end:
description: Invoked after scale
terminate_start:
description: Invoked before terminate
terminate_end:
description: Invoked after terminate
change_external_connectivity_start:
description: Invoked before change_external_connectivity
change_external_connectivity_end:
description: Invoked after change_external_connectivity
modify_information_start:
description: Invoked before modify_information
modify_information_end:
description: Invoked after modify_information
instantiate_rollback_start:
description: Invoked before instantiate_rollback
instantiate_rollback_end:
description: Invoked after instantiate_rollback
scale_rollback_start:
description: Invoked before scale_rollback
scale_rollback_end:
description: Invoked after scale_rollback
node_types:
company.provider.VNF:
...
interfaces:
Vnflcm:
type: sample.test.Vnflcm
After the above modification, MgmtDriver can also be called in error-handling.
.. note::
In the process of error-handling, the specific action of MgmtDriver
needs to be customized by the user or provider.
History of Checks
-----------------
The content of this document has been confirmed to work
using the following VNF Package.
* `error_network for 2023.2 Bobcat`_
* `server_notification for 2023.2 Bobcat`_
.. _VNF LCM v2 API:
https://docs.openstack.org/api-ref/nfv-orchestration/v2/vnflcm.html
.. _NFV-SOL001 v2.6.1:
https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/001/02.06.01_60/gs_nfv-sol001v020601p.pdf
.. _Show VNF LCM OP OCC:
https://docs.openstack.org/api-ref/nfv-orchestration/v2/vnflcm.html#show-vnf-lcm-operation-occurrence-v2
.. _error_network for 2023.2 Bobcat:
https://opendev.org/openstack/tacker/src/branch/stable/2023.2/tacker/tests/functional/sol_v2_common/samples/error_network
.. _server_notification for 2023.2 Bobcat:
https://opendev.org/openstack/tacker/src/branch/stable/2023.2/tacker/tests/functional/sol_v2_common/samples/server_notification

View File

@ -12,6 +12,7 @@ faultID attribute in the fault event and determines whether
AutoHealing should be performed. In case of performing AutoHealing,
VMs are deleted or created.
Configuration
-------------
@ -23,25 +24,26 @@ To enable FaultNotification, be sure to set true for
:header-rows: 1
:widths: 20 10 40
* - Configuration
* - Configuration (CONF.server_notification)
- Default
- Description
* - ``CONF.server_notification.server_notification``
* - ``server_notification``
- false
- Enable FaultNotification interface.
* - ``CONF.server_notification.uri_path_prefix``
* - ``uri_path_prefix``
- /server_notification
- Uri path prefix string for FaultNotification interface.
When changing this configuration,
server_notification description in api-paste.ini
must be changed to the same value.
* - ``CONF.server_notification.timer_interval``
* - ``timer_interval``
- 20
- When multiple fault events for a vnf instance are
notified in the ``timer_interval`` seconds,
Tacker packs these notifications into single event.
By doing this, Tacker can avoid making too many healing request.
System
------
@ -81,8 +83,10 @@ to achieve interface registration and enabling monitoring.
| +-------------+ +-------------+ +-------------+ |
+------------------------------------------------------------------------------------------+
For details about the interface,
please refer to [#fault_notification_apiref]_.
please refer to `Fault Notification Interface`_.
Mgmt driver script
------------------
@ -94,6 +98,7 @@ interface registration and enabling monitoring is
Put this script into target VNF package and Server Notifier
can detect fault event on the VNF.
LCM interface
-------------
@ -106,8 +111,8 @@ The ``additionalParams`` must be set when using FaultNotification.
``Only the additionalParams and the vnfConfigurableProperties for
FaultNotification are described here``.
| **Method type**: POST
| **URL for the resource**: /vnflcm/v2/vnf_instances/
{vnfInstanceId}/instantiate
| **URL for the resource**:
/vnflcm/v2/vnf_instances/{vnfInstanceId}/instantiate
| **Request**:
.. list-table::
@ -130,6 +135,7 @@ The ``additionalParams`` must be set when using FaultNotification.
- Additional input parameters for the instantiation process,
specific to the VNF being instantiated.
.. list-table::
:header-rows: 1
:widths: 18 18 10 50
@ -138,13 +144,14 @@ The ``additionalParams`` must be set when using FaultNotification.
- Data type
- Cardinality
- Description
* - isAutohealEnabled:
* - isAutohealEnabled
- boolean
- 0..1
- If present, the VNF supports auto-healing. If set to
true, auto-healing is currently enabled.
If set to false, autohealing is currently disabled.
.. list-table::
:header-rows: 1
:widths: 18 18 10 50
@ -162,6 +169,7 @@ The ``additionalParams`` must be set when using FaultNotification.
- 1..N
- List of string that indicates which type of alarms to detect.
The value of ``ServerNotifierUri`` and ``ServerNotifierFaultID`` are stored
in ``instantiatedVnfInfo`` of vnfInstance. The values can be shown
with vnflcm show command. For example:
@ -184,6 +192,7 @@ with vnflcm show command. For example:
| | .... |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Auto Healing
------------
@ -195,6 +204,7 @@ whether AutoHealing should be performed. In case of performing
AutoHealing, VMs are deleted and created via Heat. The client is
no need to handle healing.
Using Vendor Specific Plugin
----------------------------
@ -207,16 +217,17 @@ tacker.sol_refactored.common.monitoring_plugin_base.MonitoringPlugin.
:header-rows: 1
:widths: 40 40 40
* - Configuration
* - Configuration (CONF.server_notification)
- Default
- Description
* - ``CONF.server_notification.server_notification_package``
* - ``server_notification_package``
- tacker.sol_refactored.common.server_notification
- Package name for server notification.
* - ``CONF.server_notification.server_notification_class``
* - ``server_notification_class``
- ServerNotification
- Class name for server notification.
Error-handling
--------------
@ -228,7 +239,7 @@ user wants to call MgmtDriver in the rollback operation of error-handling,
the VNF Package needs to be modified in advance.
For the specific modification method, please refer to
`how to error-handling when using MgmtDriver`_.
``Error-handling of MgmtDriver`` in :doc:`/user/v2/error_handling`.
.. note::
@ -236,13 +247,9 @@ For the specific modification method, please refer to
LCM fails, the user can perform error-handling operations.
For details, please refer to the content of
`Retry VNF LCM Operation`_ and `Rollback VNF LCM Operation`_.
``Retry VNF LCM Operation`` and ``Rollback VNF LCM Operation`` in
:doc:`/user/v2/error_handling`.
References
==========
.. [#fault_notification_apiref] https://docs.openstack.org/api-ref/nfv-orchestration/v2/fault_notification.html
.. _how to error-handling when using MgmtDriver : https://docs.openstack.org/tacker/latest/user/etsi_vnf_error_handling.html#error-handling-of-mgmtdriver
.. _Retry VNF LCM Operation : https://docs.openstack.org/tacker/latest/user/etsi_vnf_error_handling.html#retry-vnf-lcm-operation
.. _Rollback VNF LCM Operation : https://docs.openstack.org/tacker/latest/user/etsi_vnf_error_handling.html#rollback-vnf-lcm-operation
.. _Fault Notification Interface:
https://docs.openstack.org/api-ref/nfv-orchestration/v2/fault_notification.html

View File

@ -0,0 +1,26 @@
heat_template_version: 2013-05-23
description: 'VDU1 HOT for Sample VNF'
parameters:
flavor:
type: string
image:
type: string
net:
type: string
resources:
VDU1:
type: OS::Nova::Server
properties:
flavor: { get_param: flavor }
image: { get_param: image }
name: VDU1
networks:
- port:
get_resource: VDU1_CP1
VDU1_CP1:
type: OS::Neutron::Port
properties:
network: { get_param: net }

View File

@ -0,0 +1,27 @@
heat_template_version: 2013-05-23
description: 'imple Base HOT for Sample VNF'
parameters:
nfv:
type: json
resources:
VDU1:
type: VDU1.yaml
properties:
flavor: { get_param: [ nfv, VDU, VDU1, computeFlavourId ] }
image: { get_param: [ nfv, VDU, VDU1, vcImageId ] }
net: { get_resource: internalVL1 }
internalVL1:
type: OS::Neutron::Net
internalVL1_subnet:
type: OS::Neutron::Subnet
properties:
ip_version: 4
network:
get_resource: internalVL1
cidr: 10.0.0.0/24
outputs: {}

View File

@ -0,0 +1,182 @@
tosca_definitions_version: tosca_simple_yaml_1_2
description: Simple deployment flavour for Sample VNF
imports:
- etsi_nfv_sol001_common_types.yaml
- etsi_nfv_sol001_vnfd_types.yaml
- sample_vnfd_types.yaml
topology_template:
inputs:
descriptor_id:
type: string
descriptor_version:
type: string
provider:
type: string
product_name:
type: string
software_version:
type: string
vnfm_info:
type: list
entry_schema:
type: string
flavour_id:
type: string
flavour_description:
type: string
substitution_mappings:
node_type: company.provider.VNF
properties:
flavour_id: simple
node_templates:
VNF:
type: company.provider.VNF
properties:
flavour_description: A simple flavour
interfaces:
Vnflcm:
instantiate_start: []
instantiate_end: []
terminate_start: []
terminate_end: []
modify_information_start: []
modify_information_end: []
heal_start: []
heal_end: []
scale_start: []
scale_end: []
VDU1:
type: tosca.nodes.nfv.Vdu.Compute
properties:
name: VDU1
description: VDU1 compute node
vdu_profile:
min_number_of_instances: 1
max_number_of_instances: 3
sw_image_data:
name: cirros-0.5.2-x86_64-disk
version: '0.5.2'
checksum:
algorithm: sha-256
hash: 932fcae93574e242dc3d772d5235061747dfe537668443a1f0567d893614b464
container_format: bare
disk_format: qcow2
min_disk: 1 GB
size: 1 GB
capabilities:
virtual_compute:
properties:
requested_additional_capabilities:
properties:
requested_additional_capability_name: m1.tiny
support_mandatory: true
target_performance_parameters:
entry_schema: test
virtual_memory:
virtual_mem_size: 512 MB
virtual_cpu:
num_virtual_cpu: 1
virtual_local_storage:
- size_of_storage: 1 GB
CP1:
type: tosca.nodes.nfv.VduCp
properties:
layer_protocols: [ ipv4 ]
order: 4
requirements:
- virtual_binding: VDU1
- virtual_link: internalVL1
internalVL1:
type: tosca.nodes.nfv.VnfVirtualLink
properties:
connectivity_type:
layer_protocols: [ ipv4 ]
description: Internal Virtual link in the VNF
vl_profile:
max_bitrate_requirements:
root: 1048576
leaf: 1048576
min_bitrate_requirements:
root: 1048576
leaf: 1048576
virtual_link_protocol_data:
- associated_layer_protocol: ipv4
l3_protocol_data:
ip_version: ipv4
cidr: 10.0.0.0/24
policies:
- scaling_aspects:
type: tosca.policies.nfv.ScalingAspects
properties:
aspects:
VDU1_scale:
name: VDU1_scale
description: VDU1 scaling aspect
max_scale_level: 2
step_deltas:
- delta_1
- VDU1_initial_delta:
type: tosca.policies.nfv.VduInitialDelta
properties:
initial_delta:
number_of_instances: 1
targets: [ VDU1 ]
- VDU1_scaling_aspect_deltas:
type: tosca.policies.nfv.VduScalingAspectDeltas
properties:
aspect: VDU1_scale
deltas:
delta_1:
number_of_instances: 1
targets: [ VDU1 ]
- instantiation_levels:
type: tosca.policies.nfv.InstantiationLevels
properties:
levels:
instantiation_level_1:
description: Smallest size
scale_info:
VDU1_scale:
scale_level: 0
instantiation_level_2:
description: Largest size
scale_info:
VDU1_scale:
scale_level: 2
default_level: instantiation_level_1
- VDU1_instantiation_levels:
type: tosca.policies.nfv.VduInstantiationLevels
properties:
levels:
instantiation_level_1:
number_of_instances: 1
instantiation_level_2:
number_of_instances: 3
targets: [ VDU1 ]
- internalVL1_instantiation_levels:
type: tosca.policies.nfv.VirtualLinkInstantiationLevels
properties:
levels:
instantiation_level_1:
bitrate_requirements:
root: 1048576
leaf: 1048576
instantiation_level_2:
bitrate_requirements:
root: 1048576
leaf: 1048576
targets: [ internalVL1 ]

View File

@ -0,0 +1,28 @@
tosca_definitions_version: tosca_simple_yaml_1_2
description: Sample VNF
imports:
- etsi_nfv_sol001_common_types.yaml
- etsi_nfv_sol001_vnfd_types.yaml
- sample_vnfd_types.yaml
- sample_vnfd_df_simple.yaml
topology_template:
inputs:
selected_flavour:
type: string
description: VNF deployment flavour selected by the consumer. It is provided in the API
node_templates:
VNF:
type: company.provider.VNF
properties:
flavour_id: { get_input: selected_flavour }
descriptor_id: b1bb0ce7-ebca-4fa7-95ed-4840d70a1177
provider: Company
product_name: Sample VNF
software_version: '1.0'
descriptor_version: '1.0'
vnfm_info:
- Tacker

View File

@ -0,0 +1,51 @@
tosca_definitions_version: tosca_simple_yaml_1_2
description: VNF type definition
imports:
- etsi_nfv_sol001_common_types.yaml
- etsi_nfv_sol001_vnfd_types.yaml
node_types:
company.provider.VNF:
derived_from: tosca.nodes.nfv.VNF
properties:
descriptor_id:
type: string
constraints: [ valid_values: [ b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 ] ]
default: b1bb0ce7-ebca-4fa7-95ed-4840d70a1177
descriptor_version:
type: string
constraints: [ valid_values: [ '1.0' ] ]
default: '1.0'
provider:
type: string
constraints: [ valid_values: [ 'Company' ] ]
default: 'Company'
product_name:
type: string
constraints: [ valid_values: [ 'Sample VNF' ] ]
default: 'Sample VNF'
software_version:
type: string
constraints: [ valid_values: [ '1.0' ] ]
default: '1.0'
vnfm_info:
type: list
entry_schema:
type: string
constraints: [ valid_values: [ Tacker ] ]
default: [ Tacker ]
flavour_id:
type: string
constraints: [ valid_values: [ simple ] ]
default: simple
flavour_description:
type: string
default: This is the default flavour description
requirements:
- virtual_link_internal:
capability: tosca.capabilities.nfv.VirtualLinkable
interfaces:
Vnflcm:
type: tosca.interfaces.nfv.Vnflcm

View File

@ -0,0 +1,4 @@
TOSCA-Meta-File-Version: 1.0
Created-by: Dummy User
CSAR-Version: 1.1
Entry-Definitions: Definitions/sample_vnfd_top.yaml

View File

@ -0,0 +1,3 @@
{
"flavourId": "simple"
}

View File

@ -0,0 +1,7 @@
{
"flavourId":"simple",
"additionalParams": {
"lcm-operation-user-data": "./UserData/userdata_standard.py",
"lcm-operation-user-data-class": "StandardUserData"
}
}

View File

@ -0,0 +1,8 @@
auth_url: 'http://192.168.56.10/identity'
username: "nfv_user"
password: "devstack"
project_name: "nfv"
domain_name: "default"
project_domain_name: "default"
user_domain_name: "default"
cert_verify: "False"

View File

@ -0,0 +1,12 @@
@startuml
scale 300 width
nwdiag {
network internalVL1 {
address = "10.0.0.0/24"
vdu [description="VDU1\n(cirros)" address=CP1];
}
}
@enduml

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="256.9061px" preserveAspectRatio="none" style="width:301px;height:256px;background:#FFFFFF;" version="1.1" viewBox="0 0 301 256" width="301.6575px" zoomAndPan="magnify"><defs/><g><text fill="#000000" font-family="sans-serif" font-size="19.8895" lengthAdjust="spacing" textLength="107.7348" x="23.2044" y="27.5164">internalVL1</text><text fill="#000000" font-family="sans-serif" font-size="19.8895" lengthAdjust="spacing" textLength="122.6519" x="8.2873" y="50.941">10.0.0.0/24</text><rect fill="#E2E2F0" height="8.2873" style="stroke:#181818;stroke-width:1.6574585635359116;" width="149.1713" x="139.2265" y="27.5682"/><path d="M217.1271,35.8555 L217.1271,96.3155 " fill="none" style="stroke:#181818;stroke-width:1.6574585635359116;"/><text fill="#000000" font-family="sans-serif" font-size="18.232" lengthAdjust="spacing" textLength="34.8066" x="199.7238" y="68.8323">CP1</text><rect fill="#F1F1F1" height="79.9983" style="stroke:#181818;stroke-width:0.8287292817679558;" width="99.4475" x="164.0884" y="96.3155"/><text fill="#000000" font-family="sans-serif" font-size="19.8895" lengthAdjust="spacing" textLength="54.6961" x="180.663" y="132.1192">VDU1</text><text fill="#000000" font-family="sans-serif" font-size="19.8895" lengthAdjust="spacing" textLength="66.2983" x="180.663" y="155.5437">(cirros)</text><!--SRC=[AqvEp4bLC3OmK2ZFJ2d9uEBAAq_9J4nNgEPI08Ayr9Bo_A9iXSoyajIYlCISC1z3g0m89AQa5AKM5olOAYWP6kY1eRwHYH9SlYobL24w9RKukIYpe2GpFyzMASmbr30cJoCviwWelrXJ2MQ2hNE0OQmrM5yjLoqN0000]--></g></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,840 @@
..
Copyright 2014-2015 OpenStack Foundation
All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
==============================
Getting Started with v2 Tacker
==============================
Summary
-------
This lecture enables you to:
- create & delete a sample VNF on the OpenStack with Tacker v2 API
Following two types of VNF deployment supported by Tacker are introduced in
this lecture.
- :doc:`/user/v2/vnf/deployment_with_tosca/index`
- :doc:`/user/v2/vnf/deployment_with_user_data/index`
"VNF Deployment with LCM Operation User Data" is optional.
The part will be clarified with the notation [This is UserData specific part].
The following figure shows a sample VNF used in this lecture.
.. figure:: img/sample-vnf.svg
:align: left
.. note::
VIM config, a VNF package, and instantiation parameters files
used in this tutorial are placed at the repository.
- `tacker/doc/user/v2/getting_started/conf`_
.. note::
You can see logs of Tacker with this command:
.. code-block:: console
$ sudo journalctl -u devstack@tacker.service
$ sudo journalctl -u devstack@tacker-conductor.service
Prerequisites
-------------
The following packages should be installed:
* tacker
* python-tackerclient
Configuration
^^^^^^^^^^^^^
Load credentials for client operations
""""""""""""""""""""""""""""""""""""""
Before any Tacker commands can be run, your credentials need to be sourced.
.. note::
See `Create OpenStack client environment scripts`_ for details.
In this document, the settings are as follows:
.. code-block::
OS_REGION_NAME=RegionOne
OS_PROJECT_DOMAIN_ID=default
OS_CACERT=
OS_AUTH_URL=http://192.168.56.10/identity
OS_TENANT_NAME=nfv
OS_USER_DOMAIN_ID=default
OS_USERNAME=nfv_user
OS_VOLUME_API_VERSION=3
OS_AUTH_TYPE=password
OS_PROJECT_NAME=nfv
OS_PASSWORD=devstack
OS_IDENTITY_API_VERSION=3
You can confirm that Tacker is available by checking this command works without
error:
.. code-block:: console
$ openstack vim list
.. note::
See :doc:`/cli/index` to find all the available commands.
Register VIM
------------
#. Prepare VIM configuration file:
You can use a setup script for generating VIM configuration or edit it from
scratch as described in :doc:`/reference/vim_config`.
This script finds parameters for the configuration, such as user
name or password, from your environment variables.
Here is an example of generating OpenStack VIM configuration as
``vim_config.yaml``. In this document, ``TACKER_ROOT`` is the root of
tacker's repository on your server.
.. code-block:: console
$ bash TACKER_ROOT/tools/gen_vim_config.sh -p nfv --os-user nfv_user \
--os-disable-cert-verify
Config for OpenStack VIM 'vim_config.yaml' generated.
There are several options for configuring parameters from command
line supported. Refer help with ``-h`` for details.
.. note::
See :doc:`/reference/vim_config` for tool details.
You can also use a sample configuration file (vim_config.yaml) instead of
using the script.
.. code-block:: console
$ cp TACKER_ROOT/doc/source/user/v2/getting_started/conf/vim_config.yaml ./
$ vi vim_config.yaml
.. literalinclude:: conf/vim_config.yaml
:language: yaml
#. Register Default VIM:
Once you setup VIM configuration file, you register default VIM via
``openstack`` command with ``--is-default`` option.
.. code-block:: console
$ openstack vim register --config-file ./vim_config.yaml \
--is-default --fit-width openstack-admin-vim
+----------------+-----------------------------------------------------+
| Field | Value |
+----------------+-----------------------------------------------------+
| auth_cred | { |
| | "username": "nfv_user", |
| | "user_domain_name": "default", |
| | "cert_verify": "False", |
| | "project_id": null, |
| | "project_name": "nfv", |
| | "project_domain_name": "default", |
| | "auth_url": "http://192.168.56.10/identity/v3", |
| | "key_type": "barbican_key", |
| | "secret_uuid": "***", |
| | "password": "***" |
| | } |
| auth_url | http://192.168.56.10/identity/v3 |
| created_at | 2023-11-30 08:32:48.869451 |
| description | |
| extra | |
| id | bff267c4-6fc9-46b5-be53-15a6a3680033 |
| is_default | True |
| name | openstack-admin-vim |
| placement_attr | { |
| | "regions": [ |
| | "RegionOne" |
| | ] |
| | } |
| project_id | ebbc6cf1a03d49918c8e408535d87268 |
| status | ACTIVE |
| type | openstack |
| updated_at | None |
| vim_project | { |
| | "name": "nfv", |
| | "project_domain_name": "default" |
| | } |
+----------------+-----------------------------------------------------+
Create and Upload VNF Package
-----------------------------
Prepare VNF Package
^^^^^^^^^^^^^^^^^^^
#. Create VNF Package CSAR directories:
.. code-block:: console
$ mkdir -p ./sample_vnf_package_csar/TOSCA-Metadata \
./sample_vnf_package_csar/Definitions \
./sample_vnf_package_csar/BaseHOT/simple/nested \
./sample_vnf_package_csar/Files
[This is UserData specific part] When using UserData, create the following directories in addition.
.. code-block:: console
$ mkdir -p ./sample_vnf_package_csar/UserData
#. Create a ``TOSCA.meta`` file:
.. code-block:: console
$ vi ./sample_vnf_package_csar/TOSCA-Metadata/TOSCA.meta
.. literalinclude:: conf/TOSCA-Metadata/TOSCA.meta
:language: text
#. Download ETSI definition files:
You should set ``${TOSCA_VERSION}`` to one of the appropriate TOSCA service
template versions (`SOL001`_), e.g., ``export TOSCA_VERSION=v2.6.1``.
.. important::
You should also check if the version of TOSCA service template is
supported by tacker.
See :doc:`/user/vnfd-sol001` for supported version.
.. code-block:: console
$ cd ./sample_vnf_package_csar/Definitions
$ wget https://forge.etsi.org/rep/nfv/SOL001/raw/${TOSCA_VERSION}/etsi_nfv_sol001_common_types.yaml
$ wget https://forge.etsi.org/rep/nfv/SOL001/raw/${TOSCA_VERSION}/etsi_nfv_sol001_vnfd_types.yaml
#. Create VNFD files:
- Create ``sample_vnfd_top.yaml``
.. code-block:: console
$ vi ./sample_vnfd_top.yaml
.. literalinclude:: conf/Definitions/sample_vnfd_top.yaml
:language: yaml
- Create ``sample_vnfd_types.yaml``
.. code-block:: console
$ vi ./sample_vnfd_types.yaml
.. literalinclude:: conf/Definitions/sample_vnfd_types.yaml
:language: yaml
.. note::
``description_id`` shall be globally unique, i.e., you cannot create
multiple VNFDs with the same ``description_id``.
- Create ``sample_vnfd_df_simple.yaml``
.. code-block:: console
$ vi ./sample_vnfd_df_simple.yaml
.. literalinclude:: conf/Definitions/sample_vnfd_df_simple.yaml
:language: yaml
.. note::
The ``flavour_description`` should be updated by the property in "VNF" but
Tacker cannot handle it. After the instantiation, the default value in
``sample_vnfd_types.yaml`` is always used.
#. Create BaseHOT files:
.. code-block:: console
$ cd -
$ vi ./sample_vnf_package_csar/BaseHOT/simple/sample_lcm_hot.yaml
$ vi ./sample_vnf_package_csar/BaseHOT/simple/nested/VDU1.yaml
- sample_lcm_hot.yaml
.. literalinclude:: conf/BaseHOT/simple/sample_lcm_hot.yaml
:language: yaml
- VDU1.yaml
.. literalinclude:: conf/BaseHOT/simple/nested/VDU1.yaml
:language: yaml
#. [This is UserData specific part] Create UserData files:
.. code-block:: console
$ cd ./sample_vnf_package_csar/UserData/
$ touch ./__init__.py
$ vi ./lcm_user_data.py
.. note::
See :doc:`/user/userdata_script` for details.
In this document, the following "StandardUserData" is used.
.. literalinclude:: ../../../../../tacker/sol_refactored/infra_drivers/openstack/userdata_standard.py
:language: python
#. Compress the VNF Package CSAR to zip:
.. code-block:: console
$ cd -
$ cd ./sample_vnf_package_csar
$ zip sample_vnf_package_csar.zip \
-r TOSCA-Metadata/ Definitions/ BaseHOT/ Files/
The contents of the zip file should look something like this.
.. code-block:: console
$ unzip -Z -1 sample_vnf_package_csar.zip
TOSCA-Metadata/
TOSCA-Metadata/TOSCA.meta
Definitions/
Definitions/sample_vnfd_types.yaml
Definitions/etsi_nfv_sol001_vnfd_types.yaml
Definitions/etsi_nfv_sol001_common_types.yaml
Definitions/sample_vnfd_df_simple.yaml
Definitions/sample_vnfd_top.yaml
BaseHOT/
BaseHOT/simple/
BaseHOT/simple/nested/
BaseHOT/simple/nested/VDU1.yaml
BaseHOT/simple/sample_lcm_hot.yaml
Files/
- [This is UserData specific part] When using UserData, add ``UserData`` directories.
.. code-block:: console
$ zip sample_vnf_package_csar.zip -r UserData/
The contents of the zip file should look something like this.
.. code-block:: console
$ unzip -Z -1 sample_vnf_package_csar.zip
TOSCA-Metadata/
TOSCA-Metadata/TOSCA.meta
Definitions/
Definitions/sample_vnfd_types.yaml
Definitions/etsi_nfv_sol001_vnfd_types.yaml
Definitions/etsi_nfv_sol001_common_types.yaml
Definitions/sample_vnfd_df_simple.yaml
Definitions/sample_vnfd_top.yaml
BaseHOT/
BaseHOT/simple/
BaseHOT/simple/nested/
BaseHOT/simple/nested/VDU1.yaml
BaseHOT/simple/sample_lcm_hot.yaml
Files/
UserData/
UserData/__init__.py
UserData/lcm_user_data.py
Here, you can find the structure of the sample VNF Package CSAR as a
zip file.
Create VNF Package
^^^^^^^^^^^^^^^^^^
#. Execute vnfpkgm create:
Take a note of "VNF Package ID" as it will be used in the next step.
.. code-block:: console
$ cd -
$ openstack vnf package create
+-------------------+-------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------+-------------------------------------------------------------------------------------------------+
| ID | 6e6b7a6d-0ebe-4085-96c2-b34269d837f9 |
| Links | { |
| | "self": { |
| | "href": "/vnfpkgm/v1/vnf_packages/6e6b7a6d-0ebe-4085-96c2-b34269d837f9" |
| | }, |
| | "packageContent": { |
| | "href": "/vnfpkgm/v1/vnf_packages/6e6b7a6d-0ebe-4085-96c2-b34269d837f9/package_content" |
| | } |
| | } |
| Onboarding State | CREATED |
| Operational State | DISABLED |
| Usage State | NOT_IN_USE |
| User Defined Data | {} |
+-------------------+-------------------------------------------------------------------------------------------------+
Upload VNF Package
^^^^^^^^^^^^^^^^^^
#. Execute vnfpkgm upload:
The "VNF Package ID" ``6e6b7a6d-0ebe-4085-96c2-b34269d837f9`` needs to be
replaced with the appropriate one that was obtained from `Create VNF
Package`.
.. code-block:: console
$ openstack vnf package upload \
--path ./sample_vnf_package_csar/sample_vnf_package_csar.zip \
6e6b7a6d-0ebe-4085-96c2-b34269d837f9
Upload request for VNF package 6e6b7a6d-0ebe-4085-96c2-b34269d837f9 has been accepted.
Check the created VNF Package
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#. Confirm the "Onboarding State" to be ``ONBOARDED``:
.. code-block:: console
$ openstack vnf package list
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
| Id | Vnf Product Name | Onboarding State | Usage State | Operational State | Links |
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
| 6e6b7a6d-0ebe-4085-96c2-b34269d837f9 | Sample VNF | ONBOARDED | NOT_IN_USE | ENABLED | { |
| | | | | | "self": { |
| | | | | | "href": "/vnfpkgm/v1/vnf_packages/6e6b7a6d-0ebe-4085-96c2-b34269d837f9" |
| | | | | | }, |
| | | | | | "packageContent": { |
| | | | | | "href": "/vnfpkgm/v1/vnf_packages/6e6b7a6d-0ebe-4085-96c2-b34269d837f9/package_content" |
| | | | | | } |
| | | | | | } |
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
Create & Instantiate VNF
------------------------
Create VNF
^^^^^^^^^^
#. Find "VNFD ID" to create VNF:
The "VNFD ID" can be found to be ``b1bb0ce7-ebca-4fa7-95ed-4840d70a1177`` in
the example.
.. code-block:: console
$ openstack vnf package show \
6e6b7a6d-0ebe-4085-96c2-b34269d837f9 -c 'VNFD ID'
+---------+--------------------------------------+
| Field | Value |
+---------+--------------------------------------+
| VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
+---------+--------------------------------------+
#. Create VNF:
The "VNFD ID" ``b1bb0ce7-ebca-4fa7-95ed-4840d70a1177`` needs to be replaced
with the appropriate one.
.. code-block:: console
$ openstack vnflcm create b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 \
--os-tacker-api-version 2
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
| ID | c98b05c7-bc96-43f8-a688-4d8079ffa3bf |
| Instantiation State | NOT_INSTANTIATED |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/c98b05c7-bc96-43f8-a688-4d8079ffa3bf" |
| | }, |
| | "instantiate": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/c98b05c7-bc96-43f8-a688-4d8079ffa3bf/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 | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
| VNFD Version | 1.0 |
+-----------------------------+------------------------------------------------------------------------------------------------------------------+
Instantiate VNF
^^^^^^^^^^^^^^^
#. Create ``<param-file>``:
Required parameter:
- flavourID
Optional parameters:
- instantiationLevelId
- extVirtualLinks
- extManagedVirtualLinks
- vimConnectionInfo
- localizationLanguage
- additionalParams
- extensions
- vnfConfigurableProperties
.. note::
You can skip ``vimConnectionInfo`` only when you have the default VIM.
A sample ``<param-file>`` named as ``sample_request.json`` with
minimal parameter:
.. code-block:: console
$ vi ./sample_request.json
.. literalinclude:: conf/sample_request.json
:language: json
- [This is UserData specific part] When using UserData, use the following parameters instead.
.. literalinclude:: conf/sample_request_for_userdata.json
:language: json
.. note::
``userdata_standard.py`` should be replaced with the UserData file name.
And ``StandardUserData`` should be replaced with the UserData class name.
#. Instantiate VNF:
The "ID of vnf instance" and "path to <param-file>" are needed to
instantiate vnf.
.. code-block:: console
$ openstack vnflcm instantiate c98b05c7-bc96-43f8-a688-4d8079ffa3bf \
./sample_request.json --os-tacker-api-version 2
Instantiate request for VNF Instance c98b05c7-bc96-43f8-a688-4d8079ffa3bf has been accepted.
Check the details of the instantiated vnf.
.. code-block:: console
$ openstack vnflcm list --os-tacker-api-version 2
+--------------------------------------+-------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| ID | VNF Instance Name | Instantiation State | VNF Provider | VNF Software Version | VNF Product Name | VNFD ID |
+--------------------------------------+-------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| c98b05c7-bc96-43f8-a688-4d8079ffa3bf | | INSTANTIATED | Company | 1.0 | Sample VNF | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
+--------------------------------------+-------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
$ openstack vnflcm show c98b05c7-bc96-43f8-a688-4d8079ffa3bf \
--fit-width --os-tacker-api-version 2
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| ID | c98b05c7-bc96-43f8-a688-4d8079ffa3bf |
| Instantiated Vnf Info | { |
| | "flavourId": "simple", |
| | "vnfState": "STARTED", |
| | "scaleStatus": [ |
| | { |
| | "aspectId": "VDU1_scale", |
| | "scaleLevel": 0 |
| | } |
| | ], |
| | "maxScaleLevels": [ |
| | { |
| | "aspectId": "VDU1_scale", |
| | "scaleLevel": 2 |
| | } |
| | ], |
| | "vnfcResourceInfo": [ |
| | { |
| | "id": "6d01be26-f2be-421d-8c87-a4aa9d39300e", |
| | "vduId": "VDU1", |
| | "computeResource": { |
| | "vimConnectionId": "bff267c4-6fc9-46b5-be53-15a6a3680033", |
| | "resourceId": "6d01be26-f2be-421d-8c87-a4aa9d39300e", |
| | "vimLevelResourceType": "OS::Nova::Server" |
| | }, |
| | "vnfcCpInfo": [ |
| | { |
| | "id": "CP1-6d01be26-f2be-421d-8c87-a4aa9d39300e", |
| | "cpdId": "CP1" |
| | } |
| | ], |
| | "metadata": { |
| | "creation_time": "2023-12-01T06:57:11Z", |
| | "stack_id": "vnf-c98b05c7-bc96-43f8-a688-4d8079ffa3bf-VDU1-6523jolwu66g/09019137-3b71-426e-8726-8572657999b2", |
| | "vdu_idx": null, |
| | "flavor": "m1.tiny", |
| | "image-VDU1": "cirros-0.5.2-x86_64-disk" |
| | } |
| | } |
| | ], |
| | "vnfVirtualLinkResourceInfo": [ |
| | { |
| | "id": "ffa3b9cf-5135-4dc6-a7a1-dd1912d72363", |
| | "vnfVirtualLinkDescId": "internalVL1", |
| | "networkResource": { |
| | "vimConnectionId": "bff267c4-6fc9-46b5-be53-15a6a3680033", |
| | "resourceId": "ffa3b9cf-5135-4dc6-a7a1-dd1912d72363", |
| | "vimLevelResourceType": "OS::Neutron::Net" |
| | } |
| | } |
| | ], |
| | "vnfcInfo": [ |
| | { |
| | "id": "VDU1-6d01be26-f2be-421d-8c87-a4aa9d39300e", |
| | "vduId": "VDU1", |
| | "vnfcResourceInfoId": "6d01be26-f2be-421d-8c87-a4aa9d39300e", |
| | "vnfcState": "STARTED" |
| | } |
| | ], |
| | "metadata": { |
| | "stack_id": "0b1b274c-a493-4a2c-994f-ee8569ff111c", |
| | "nfv": { |
| | "VDU": { |
| | "VDU1": { |
| | "computeFlavourId": "m1.tiny", |
| | "vcImageId": "cirros-0.5.2-x86_64-disk" |
| | } |
| | } |
| | }, |
| | "tenant": "nfv" |
| | } |
| | } |
| Instantiation State | INSTANTIATED |
| Links | { |
| | "self": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/c98b05c7-bc96-43f8-a688-4d8079ffa3bf" |
| | }, |
| | "terminate": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/c98b05c7-bc96-43f8-a688-4d8079ffa3bf/terminate" |
| | }, |
| | "scale": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/c98b05c7-bc96-43f8-a688-4d8079ffa3bf/scale" |
| | }, |
| | "heal": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/c98b05c7-bc96-43f8-a688-4d8079ffa3bf/heal" |
| | }, |
| | "changeExtConn": { |
| | "href": "http://127.0.0.1:9890/vnflcm/v2/vnf_instances/c98b05c7-bc96-43f8-a688-4d8079ffa3bf/change_ext_conn" |
| | } |
| | } |
| VIM Connection Info | { |
| | "default": { |
| | "vimId": "bff267c4-6fc9-46b5-be53-15a6a3680033", |
| | "vimType": "ETSINFV.OPENSTACK_KEYSTONE.V_3", |
| | "interfaceInfo": { |
| | "endpoint": "http://192.168.56.10/identity/v3", |
| | "skipCertificateHostnameCheck": true, |
| | "skipCertificateVerification": true |
| | }, |
| | "accessInfo": { |
| | "username": "nfv_user", |
| | "region": "RegionOne", |
| | "project": "nfv", |
| | "projectDomain": "default", |
| | "userDomain": "default" |
| | }, |
| | "extra": {} |
| | } |
| | } |
| VNF Configurable Properties | |
| VNF Instance Description | |
| VNF Instance Name | |
| VNF Product Name | Sample VNF |
| VNF Provider | Company |
| VNF Software Version | 1.0 |
| VNFD ID | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
| VNFD Version | 1.0 |
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------+
Terminate & Delete VNF
----------------------
Terminate VNF
^^^^^^^^^^^^^
#. Check the VNF Instance ID to terminate:
.. code-block:: console
$ openstack vnflcm list --os-tacker-api-version 2
+--------------------------------------+-------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| ID | VNF Instance Name | Instantiation State | VNF Provider | VNF Software Version | VNF Product Name | VNFD ID |
+--------------------------------------+-------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| c98b05c7-bc96-43f8-a688-4d8079ffa3bf | | INSTANTIATED | Company | 1.0 | Sample VNF | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
+--------------------------------------+-------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
#. Terminate VNF Instance:
Execute terminate command:
.. code-block:: console
$ openstack vnflcm terminate c98b05c7-bc96-43f8-a688-4d8079ffa3bf --os-tacker-api-version 2
Terminate request for VNF Instance 'c98b05c7-bc96-43f8-a688-4d8079ffa3bf' has been accepted.
Check the status of VNF Instance:
.. code-block:: console
$ openstack vnflcm list --os-tacker-api-version 2
+--------------------------------------+-------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| ID | VNF Instance Name | Instantiation State | VNF Provider | VNF Software Version | VNF Product Name | VNFD ID |
+--------------------------------------+-------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| c98b05c7-bc96-43f8-a688-4d8079ffa3bf | | NOT_INSTANTIATED | Company | 1.0 | Sample VNF | b1bb0ce7-ebca-4fa7-95ed-4840d70a1177 |
+--------------------------------------+-------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
Delete VNF
^^^^^^^^^^
#. Delete VNF Instance:
.. code-block:: console
$ openstack vnflcm delete c98b05c7-bc96-43f8-a688-4d8079ffa3bf
Vnf instance 'c98b05c7-bc96-43f8-a688-4d8079ffa3bf' is deleted successfully
Delete VNF Package
------------------
#. Delete VNF Package:
Check the VNF Package ID to delete:
.. code-block:: console
$ openstack vnf package list
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
| Id | Vnf Product Name | Onboarding State | Usage State | Operational State | Links |
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
| 6e6b7a6d-0ebe-4085-96c2-b34269d837f9 | Sample VNF | ONBOARDED | NOT_IN_USE | ENABLED | { |
| | | | | | "self": { |
| | | | | | "href": "/vnfpkgm/v1/vnf_packages/6e6b7a6d-0ebe-4085-96c2-b34269d837f9" |
| | | | | | }, |
| | | | | | "packageContent": { |
| | | | | | "href": "/vnfpkgm/v1/vnf_packages/6e6b7a6d-0ebe-4085-96c2-b34269d837f9/package_content" |
| | | | | | } |
| | | | | | } |
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
Update the Operational State to ``DISABLED``:
.. code-block:: console
$ openstack vnf package update --operational-state 'DISABLED' \
6e6b7a6d-0ebe-4085-96c2-b34269d837f9
+-------------------+----------+
| Field | Value |
+-------------------+----------+
| Operational State | DISABLED |
+-------------------+----------+
Check the Operational State to be changed:
.. code-block:: console
$ openstack vnf package list
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
| Id | Vnf Product Name | Onboarding State | Usage State | Operational State | Links |
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
| 6e6b7a6d-0ebe-4085-96c2-b34269d837f9 | Sample VNF | ONBOARDED | NOT_IN_USE | DISABLED | { |
| | | | | | "self": { |
| | | | | | "href": "/vnfpkgm/v1/vnf_packages/6e6b7a6d-0ebe-4085-96c2-b34269d837f9" |
| | | | | | }, |
| | | | | | "packageContent": { |
| | | | | | "href": "/vnfpkgm/v1/vnf_packages/6e6b7a6d-0ebe-4085-96c2-b34269d837f9/package_content" |
| | | | | | } |
| | | | | | } |
+--------------------------------------+------------------+------------------+-------------+-------------------+-------------------------------------------------------------------------------------------------+
Delete the VNF Package:
.. code-block:: console
$ openstack vnf package delete 6e6b7a6d-0ebe-4085-96c2-b34269d837f9
All specified vnf-package(s) deleted successfully
.. _tacker/doc/user/v2/getting_started/conf:
https://opendev.org/openstack/tacker/src/branch/master/doc/user/v2/getting_started/conf
.. _Create OpenStack client environment scripts: https://docs.openstack.org/keystone/latest/install/keystone-openrc-rdo.html
.. _SOL001: https://forge.etsi.org/rep/nfv/SOL001

View File

@ -24,13 +24,14 @@ External Monitoring Tool sends an alert to Prometheus Plugin.
.. note::
PM/FM only support CNF.
Performance Management and Fault Management support only CNF.
AutoScaling and AutoHealing support both CNF and VNF.
AutoScale/Heal support both CNF and VNF.
The External Monitoring Tool is implemented by each operators,
thus it is not included in Tacker.
Configuration
~~~~~~~~~~~~~
@ -43,49 +44,51 @@ performance_management, fault_management, auto_scaling or auto_healing below.
:header-rows: 1
:widths: 20 10 40
* - Configuration
* - Configuration (CONF.prometheus_plugin)
- Default
- Description
* - ``CONF.prometheus_plugin.performance_management``
* - ``performance_management``
- false
- Enable prometheus plugin performance management.
* - ``CONF.prometheus_plugin.reporting_period_margin``
* - ``reporting_period_margin``
- 1
- Some margin time for PM jos's reportingPeriod.
When multiple alerts are received within a time period
shorter than (reportingPeriod - reporting_period_margin),
the subsequent alerts are ignored.
* - ``CONF.prometheus_plugin.fault_management``
* - ``fault_management``
- false
- Enable prometheus plugin fault management.
* - ``CONF.prometheus_plugin.auto_scaling``
* - ``auto_scaling``
- false
- Enable prometheus plugin autoscaling.
* - ``CONF.prometheus_plugin.auto_healing``
* - ``auto_healing``
- false
- Enable prometheus plugin autohealing.
* - ``CONF.prometheus_plugin.timer_interval``
* - ``timer_interval``
- 20
- When multiple auto heal alerts for a VNF instance are
notified in the ``timer_interval`` seconds,
Tacker packs these notifications into single event.
By doing this, Tacker can avoid making too many healing requests.
* - ``CONF.prometheus_plugin.test_rule_with_promtool``
* - ``test_rule_with_promtool``
- false
- Enable rule file validation using promtool.
* - ``CONF.prometheus_plugin.reporting_period_threshold``
* - ``reporting_period_threshold``
- 90
- The time of reportingPeriod for the pm threshold.
* - ``CONF.prometheus_plugin.collection_period_threshold``
* - ``collection_period_threshold``
- 30
- The time of collectionPeriod for the pm threshold.
Prerequisite
------------
There is another prerequisite for using the AutoScale/Heal function.
There is another prerequisite for using the AutoScaling/AutoHealing
function.
When instantiate VNF, you need to add the parameter
``isAutoscaleEnabled/isAutohealEnabled`` to ``True`` in the request body.
``isAutoscaleEnabled/isAutohealEnabled`` to ``true`` in the request body.
The example reference is as follows:
@ -100,10 +103,11 @@ The example reference is as follows:
...
},
"vnfConfigurableProperties": {
"isAutoscaleEnabled": True
"isAutoscaleEnabled": true
}
}
System
~~~~~~
@ -111,8 +115,8 @@ Prometheus Plugin needs external service called External
Monitoring Tool.
Prometheus Plugin operates the External Monitoring Tool
along the Performance Management, Fault Management, Auto scaling or
Auto healing.
along the Performance Management, Fault Management, AutoScaling or
AutoHealing.
The flow of each process is as follows.
- ``ETSI NFV-SOL 002/003 based Performance Management Job``
@ -141,6 +145,7 @@ The flow of each process is as follows.
| +------------+ +------------+ +------------+ |
+----------------------------------------------------+
- ``ETSI NFV-SOL 002/003 based Performance Management Threshold``
.. code-block:: console
@ -167,6 +172,7 @@ The flow of each process is as follows.
| +------------+ +------------+ +------------+ |
+----------------------------------------------------------+
- ``ETSI NFV-SOL 002/003 based Fault Management``
.. code-block:: console
@ -191,6 +197,7 @@ The flow of each process is as follows.
| +------------+ +------------+ +------------+ |
+----------------------------------------------------+
- ``Prometheus Plugin AutoScaling``
.. code-block:: console
@ -214,6 +221,7 @@ The flow of each process is as follows.
| +------------+ +------------+ +------------+ |
+----------------------------------------------------+
- ``Prometheus Plugin AutoHealing``
.. code-block:: console
@ -237,14 +245,16 @@ The flow of each process is as follows.
| +------------+ +------------+ +------------+ |
+----------------------------------------------------+
External Monitoring Tool
~~~~~~~~~~~~~~~~~~~~~~~~
External Monitoring Tool is consist of Prometheus Server,
AlertManager and SSH Server.
Alertmanager and SSH Server.
This section describes the requirements for each service.
Prometheus Server
-----------------
@ -275,17 +285,10 @@ For example:
- targets: ["<worker1 exporter host>"]
metrics_path: "/api/v1/nodes/worker1/proxy/metrics/resource"
- job_name: "k8smetricscadvisorworker1"
static_configs:
- targets: ["<worker1 exporter host>"]
metrics_path: "/api/v1/nodes/worker1/proxy/metrics/cadvisor"
- job_name: "k8smetricsresourceworker2"
static_configs:
- targets: ["<worker2 exporter host>"]
metrics_path: "/api/v1/nodes/worker2/proxy/metrics/resource"
- job_name: "k8smetricscadvisorworker2"
static_configs:
- targets: ["<worker2 exporter host>"]
metrics_path: "/api/v1/nodes/worker2/proxy/metrics/cadvisor"
static_configs:
- targets: ["<worker1 exporter host>"]
metrics_path: "/api/v1/nodes/worker1/proxy/metrics/cadvisor"
Alert Manager
-------------
@ -299,11 +302,9 @@ For example:
route:
group_by:
- "kubestatemetrics"
- "k8smetricsresourceworker1"
- "k8smetricscadvisorworker1"
- "k8smetricsresourceworker2"
- "k8smetricscadvisorworker2"
- "kubestatemetrics"
- "k8smetricsresourceworker1"
- "k8smetricscadvisorworker1"
group_wait: 30s
group_interval: 30s
repeat_interval: 30s
@ -332,7 +333,7 @@ For example:
- url: "http://<tacker_host>/pm_event"
- name: vnfpm-threshold
webhook_configs:
- url: "http://<tacker_host>/vnfpm_threshold"
- url: "http://<tacker_host>/pm_threshold"
- name: vnffm
webhook_configs:
- url: "http://<tacker_host>/alert"
@ -343,6 +344,7 @@ For example:
webhook_configs:
- url: "http://<tacker_host>/alert/auto_healing"
SSH server
----------
@ -353,6 +355,7 @@ needs to activate sshd.
- The directory indicated by "rule_files" setting of prometheus
server config should be accessible by SSH.
Supported versions
------------------
@ -371,6 +374,7 @@ Tacker Bobcat and Caracal release
- Prometheus: 2.45
- Alertmanager: 0.26
Alert rule registration
~~~~~~~~~~~~~~~~~~~~~~~
@ -386,48 +390,50 @@ at "metadata" field.
.. code-block:: json
{
"objectType": "Vnf",
"objectInstanceIds": ["507280d8-bfc5-4b88-904b-9280ba6bc3ea"],
"criteria": {
"performanceMetric": [
"VMemoryUsageMeanVnf.507280d8-bfc5-4b88-904b-9280ba6bc3ea"],
"collectionPeriod": 30,
"reportingPeriod": 90,
"reportingBoundary": "2099-08-05T02:24:46Z"
},
"callbackUri": "<client_callback_uri>",
"metadata": {
"monitoring": {
"monitorName": "prometheus",
"driverType": "external",
"targetsInfo": [
{
"prometheusHost": "<prometheus_server_hostname>",
"authInfo": {
"ssh_username": "ubuntu",
"ssh_password": "ubuntu"
},
"alertRuleConfigPath":
"/etc/prometheus/rules",
"prometheusReloadApiEndpoint":
"http://<prometheus_server_hostname>/-/reload"
}
]
}
}
}
{
"objectType": "Vnf",
"objectInstanceIds": ["a0205e7c-fdeb-4f6c-b266-962246e32626"],
"criteria": {
"performanceMetric": ["VMemoryUsageMeanVnf.a0205e7c-fdeb-4f6c-b266-962246e32626"],
"performanceMetricGroup": [],
"collectionPeriod": 30,
"reportingPeriod": 60
},
"callbackUri": "http://127.0.0.1:9990/notification/callbackuri/a0205e7c-fdeb-4f6c-b266-962246e32626",
"metadata": {
"monitoring": {
"monitorName": "prometheus",
"driverType": "external",
"targetsInfo": [
{
"prometheusHost": "192.168.121.35",
"prometheusHostPort": 22,
"authInfo": {
"ssh_username": "vagrant",
"ssh_password": "vagrant"
},
"alertRuleConfigPath":
"/etc/prometheus/rules",
"prometheusReloadApiEndpoint":
"http://192.168.121.35:9090/-/reload"
}
]
}
}
}
.. note::
With the parameter, pod name can be specified but container name can not.
And some prometheus metrics need container name. Therefore, ``max``
statement of PromQL is alternatively used in some measurements to
measure without container name. That means it provides only most
impacted value among the containers. For example:
With the parameter, pod name can be specified but container name can not.
And some prometheus metrics need container name. Therefore, ``max``
statement of PromQL is alternatively used in some measurements to
measure without container name. That means it provides only most
impacted value among the containers. For example:
``avg(max(container_fs_usage_bytes{pod=~"pod name"} /
container_fs_limit_bytes{pod=~"pod name"}))``
``avg(max(container_fs_usage_bytes{pod=~"pod name"} /
container_fs_limit_bytes{pod=~"pod name"}))``
ETSI NFV-SOL 002/003 based Performance Management Threshold
-----------------------------------------------------------
@ -441,50 +447,52 @@ at "metadata" field.
.. code-block:: json
{
"objectType": "Vnf",
"objectInstanceId": "511a2d68-c975-4913-b7b8-d75468e3102b",
"criteria": {
"performanceMetric": "VMemoryUsageMeanVnf.511a2d68-c975-4913-b7b8-d75468e3102b",
"thresholdType": "SIMPLE",
"simpleThresholdDetails": {
"thresholdValue": 55,
"hysteresis": 30
}
},
"callbackUri": "<client_callback_uri>",
"metadata": {
"monitoring": {
"monitorName": "prometheus",
"driverType": "external",
"targetsInfo": [
{
"prometheusHost": "<prometheus_server_hostname>",
"prometheusHostPort": 22,
"authInfo": {
"ssh_username": "ubuntu",
"ssh_password": "ubuntu"
},
"alertRuleConfigPath":
"/etc/prometheus/rules",
"prometheusReloadApiEndpoint":
"http://<prometheus_server_hostname>/-/reload"
}
]
}
}
}
{
"objectType": "Vnf",
"objectInstanceId": "c21fd71b-2866-45f6-89d0-70c458a5c32e",
"criteria": {
"performanceMetric": "VMemoryUsageMeanVnf.c21fd71b-2866-45f6-89d0-70c458a5c32e",
"thresholdType": "SIMPLE",
"simpleThresholdDetails": {
"thresholdValue": 1,
"hysteresis": 0.5
}
},
"callbackUri": "http://127.0.0.1:9990/notification/callbackuri/c21fd71b-2866-45f6-89d0-70c458a5c32e",
"metadata": {
"monitoring": {
"monitorName": "prometheus",
"driverType": "external",
"targetsInfo": [
{
"prometheusHost": "192.168.121.35",
"prometheusHostPort": 22,
"authInfo": {
"ssh_username": "vagrant",
"ssh_password": "vagrant"
},
"alertRuleConfigPath":
"/etc/prometheus/rules",
"prometheusReloadApiEndpoint":
"http://192.168.121.35:9090/-/reload"
}
]
}
}
}
.. note::
With the parameter, pod name can be specified but container name can not.
And some prometheus metrics need container name. Therefore, ``max``
statement of PromQL is alternatively used in some measurements to
measure without container name. That means it provides only most
impacted value among the containers. For example:
With the parameter, pod name can be specified but container name can not.
And some prometheus metrics need container name. Therefore, ``max``
statement of PromQL is alternatively used in some measurements to
measure without container name. That means it provides only most
impacted value among the containers. For example:
``avg(max(container_fs_usage_bytes{pod=~"pod name"} /
container_fs_limit_bytes{pod=~"pod name"}))``
``avg(max(container_fs_usage_bytes{pod=~"pod name"} /
container_fs_limit_bytes{pod=~"pod name"}))``
ETSI NFV-SOL 002/003 based Fault Management
-------------------------------------------
@ -492,25 +500,32 @@ ETSI NFV-SOL 002/003 based Fault Management
Registration of alerting rule is performed by updating
rule file directly. Below is an example of alert rule.
.. code-block:: yaml
.. code-block:: json
{
"groups": [{
"name": "fm_test",
"rules": [{
"alert": "fm_test",
"expr": "max(sum(rate(pod_cpu_usage_seconds_total{pod='curry-probe-test001-798d577c96-5624p'}[1m]))) > 0.1",
"for": "30s",
"labels": {
"receiver_type": "tacker",
"function_type": "vnffm",
"vnf_instance_id": "c21fd71b-2866-45f6-89d0-70c458a5c32e",
"pod": "curry-probe-test001-798d577c96-5624p",
"perceived_severity": "CRITICAL",
"event_type": "PROCESSING_ERROR_ALARM"
},
"annotations": {
"probable_cause": "Process Terminated",
"fault_type": "fault_type",
"fault_details": "fault_details"
}
}]
}]
}
groups:
- name: example
rules:
- alert: Test
expr: sum(pod_memory_working_set_bytes{namespace="default"}) > 10000000000
for: 30s
labels:
receiver_type: tacker
function_type: vnffm
vnf_instance_id: 3721ab69-3f33-44bc-85f1-f416ad1b765e
pod: test\\-test1\\-[0-9a-f]{1,10}-[0-9a-z]{5}$
perceived_severity: CRITICAL
event_type: PROCESSING_ERROR_ALARM
annotations:
probable_cause: Server is down.
fault_type: Error
fault_details: Fault detail
Prometheus Plugin AutoScaling
-----------------------------
@ -518,21 +533,26 @@ Prometheus Plugin AutoScaling
Registration of alerting rule is performed by updating
rule file directly. Below is an example of alert rule.
.. code-block:: yaml
.. code-block:: json
{
"groups": [{
"name": "scale_out_test",
"rules": [{
"alert": "scale_out_test",
"expr": "max(sum(rate(pod_cpu_usage_seconds_total{pod='curry-probe-test001-798d577c96-8qtg2'}[1m]))) > 0.1",
"for": "30s",
"labels": {
"receiver_type": "tacker",
"function_type": "auto_scale",
"vnf_instance_id": "fa82d5bf-c6c1-4ece-bf16-9cf9325a171a",
"auto_scale_type": "SCALE_OUT",
"aspect_id": "vdu1_aspect"
}
}]
}]
}
groups:
- name: example
rules:
- alert: Test
expr: sum(pod_memory_working_set_bytes{namespace="default"}) > 10000000000
for: 30s
labels:
receiver_type: tacker
function_type: auto_scale
vnf_instance_id: 3721ab69-3f33-44bc-85f1-f416ad1b765e
auto_scale_type: SCALE_OUT
aspect_id: VDU1_aspect
annotations:
Prometheus Plugin AutoHealing
-----------------------------
@ -540,20 +560,25 @@ Prometheus Plugin AutoHealing
Registration of alerting rule is performed by updating
rule file directly. Below is example of alert rule.
.. code-block:: yaml
.. code-block:: json
{
"groups": [{
"name": "heal_all_test_1",
"rules": [{
"alert": "heal_all_test_1",
"expr": "max(sum(rate(pod_cpu_usage_seconds_total{pod='curry-probe-test001-798d577c96-dc5rh'}[1m]))) > 0.1",
"for": "30s",
"labels": {
"receiver_type": "tacker",
"function_type": "auto_heal",
"vnf_instance_id": "c44e89ad-6743-4b80-8df8-fe4aa4d83f44",
"vnfc_info_id": "VDU1-curry-probe-test001-798d577c96-dc5rh"
}
}]
}]
}
groups:
- name: example
rules:
- alert: Test
expr: sum(pod_memory_working_set_bytes{namespace="default"}) > 10000000000
for: 30s
labels:
receiver_type: tacker
function_type: auto_heal
vnf_instance_id: 3721ab69-3f33-44bc-85f1-f416ad1b765e
vnfc_info_id: VDU1-85adebfa-d71c-49ab-9d39-d8dd7e393541
annotations:
External data file
~~~~~~~~~~~~~~~~~~
@ -568,6 +593,7 @@ at etc/tacker/prometheus-plugin.yaml from the tacker project source directory.
Edit this file if you need and put it in the configuration directory
(e.g. /etc/tacker).
Default configuration file
--------------------------
@ -579,17 +605,19 @@ execute below command at the top directory of tacker project.
sudo python3 ./setup.py install
Data format
-----------
The file is described in yaml format [#yaml]_.
The file is described in yaml format.
Root configuration
------------------
The configuration consists of PromQL config for PMJob API and
PromQL config for Threshold API. The PMJob and the Threshold are
defined in ETSI GS NFV-SOL 003 [#etsi_sol_003]_.
defined in `ETSI GS NFV-SOL 003`_.
.. code-block:: yaml
@ -600,12 +628,13 @@ defined in ETSI GS NFV-SOL 003 [#etsi_sol_003]_.
Threshold:
PromQL: <PromQLConfig>
<PromQLConfig>
--------------
The elements of PromQLConfig are key-value pairs of a performanceMetric
and a PromQL statement. These performanceMetric are defined in
ETSI GS NFV-SOL 003 [#etsi_sol_003]_.
`ETSI GS NFV-SOL 003`_.
.. code-block:: yaml
@ -625,6 +654,7 @@ ETSI GS NFV-SOL 003 [#etsi_sol_003]_.
ByteOutgoingVnfExtCp: <F-string of PromQL statement>
PacketOutgoingVnfExtCp: <F-string of PromQL statement>
For example, VCpuUsageMeanVnf can be described as below.
.. code-block:: yaml
@ -633,12 +663,13 @@ For example, VCpuUsageMeanVnf can be described as below.
avg(sum(rate(pod_cpu_usage_seconds_total
{{namespace="{namespace}",pod=~"{pod}"}}[{reporting_period}s])))
F-string of PromQL statement
----------------------------
For above PromQL statement, f-string of python [#f_string]_ is used.
For above PromQL statement, `f-string`_ of python is used.
In the f-string, below replacement field can be used. They are replaced
with a SOL-API's attribute [#etsi_sol_003]_ or Tacker internal value.
with a SOL-API's attribute(`ETSI GS NFV-SOL 003`_) or Tacker internal value.
``{collection_period}``
Replaced with collectionPeriod attribute of SOL-API.
@ -656,6 +687,7 @@ with a SOL-API's attribute [#etsi_sol_003]_ or Tacker internal value.
``{namespace}``
Replaced with the kubernetes namespace that the vnfInstance belongs to.
Using Vendor Specific Plugin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -668,41 +700,55 @@ tacker.sol_refactored.common.monitoring_plugin_base.MonitoringPlugin.
:header-rows: 1
:widths: 40 40 40
* - Configuration
* - Configuration (CONF.prometheus_plugin)
- Default
- Description
* - ``CONF.prometheus_plugin.performance_management_package``
- tacker.sol_refactored.common.prometheus_plugin
* - ``performance_management_package``
- | tacker.sol_refactored.common
| .prometheus_plugin
- Package name for performance management job.
* - ``CONF.prometheus_plugin.performance_management_threshold_package``
- tacker.sol_refactored.common.prometheus_plugin
* - | ``performance_management``
| ``_threshold_package``
- | tacker.sol_refactored.common
| .prometheus_plugin
- Package name for performance management threshold.
* - ``CONF.prometheus_plugin.performance_management_class``
* - ``performance_management_class``
- PrometheusPluginPm
- Class name for performance management job.
* - ``CONF.prometheus_plugin.performance_management_threshold_class``
* - | ``performance_management``
| ``_threshold_class``
- PrometheusPluginThreshold
- Class name for performance management threshold.
* - ``CONF.prometheus_plugin.fault_management_package``
- tacker.sol_refactored.common.prometheus_plugin
* - ``fault_management_package``
- | tacker.sol_refactored.common
| .prometheus_plugin
- Package name for fault management.
* - ``CONF.prometheus_plugin.fault_management_class``
* - ``fault_management_class``
- PrometheusPluginFm
- Class name for fault management.
* - ``CONF.prometheus_plugin.auto_scaling_package``
- tacker.sol_refactored.common.prometheus_plugin
* - ``auto_scaling_package``
- | tacker.sol_refactored.common
| .prometheus_plugin
- Package name for auto scaling.
* - ``CONF.prometheus_plugin.auto_scaling_class``
* - ``auto_scaling_class``
- PrometheusPluginAutoScaling
- Class name for auto scaling.
* - ``CONF.prometheus_plugin.auto_healing_package``
- tacker.sol_refactored.common.prometheus_plugin
* - ``auto_healing_package``
- | tacker.sol_refactored.common
| .prometheus_plugin
- Package name for auto healing.
* - ``CONF.prometheus_plugin.auto_healing_class``
* - ``auto_healing_class``
- PrometheusPluginAutoHealing
- Class name for auto healing.
.. rubric:: Footnotes
.. [#yaml] https://yaml.org/spec/1.2-old/spec.html
.. [#etsi_sol_003] https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/03.03.01_60/gs_nfv-sol003v030301p.pdf
.. [#f_string] https://docs.python.org/3.9/tutorial/inputoutput.html#fancier-output-formatting
History of Checks
-----------------
The content of this document has been confirmed to work
using Prometheus 2.45 and Alertmanager 0.26.
.. _ETSI GS NFV-SOL 003:
https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/03.03.01_60/gs_nfv-sol003v030301p.pdf
.. _f-string: https://docs.python.org/3.11/tutorial/inputoutput.html#fancier-output-formatting

View File

@ -0,0 +1,172 @@
===================
v2 Tacker Use Cases
===================
VNF
___
Deploy
^^^^^^
VM
~~
.. toctree::
:maxdepth: 1
vnf/deployment_with_tosca/index
vnf/deployment_with_user_data/index
Container
~~~~~~~~~
.. toctree::
:maxdepth: 1
cnf/deployment/index
cnf/deployment_using_helm/index
Scale
^^^^^
VM
~~
.. toctree::
:maxdepth: 1
vnf/scale/index
Container
~~~~~~~~~
.. toctree::
:maxdepth: 1
cnf/scale/index
Heal
^^^^
VM
~~
.. toctree::
:maxdepth: 1
vnf/heal/index
Container
~~~~~~~~~
.. toctree::
:maxdepth: 1
cnf/heal/index
Update
^^^^^^
VM
~~
.. toctree::
:maxdepth: 1
vnf/update
Container
~~~~~~~~~
.. toctree::
:maxdepth: 1
cnf/update
Change External VNF Connectivity
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
VM
~~
.. toctree::
:maxdepth: 1
vnf/chg_ext_conn
Change Current VNF Package
^^^^^^^^^^^^^^^^^^^^^^^^^^
VM
~~
.. toctree::
:maxdepth: 1
vnf/chg_vnfpkg/index
vnf/chg_vnfpkg_with_standard/index
vnf/coordinate_api_client_script
Container
~~~~~~~~~
.. toctree::
:maxdepth: 1
cnf/chg_vnfpkg/index
Error Handling
^^^^^^^^^^^^^^
.. toctree::
:maxdepth: 1
error_handling
db_sync_error_handling
placement_error_handling
Management Driver
^^^^^^^^^^^^^^^^^
Container Update
~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 1
cnf/update_with_mgmt_driver/index
FaultNotification AutoHealing
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 1
fault_notification
Prometheus Plugin
^^^^^^^^^^^^^^^^^
.. toctree::
:maxdepth: 1
prometheus_plugin
Container
~~~~~~~~~
.. toctree::
:maxdepth: 1
cnf/auto_scale_pm_job/index
cnf/auto_scale_pm_th/index
cnf/auto_heal_fm/index

View File

@ -0,0 +1,326 @@
=============================================
ETSI NFV-SOL Change External VNF Connectivity
=============================================
This document describes how to change external VNF connectivity
in Tacker v2 API.
Prerequisites
-------------
The following packages should be installed:
* tacker
* python-tackerclient
Execute up to "Instantiate VNF" in the procedure of
:doc:`/user/v2/vnf/deployment_with_user_data/index`.
In other words, the procedure after "Terminate VNF" is not executed.
Change External VNF Connectivity
--------------------------------
As mentioned in Prerequisites, the VNF must be created
before performing change external connectivity.
Assuming that the following VNF instance exists,
this instance will be changed.
Details of CLI commands are described in
:doc:`/cli/cli-etsi-vnflcm`.
For changing external VNF connectivity, you need to prepare a JSON-formatted
definition file before running command for changing the connectivity.
.. code-block:: json
{
"extVirtualLinks": [
{
"id": "ced0c31f-bb03-4351-90af-8c51f59bcf25",
"vimConnectionId": "vim1",
"resourceProviderId": "671cb532-4139-45e6-b873-b06b4864f0ab",
"resourceId": "dcdd8e59-d303-4659-bdff-d32f2cb2b806",
"extCps": [
{
"cpdId": "VDU1_CP1",
"cpConfig": {
"VDU1_CP1": {
"cpProtocolData": [
{
"layerProtocol": "IP_OVER_ETHERNET",
"ipOverEthernet": {
"ipAddresses": [
{
"type": "IPV4",
"numDynamicAddresses": 1,
"subnetId": "ab38a204-8c01-4205-95c6-b4e74198700f"
}
]
}
}
]
}
}
},
{
"cpdId": "VDU2_CP2",
"cpConfig": {
"VDU2_CP2": {
"cpProtocolData": [
{
"layerProtocol": "IP_OVER_ETHERNET",
"ipOverEthernet": {
"ipAddresses": [
{
"type": "IPV4",
"fixedAddresses": [
"22.22.22.101"
],
"subnetId": "ab38a204-8c01-4205-95c6-b4e74198700f"
},
{
"type": "IPV6",
"numDynamicAddresses": 1,
"subnetId": "3f023732-8364-43e0-80de-00799d5b78af"
}
]
}
}
]
}
}
}
]
}
],
"vimConnectionInfo": {
"vim1": {
"vimId": "f7ed00b1-06f1-4076-95dc-c6ed11f5541c",
"vimType": "ETSINFV.OPENSTACK_KEYSTONE.V_3",
"interfaceInfo": {
"endpoint": "http://localhost/identity/v3"
},
"accessInfo": {
"username": "nfv_user",
"region": "RegionOne",
"password": "devstack",
"project": "nfv",
"projectDomain": "Default",
"userDomain": "Default"
},
"extra": {
"dummy-key": "dummy-val"
}
}
},
"additionalParams": {
"dummy-key": "dummy-val",
"lcm-operation-user-data": "./UserData/userdata_standard.py",
"lcm-operation-user-data-class": "StandardUserData"
}
}
.. note::
sample_param_file.json contains all the data of port resource information.
If no setting is contained, it is treated as a change in information.
.. note::
The change external VNF Connectivity operation can change the
``vimConnectionInfo`` associated with an existing VNF instance.
Even if change external VNF Connectivity operation specify multiple
``vimConnectionInfo`` associated with one VNF instance, only one of
them will be used for life cycle management operations.
It is not possible to delete the key of registered ``vimConnectionInfo``.
How to Change the Specific Port Setting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Execute Change External VNF Connectivity CLI command and check 'ID' and
'Stack Status' of the stack before and after operation.
This is to confirm that stack 'ID' has no change before and after operation,
and that the Stack update has been completed successfully.
See `Heat CLI reference`_. for details on Heat CLI commands.
Stack information before operation:
.. code-block:: console
$ openstack stack list -c 'ID' -c 'Stack Name' -c 'Stack Status'
Result:
.. code-block:: console
+--------------------------------------+------------------------------------------+-----------------+
| ID | Stack Name | Stack Status |
+--------------------------------------+------------------------------------------+-----------------+
| 7a53b676-aa9c-4c7d-a8a7-1311646ec7e2 | vnf-df9150a0-8679-4b14-8cbc-9d2d6606ca7c | CREATE_COMPLETE |
+--------------------------------------+------------------------------------------+-----------------+
Stack resource information:
.. code-block:: console
$ openstack stack resource list HEAT_STACK_ID
Result:
.. code-block:: console
+--------------------+--------------------------------------+------------------------+-----------------+----------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time |
+--------------------+--------------------------------------+------------------------+-----------------+----------------------+
| VDU1-0 | ea178dfa-5148-4be0-9508-58c94989b76a | VDU1.yaml | CREATE_COMPLETE | 2023-11-13T04:14:13Z |
| VDU1-VolumeType | dc71e318-74f3-43dc-ad79-7503846384c7 | OS::Cinder::VolumeType | CREATE_COMPLETE | 2023-11-13T04:14:13Z |
| VDU2-0 | cf97ee84-1681-4498-a0eb-e42f1de2a845 | VDU2.yaml | CREATE_COMPLETE | 2023-11-13T04:14:13Z |
| VDU2-VolumeType | 322d5605-3409-4c63-b776-d8486a7593fe | OS::Cinder::VolumeType | CREATE_COMPLETE | 2023-11-13T04:14:13Z |
| internalVL3_subnet | 360ec318-5f7d-4f56-b9cc-a089695b24ae | OS::Neutron::Subnet | CREATE_COMPLETE | 2023-11-13T04:14:13Z |
| internalVL3 | 90d2c767-2b54-4c02-85aa-7bb1ff9f4d14 | OS::Neutron::Net | CREATE_COMPLETE | 2023-11-13T04:14:13Z |
+--------------------+--------------------------------------+------------------------+-----------------+----------------------+
Stack resource detailed information:
.. code-block:: console
$ openstack stack resource show HEAT_STACK_ID VDU2_CP2 \
-f json | jq .attributes.fixed_ips
Result:
.. code-block:: console
[
{
"subnet_id": "a1d042f3-88aa-4150-b42b-8620c9be746c",
"ip_address": "100.100.100.11"
},
{
"subnet_id": "a12a1603-a30d-4724-80fb-9a7019a3c79f",
"ip_address": "1111:2222:3333::18d"
}
]
Change External VNF Connectivity execution of the entire VNF:
.. code-block:: console
$ openstack vnflcm change-ext-conn VNF_INSTANCE_ID sample_param_file.json \
--os-tacker-api-version 2
Result:
.. code-block:: console
Change External VNF Connectivity for VNF Instance df9150a0-8679-4b14-8cbc-9d2d6606ca7c has been accepted.
.. note::
Create a parameter file that describes the resource information to be changed in advance.
Stack information after operation:
.. code-block:: console
$ openstack stack list -c 'ID' -c 'Stack Name' -c 'Stack Status'
Result:
.. code-block:: console
+--------------------------------------+------------------------------------------+-----------------+
| ID | Stack Name | Stack Status |
+--------------------------------------+------------------------------------------+-----------------+
| 7a53b676-aa9c-4c7d-a8a7-1311646ec7e2 | vnf-df9150a0-8679-4b14-8cbc-9d2d6606ca7c | UPDATE_COMPLETE |
+--------------------------------------+------------------------------------------+-----------------+
.. note::
'Stack Status' transitions to UPDATE_COMPLETE.
Stack resource information:
.. code-block:: console
$ openstack stack resource list HEAT_STACK_ID
Result:
.. code-block:: console
+--------------------+--------------------------------------+------------------------+-----------------+----------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time |
+--------------------+--------------------------------------+------------------------+-----------------+----------------------+
| VDU1-0 | ea178dfa-5148-4be0-9508-58c94989b76a | VDU1.yaml | UPDATE_COMPLETE | 2023-11-13T07:54:47Z |
| VDU1-VolumeType | dc71e318-74f3-43dc-ad79-7503846384c7 | OS::Cinder::VolumeType | CREATE_COMPLETE | 2023-11-13T04:14:13Z |
| VDU2-0 | cf97ee84-1681-4498-a0eb-e42f1de2a845 | VDU2.yaml | UPDATE_COMPLETE | 2023-11-13T07:54:46Z |
| VDU2-VolumeType | 322d5605-3409-4c63-b776-d8486a7593fe | OS::Cinder::VolumeType | CREATE_COMPLETE | 2023-11-13T04:14:13Z |
| internalVL3_subnet | 360ec318-5f7d-4f56-b9cc-a089695b24ae | OS::Neutron::Subnet | CREATE_COMPLETE | 2023-11-13T04:14:13Z |
| internalVL3 | 90d2c767-2b54-4c02-85aa-7bb1ff9f4d14 | OS::Neutron::Net | CREATE_COMPLETE | 2023-11-13T04:14:13Z |
+--------------------+--------------------------------------+------------------------+-----------------+----------------------+
Stack resource detailed information:
.. code-block:: console
$ openstack stack resource show HEAT_STACK_ID VDU2_CP2 \
-f json | jq .attributes.fixed_ips
Result:
.. code-block:: console
[
{
"subnet_id": "3f023732-8364-43e0-80de-00799d5b78af",
"ip_address": "1111:2222:4444::39f"
},
{
"subnet_id": "ab38a204-8c01-4205-95c6-b4e74198700f",
"ip_address": "22.22.22.101"
}
]
.. note::
'fixed_ips' has changed from the IP before change external VNF
connectivity.
See `Heat CLI reference`_. for details on Heat CLI commands.
History of Checks
-----------------
The content of this document has been confirmed to work
using the following VNF Package.
* `basic_lcms_max_individual_vnfc for 2023.2 Bobcat`_
.. _Heat CLI reference: https://docs.openstack.org/python-openstackclient/latest/cli/plugin-commands/heat.html
.. _basic_lcms_max_individual_vnfc for 2023.2 Bobcat:
https://opendev.org/openstack/tacker/src/branch/stable/2023.2/tacker/tests/functional/sol_v2_common/samples/basic_lcms_max_individual_vnfc

View File

@ -0,0 +1,54 @@
heat_template_version: 2013-05-23
description: 'Simple Base HOT for Sample VNF'
parameters:
nfv:
type: json
resources:
VDU1_scale:
type: OS::Heat::AutoScalingGroup
properties:
min_size: 1
max_size: 3
desired_capacity: { get_param: [ nfv, VDU, VDU1, desired_capacity ] }
resource:
type: base_hot_nested_VDU1.yaml
properties:
flavor: { get_param: [ nfv, VDU, VDU1, computeFlavourId ] }
image-VDU1: { get_param: [ nfv, VDU, VDU1, vcImageId] }
net1: { get_param: [ nfv, CP, VDU1_CP1, network] }
VDU2:
type: OS::Nova::Server
properties:
flavor: { get_param: [ nfv, VDU, VDU2, computeFlavourId ] }
image: { get_param: [ nfv, VDU, VDU2, vcImageId] }
networks:
- port:
get_resource: VDU2_CP1
VDU2_CP1:
type: OS::Neutron::Port
properties:
network: { get_param: [ nfv, CP, VDU2_CP1, network ] }
fixed_ips:
- ip_address: { get_param: [nfv, CP, VDU2_CP1, fixed_ips, 0, ip_address]}
VDU3:
type: OS::Nova::Server
properties:
flavor: { get_param: [ nfv, VDU, VDU3, computeFlavourId ] }
image: { get_param: [ nfv, VDU, VDU3, vcImageId] }
networks:
- port:
get_resource: VDU3_CP1
VDU3_CP1:
type: OS::Neutron::Port
properties:
network: { get_param: [ nfv, CP, VDU3_CP1, network ] }
fixed_ips:
- ip_address: { get_param: [nfv, CP, VDU3_CP1, fixed_ips, 0, ip_address]}
outputs: {}

View File

@ -0,0 +1,26 @@
heat_template_version: 2013-05-23
description: 'VDU1 HOT for Sample VNF'
parameters:
flavor:
type: string
image-VDU1:
type: string
net1:
type: string
resources:
VDU1:
type: OS::Nova::Server
properties:
flavor: { get_param: flavor }
name: VDU1
image: { get_param: image-VDU1 }
networks:
- port:
get_resource: VDU1_CP1
VDU1_CP1:
type: OS::Neutron::Port
properties:
network: { get_param: net1 }

View File

@ -0,0 +1,280 @@
tosca_definitions_version: tosca_simple_yaml_1_2
description: Simple deployment flavour for Sample VNF
imports:
- etsi_nfv_sol001_common_types.yaml
- etsi_nfv_sol001_vnfd_types.yaml
- change_vnf_pkg_types.yaml
topology_template:
inputs:
descriptor_id:
type: string
descriptor_version:
type: string
provider:
type: string
product_name:
type: string
software_version:
type: string
vnfm_info:
type: list
entry_schema:
type: string
flavour_id:
type: string
flavour_description:
type: string
substitution_mappings:
node_type: company.provider.VNF
properties:
flavour_id: simple
requirements:
virtual_link_external1_1: [ VDU1_CP1, virtual_link ]
virtual_link_external1_2: [ VDU2_CP1, virtual_link ]
virtual_link_external1_3: [ VDU3_CP1, virtual_link ]
node_templates:
VNF:
type: company.provider.VNF
properties:
flavour_description: A simple flavour
interfaces:
Vnflcm:
instantiate: []
instantiate_start: []
instantiate_end: []
terminate: []
terminate_start: []
terminate_end: []
modify_information: []
modify_information_start: []
modify_information_end: []
VDU1:
type: tosca.nodes.nfv.Vdu.Compute
properties:
name: VDU1
description: VDU1 compute node
vdu_profile:
min_number_of_instances: 1
max_number_of_instances: 3
sw_image_data:
name: VDU1-image
version: '0.5.2'
checksum:
algorithm: sha-256
hash: 932fcae93574e242dc3d772d5235061747dfe537668443a1f0567d893614b464
container_format: bare
disk_format: qcow2
min_disk: 0 GB
min_ram: 256 MB
size: 2 GB
capabilities:
virtual_compute:
properties:
requested_additional_capabilities:
properties:
requested_additional_capability_name: m1.tiny
support_mandatory: true
target_performance_parameters:
entry_schema: test
virtual_memory:
virtual_mem_size: 512 MB
virtual_cpu:
num_virtual_cpu: 1
virtual_local_storage:
- size_of_storage: 3 GB
artifacts:
sw_image:
type: tosca.artifacts.nfv.SwImage
file: ../Files/images/cirros-0.5.2-x86_64-disk.img
VDU2:
type: tosca.nodes.nfv.Vdu.Compute
properties:
name: VDU2
description: VDU2 compute node
vdu_profile:
min_number_of_instances: 1
max_number_of_instances: 1
sw_image_data:
name: VDU2-image
version: '0.5.2'
checksum:
algorithm: sha-256
hash: 932fcae93574e242dc3d772d5235061747dfe537668443a1f0567d893614b464
container_format: bare
disk_format: qcow2
min_disk: 0 GB
min_ram: 256 MB
size: 2 GB
capabilities:
virtual_compute:
properties:
requested_additional_capabilities:
properties:
requested_additional_capability_name: m1.small
support_mandatory: true
target_performance_parameters:
entry_schema: test
virtual_memory:
virtual_mem_size: 2048 MB
virtual_cpu:
num_virtual_cpu: 1
virtual_local_storage:
- size_of_storage: 3 GB
artifacts:
sw_image:
type: tosca.artifacts.nfv.SwImage
file: ../Files/images/cirros-0.5.2-x86_64-disk.img
VDU3:
type: tosca.nodes.nfv.Vdu.Compute
properties:
name: VDU3
description: VDU3 compute node
vdu_profile:
min_number_of_instances: 1
max_number_of_instances: 1
sw_image_data:
name: cirros-0.5.2-x86_64-disk
version: '0.5.2'
checksum:
algorithm: sha-256
hash: 932fcae93574e242dc3d772d5235061747dfe537668443a1f0567d893614b464
container_format: bare
disk_format: qcow2
min_disk: 0 GB
min_ram: 256 MB
size: 2 GB
capabilities:
virtual_compute:
properties:
requested_additional_capabilities:
properties:
requested_additional_capability_name: m1.tiny
support_mandatory: true
target_performance_parameters:
entry_schema: test
virtual_memory:
virtual_mem_size: 512 MB
virtual_cpu:
num_virtual_cpu: 1
virtual_local_storage:
- size_of_storage: 3 GB
VDU1_CP1:
type: tosca.nodes.nfv.VduCp
properties:
layer_protocols: [ ipv4 ]
order: 0
requirements:
- virtual_binding: VDU1
VDU2_CP1:
type: tosca.nodes.nfv.VduCp
properties:
layer_protocols: [ ipv4 ]
order: 0
requirements:
- virtual_binding: VDU2
VDU3_CP1:
type: tosca.nodes.nfv.VduCp
properties:
layer_protocols: [ ipv4 ]
order: 0
requirements:
- virtual_binding: VDU3
policies:
- scaling_aspects:
type: tosca.policies.nfv.ScalingAspects
properties:
aspects:
VDU1_scale:
name: VDU1_scale
description: VDU1 scaling aspect
max_scale_level: 2
step_deltas:
- delta_1
- VDU1_initial_delta:
type: tosca.policies.nfv.VduInitialDelta
properties:
initial_delta:
number_of_instances: 2
targets: [ VDU1 ]
- VDU2_initial_delta:
type: tosca.policies.nfv.VduInitialDelta
properties:
initial_delta:
number_of_instances: 1
targets: [ VDU2 ]
- VDU3_initial_delta:
type: tosca.policies.nfv.VduInitialDelta
properties:
initial_delta:
number_of_instances: 1
targets: [ VDU3 ]
- VDU1_scaling_aspect_deltas:
type: tosca.policies.nfv.VduScalingAspectDeltas
properties:
aspect: VDU1_scale
deltas:
delta_1:
number_of_instances: 1
targets: [ VDU1 ]
- instantiation_levels:
type: tosca.policies.nfv.InstantiationLevels
properties:
levels:
instantiation_level_1:
description: Smallest size
scale_info:
VDU1_scale:
scale_level: 0
instantiation_level_2:
description: Largest size
scale_info:
VDU1_scale:
scale_level: 2
default_level: instantiation_level_1
- VDU1_instantiation_levels:
type: tosca.policies.nfv.VduInstantiationLevels
properties:
levels:
instantiation_level_1:
number_of_instances: 1
instantiation_level_2:
number_of_instances: 3
targets: [ VDU1 ]
- VDU2_instantiation_levels:
type: tosca.policies.nfv.VduInstantiationLevels
properties:
levels:
instantiation_level_1:
number_of_instances: 1
instantiation_level_2:
number_of_instances: 1
targets: [ VDU2 ]
- VDU3_instantiation_levels:
type: tosca.policies.nfv.VduInstantiationLevels
properties:
levels:
instantiation_level_1:
number_of_instances: 1
instantiation_level_2:
number_of_instances: 1
targets: [ VDU3 ]

View File

@ -0,0 +1,31 @@
tosca_definitions_version: tosca_simple_yaml_1_2
description: Sample VNF
imports:
- etsi_nfv_sol001_common_types.yaml
- etsi_nfv_sol001_vnfd_types.yaml
- change_vnf_pkg_types.yaml
- change_vnf_pkg_new_df_simple.yaml
topology_template:
inputs:
selected_flavour:
type: string
description: VNF deployment flavour selected by the consumer. It is provided in the API
node_templates:
VNF:
type: company.provider.VNF
properties:
flavour_id: { get_input: selected_flavour }
descriptor_id: 3e7c1be1-ec09-4288-bbf6-e2af08086b61
provider: Company
product_name: Sample VNF
software_version: '1.0'
descriptor_version: '1.0'
vnfm_info:
- Tacker
requirements:
#- virtual_link_external # mapped in lower-level templates
#- virtual_link_internal # mapped in lower-level templates

View File

@ -0,0 +1,55 @@
tosca_definitions_version: tosca_simple_yaml_1_2
description: VNF type definition
imports:
- etsi_nfv_sol001_common_types.yaml
- etsi_nfv_sol001_vnfd_types.yaml
node_types:
company.provider.VNF:
derived_from: tosca.nodes.nfv.VNF
properties:
descriptor_id:
type: string
constraints: [ valid_values: [ 3e7c1be1-ec09-4288-bbf6-e2af08086b61 ] ]
default: 3e7c1be1-ec09-4288-bbf6-e2af08086b61
descriptor_version:
type: string
constraints: [ valid_values: [ '1.0' ] ]
default: '1.0'
provider:
type: string
constraints: [ valid_values: [ 'Company' ] ]
default: 'Company'
product_name:
type: string
constraints: [ valid_values: [ 'Sample VNF' ] ]
default: 'Sample VNF'
software_version:
type: string
constraints: [ valid_values: [ '1.0' ] ]
default: '1.0'
vnfm_info:
type: list
entry_schema:
type: string
constraints: [ valid_values: [ Tacker ] ]
default: [ Tacker ]
flavour_id:
type: string
constraints: [ valid_values: [ simple ] ]
default: simple
flavour_description:
type: string
default: "flavour"
requirements:
- virtual_link_external1:
capability: tosca.capabilities.nfv.VirtualLinkable
- virtual_link_external2:
capability: tosca.capabilities.nfv.VirtualLinkable
- virtual_link_external3:
capability: tosca.capabilities.nfv.VirtualLinkable
interfaces:
Vnflcm:
type: tosca.interfaces.nfv.Vnflcm

View File

@ -0,0 +1,115 @@
# Copyright (C) 2022 Fujitsu
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os
import pickle
import sys
import time
from oslo_log import log as logging
import paramiko
from tacker.sol_refactored.common import exceptions as sol_ex
LOG = logging.getLogger(__name__)
CMD_TIMEOUT = 30
SERVER_WAIT_COMPLETE_TIME = 60
SSH_CONNECT_RETRY_COUNT = 4
class SampleNewCoordinateVNFScript(object):
def __init__(self, vnfc_param):
self.vnfc_param = vnfc_param
def coordinate_vnf(self):
# check ssh connect and os version
"""(YiFeng) Add comment to check ssh access
The next part of code is to check connect VM via ssh.
Since the zuul's network cannot check this content, so
we comment this part of code. If you want to check them
in your local environment, please uncomment.
# user = self.vnfc_param['username']
# password = self.vnfc_param['password']
# host = self.vnfc_param['ssh_ip']
# commander = self._init_commander(
# user, password, host, retry=SSH_CONNECT_RETRY_COUNT)
# ssh_command = 'cat /etc/os-release | grep PRETTY_NAME'
# result = self._execute_command(commander, host, ssh_command)
# os_version = result[0].replace('\n', '').split('=')[1]
# LOG.info('The os version of this new VM is %s', os_version)
"""
pass
def _init_commander(self, user, password, host, retry):
while retry > 0:
try:
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(
host, username=user, password=password)
LOG.info("Connected to %s", host)
return ssh
except paramiko.AuthenticationException as e:
LOG.error("Authentication failed when connecting to %s",
host)
raise sol_ex.VMRunningFailed(e)
except (paramiko.SSHException,
paramiko.ssh_exception.NoValidConnectionsError) as e:
LOG.debug(e)
retry -= 1
if retry == 0:
LOG.error(e)
raise sol_ex.VMRunningFailed(e)
time.sleep(SERVER_WAIT_COMPLETE_TIME)
def _execute_command(self, commander, host, command):
try:
stdin, stdout, stderr = commander.exec_command(command)
cmd_out = stdout.readlines()
cmd_err = stderr.readlines()
return_code = stdout.channel.recv_exit_status()
except paramiko.SSHException as e:
LOG.error("Command execution failed at %s. Giving up", host)
raise e
finally:
commander.close()
if return_code != 0:
error = cmd_err
raise sol_ex.VMRunningFailed(error_info=error)
result = "cmd: %s, stdout: %s, stderr: %s, return code: %s" % (
command, cmd_out, cmd_err, return_code)
LOG.debug("Remote command execution result: %s", result)
return cmd_out
def main():
operation = "coordinate_vnf"
vnfc_param = pickle.load(sys.stdin.buffer)
script = SampleNewCoordinateVNFScript(vnfc_param)
try:
getattr(script, operation)()
except Exception:
raise Exception
if __name__ == "__main__":
try:
main()
os._exit(0)
except Exception as ex:
sys.stderr.write(str(ex))
sys.stderr.flush()
os._exit(1)

View File

@ -0,0 +1,4 @@
TOSCA-Meta-File-Version: 1.0
CSAR-Version: 1.1
Created-by: Onboarding portal
Entry-Definitions: Definitions/change_vnf_pkg_top.vnfd.yaml

View File

@ -0,0 +1,64 @@
{
"vnfdId": "3e7c1be1-ec09-4288-bbf6-e2af08086b61",
"additionalParams": {
"upgrade_type": "RollingUpdate",
"lcm-operation-coordinate-old-vnf": "./Scripts/coordinate_old_vnf.py",
"lcm-operation-coordinate-new-vnf": "./Scripts/coordinate_new_vnf.py",
"vdu_params": [
{
"vdu_id": "VDU1",
"old_vnfc_param": {
"cp_name": "VDU1_CP1",
"username": "ubuntu",
"password": "ubuntu"
},
"new_vnfc_param": {
"cp_name": "VDU1_CP1",
"username": "ubuntu",
"password": "ubuntu"
}
},
{
"vdu_id": "VDU2",
"old_vnfc_param": {
"cp_name": "VDU2_CP1",
"username": "ubuntu",
"password": "ubuntu"
},
"new_vnfc_param": {
"cp_name": "VDU2_CP1",
"username": "ubuntu",
"password": "ubuntu"
}
}
]
},
"extVirtualLinks": [
{
"id": "9b319831-f6e2-4027-be42-170b2effd3dd",
"resourceId": "0cefe3d4-6729-41c5-bd39-277fd9ece3d3",
"extCps": [
{
"cpdId": "VDU1_CP1",
"cpConfig": {
"VDU1_CP1_1": {
"cpProtocolData": [
{
"layerProtocol": "IP_OVER_ETHERNET",
"ipOverEthernet": {
"ipAddresses": [
{
"type": "IPV4",
"numDynamicAddresses": 1
}
]
}
}
]
}
}
}
]
}
]
}

View File

@ -0,0 +1,54 @@
heat_template_version: 2013-05-23
description: 'Simple Base HOT for Sample VNF'
parameters:
nfv:
type: json
resources:
VDU1_scale:
type: OS::Heat::AutoScalingGroup
properties:
min_size: 1
max_size: 3
desired_capacity: { get_param: [ nfv, VDU, VDU1, desired_capacity ] }
resource:
type: base_hot_nested_VDU1.yaml
properties:
flavor: { get_param: [ nfv, VDU, VDU1, computeFlavourId ] }
image-VDU1: { get_param: [ nfv, VDU, VDU1, vcImageId] }
net1: { get_param: [ nfv, CP, VDU1_CP1, network] }
VDU2:
type: OS::Nova::Server
properties:
flavor: { get_param: [ nfv, VDU, VDU2, computeFlavourId ] }
image: { get_param: [ nfv, VDU, VDU2, vcImageId] }
networks:
- port:
get_resource: VDU2_CP1
VDU2_CP1:
type: OS::Neutron::Port
properties:
network: { get_param: [ nfv, CP, VDU2_CP1, network ] }
fixed_ips:
- ip_address: { get_param: [nfv, CP, VDU2_CP1, fixed_ips, 0, ip_address]}
VDU3:
type: OS::Nova::Server
properties:
flavor: { get_param: [ nfv, VDU, VDU3, computeFlavourId ] }
image: { get_param: [ nfv, VDU, VDU3, vcImageId] }
networks:
- port:
get_resource: VDU3_CP1
VDU3_CP1:
type: OS::Neutron::Port
properties:
network: { get_param: [ nfv, CP, VDU3_CP1, network ] }
fixed_ips:
- ip_address: { get_param: [nfv, CP, VDU3_CP1, fixed_ips, 0, ip_address]}
outputs: {}

View File

@ -0,0 +1,26 @@
heat_template_version: 2013-05-23
description: 'VDU1 HOT for Sample VNF'
parameters:
flavor:
type: string
image-VDU1:
type: string
net1:
type: string
resources:
VDU1:
type: OS::Nova::Server
properties:
flavor: { get_param: flavor }
name: VDU1
image: { get_param: image-VDU1 }
networks:
- port:
get_resource: VDU1_CP1
VDU1_CP1:
type: OS::Neutron::Port
properties:
network: { get_param: net1 }

View File

@ -0,0 +1,272 @@
tosca_definitions_version: tosca_simple_yaml_1_2
description: Simple deployment flavour for Sample VNF
imports:
- etsi_nfv_sol001_common_types.yaml
- etsi_nfv_sol001_vnfd_types.yaml
- change_vnf_pkg_types.yaml
topology_template:
inputs:
descriptor_id:
type: string
descriptor_version:
type: string
provider:
type: string
product_name:
type: string
software_version:
type: string
vnfm_info:
type: list
entry_schema:
type: string
flavour_id:
type: string
flavour_description:
type: string
substitution_mappings:
node_type: company.provider.VNF
properties:
flavour_id: simple
requirements:
virtual_link_external1_1: [ VDU1_CP1, virtual_link ]
virtual_link_external1_2: [ VDU2_CP1, virtual_link ]
virtual_link_external1_3: [ VDU3_CP1, virtual_link ]
node_templates:
VNF:
type: company.provider.VNF
properties:
flavour_description: A simple flavour
interfaces:
Vnflcm:
instantiate: []
instantiate_start: []
instantiate_end: []
terminate: []
terminate_start: []
terminate_end: []
modify_information: []
modify_information_start: []
modify_information_end: []
VDU1:
type: tosca.nodes.nfv.Vdu.Compute
properties:
name: VDU1
description: VDU1 compute node
vdu_profile:
min_number_of_instances: 1
max_number_of_instances: 3
sw_image_data:
name: cirros-0.5.2-x86_64-disk
version: '0.5.2'
checksum:
algorithm: sha-256
hash: 932fcae93574e242dc3d772d5235061747dfe537668443a1f0567d893614b464
container_format: bare
disk_format: qcow2
min_disk: 0 GB
min_ram: 256 MB
size: 2 GB
capabilities:
virtual_compute:
properties:
requested_additional_capabilities:
properties:
requested_additional_capability_name: m1.tiny
support_mandatory: true
target_performance_parameters:
entry_schema: test
virtual_memory:
virtual_mem_size: 512 MB
virtual_cpu:
num_virtual_cpu: 1
virtual_local_storage:
- size_of_storage: 3 GB
VDU2:
type: tosca.nodes.nfv.Vdu.Compute
properties:
name: VDU2
description: VDU2 compute node
vdu_profile:
min_number_of_instances: 1
max_number_of_instances: 1
sw_image_data:
name: cirros-0.5.2-x86_64-disk
version: '0.5.2'
checksum:
algorithm: sha-256
hash: 932fcae93574e242dc3d772d5235061747dfe537668443a1f0567d893614b464
container_format: bare
disk_format: qcow2
min_disk: 0 GB
min_ram: 256 MB
size: 2 GB
capabilities:
virtual_compute:
properties:
requested_additional_capabilities:
properties:
requested_additional_capability_name: m1.tiny
support_mandatory: true
target_performance_parameters:
entry_schema: test
virtual_memory:
virtual_mem_size: 512 MB
virtual_cpu:
num_virtual_cpu: 1
virtual_local_storage:
- size_of_storage: 3 GB
VDU3:
type: tosca.nodes.nfv.Vdu.Compute
properties:
name: VDU3
description: VDU3 compute node
vdu_profile:
min_number_of_instances: 1
max_number_of_instances: 1
sw_image_data:
name: cirros-0.5.2-x86_64-disk
version: '0.5.2'
checksum:
algorithm: sha-256
hash: 932fcae93574e242dc3d772d5235061747dfe537668443a1f0567d893614b464
container_format: bare
disk_format: qcow2
min_disk: 0 GB
min_ram: 256 MB
size: 2 GB
capabilities:
virtual_compute:
properties:
requested_additional_capabilities:
properties:
requested_additional_capability_name: m1.tiny
support_mandatory: true
target_performance_parameters:
entry_schema: test
virtual_memory:
virtual_mem_size: 512 MB
virtual_cpu:
num_virtual_cpu: 1
virtual_local_storage:
- size_of_storage: 3 GB
VDU1_CP1:
type: tosca.nodes.nfv.VduCp
properties:
layer_protocols: [ ipv4 ]
order: 0
requirements:
- virtual_binding: VDU1
VDU2_CP1:
type: tosca.nodes.nfv.VduCp
properties:
layer_protocols: [ ipv4 ]
order: 0
requirements:
- virtual_binding: VDU2
VDU3_CP1:
type: tosca.nodes.nfv.VduCp
properties:
layer_protocols: [ ipv4 ]
order: 0
requirements:
- virtual_binding: VDU3
policies:
- scaling_aspects:
type: tosca.policies.nfv.ScalingAspects
properties:
aspects:
VDU1_scale:
name: VDU1_scale
description: VDU1 scaling aspect
max_scale_level: 2
step_deltas:
- delta_1
- VDU1_initial_delta:
type: tosca.policies.nfv.VduInitialDelta
properties:
initial_delta:
number_of_instances: 2
targets: [ VDU1 ]
- VDU2_initial_delta:
type: tosca.policies.nfv.VduInitialDelta
properties:
initial_delta:
number_of_instances: 1
targets: [ VDU2 ]
- VDU3_initial_delta:
type: tosca.policies.nfv.VduInitialDelta
properties:
initial_delta:
number_of_instances: 1
targets: [ VDU3 ]
- VDU1_scaling_aspect_deltas:
type: tosca.policies.nfv.VduScalingAspectDeltas
properties:
aspect: VDU1_scale
deltas:
delta_1:
number_of_instances: 1
targets: [ VDU1 ]
- instantiation_levels:
type: tosca.policies.nfv.InstantiationLevels
properties:
levels:
instantiation_level_1:
description: Smallest size
scale_info:
VDU1_scale:
scale_level: 0
instantiation_level_2:
description: Largest size
scale_info:
VDU1_scale:
scale_level: 2
default_level: instantiation_level_1
- VDU1_instantiation_levels:
type: tosca.policies.nfv.VduInstantiationLevels
properties:
levels:
instantiation_level_1:
number_of_instances: 1
instantiation_level_2:
number_of_instances: 3
targets: [ VDU1 ]
- VDU2_instantiation_levels:
type: tosca.policies.nfv.VduInstantiationLevels
properties:
levels:
instantiation_level_1:
number_of_instances: 1
instantiation_level_2:
number_of_instances: 1
targets: [ VDU2 ]
- VDU3_instantiation_levels:
type: tosca.policies.nfv.VduInstantiationLevels
properties:
levels:
instantiation_level_1:
number_of_instances: 1
instantiation_level_2:
number_of_instances: 1
targets: [ VDU3 ]

View File

@ -0,0 +1,31 @@
tosca_definitions_version: tosca_simple_yaml_1_2
description: Sample VNF
imports:
- etsi_nfv_sol001_common_types.yaml
- etsi_nfv_sol001_vnfd_types.yaml
- change_vnf_pkg_types.yaml
- change_vnf_pkg_old_df_simple.yaml
topology_template:
inputs:
selected_flavour:
type: string
description: VNF deployment flavour selected by the consumer. It is provided in the API
node_templates:
VNF:
type: company.provider.VNF
properties:
flavour_id: { get_input: selected_flavour }
descriptor_id: c499a115-3f48-4a1e-8211-04f0d0b3b3bf
provider: Company
product_name: Sample VNF
software_version: '1.0'
descriptor_version: '1.0'
vnfm_info:
- Tacker
requirements:
#- virtual_link_external # mapped in lower-level templates
#- virtual_link_internal # mapped in lower-level templates

View File

@ -0,0 +1,55 @@
tosca_definitions_version: tosca_simple_yaml_1_2
description: VNF type definition
imports:
- etsi_nfv_sol001_common_types.yaml
- etsi_nfv_sol001_vnfd_types.yaml
node_types:
company.provider.VNF:
derived_from: tosca.nodes.nfv.VNF
properties:
descriptor_id:
type: string
constraints: [ valid_values: [ c499a115-3f48-4a1e-8211-04f0d0b3b3bf ] ]
default: c499a115-3f48-4a1e-8211-04f0d0b3b3bf
descriptor_version:
type: string
constraints: [ valid_values: [ '1.0' ] ]
default: '1.0'
provider:
type: string
constraints: [ valid_values: [ 'Company' ] ]
default: 'Company'
product_name:
type: string
constraints: [ valid_values: [ 'Sample VNF' ] ]
default: 'Sample VNF'
software_version:
type: string
constraints: [ valid_values: [ '1.0' ] ]
default: '1.0'
vnfm_info:
type: list
entry_schema:
type: string
constraints: [ valid_values: [ Tacker ] ]
default: [ Tacker ]
flavour_id:
type: string
constraints: [ valid_values: [ simple ] ]
default: simple
flavour_description:
type: string
default: "flavour"
requirements:
- virtual_link_external1:
capability: tosca.capabilities.nfv.VirtualLinkable
- virtual_link_external2:
capability: tosca.capabilities.nfv.VirtualLinkable
- virtual_link_external3:
capability: tosca.capabilities.nfv.VirtualLinkable
interfaces:
Vnflcm:
type: tosca.interfaces.nfv.Vnflcm

View File

@ -0,0 +1,115 @@
# Copyright (C) 2022 Fujitsu
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os
import pickle
import sys
import time
from oslo_log import log as logging
import paramiko
from tacker.sol_refactored.common import exceptions as sol_ex
LOG = logging.getLogger(__name__)
CMD_TIMEOUT = 30
SERVER_WAIT_COMPLETE_TIME = 60
SSH_CONNECT_RETRY_COUNT = 4
class SampleOldCoordinateVNFScript(object):
def __init__(self, vnfc_param):
self.vnfc_param = vnfc_param
def coordinate_vnf(self):
# check ssh connect and os version
"""(YiFeng) Add comment to check ssh access
The next part of code is to check connect VM via ssh.
Since the zuul's network cannot check this content, so
we comment this part of code. If you want to check them
in your local environment, please uncomment.
# user = self.vnfc_param['username']
# password = self.vnfc_param['password']
# host = self.vnfc_param['ssh_ip']
# commander = self._init_commander(
# user, password, host, retry=SSH_CONNECT_RETRY_COUNT)
# ssh_command = 'cat /etc/os-release | grep PRETTY_NAME'
# result = self._execute_command(commander, host, ssh_command)
# os_version = result.get_stdout()[0].replace('\n', '').split('=')
# LOG.info('The os version of this new VM is %s', os_version)
"""
pass
def _init_commander(self, user, password, host, retry):
while retry > 0:
try:
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(
host, username=user, password=password)
LOG.info("Connected to %s", host)
return ssh
except paramiko.AuthenticationException as e:
LOG.error("Authentication failed when connecting to %s",
host)
raise sol_ex.VMRunningFailed(e)
except (paramiko.SSHException,
paramiko.ssh_exception.NoValidConnectionsError) as e:
LOG.debug(e)
retry -= 1
if retry == 0:
LOG.error(e)
raise sol_ex.VMRunningFailed(e)
time.sleep(SERVER_WAIT_COMPLETE_TIME)
def _execute_command(self, commander, host, command):
try:
stdin, stdout, stderr = commander.exec_command(command)
cmd_out = stdout.readlines()
cmd_err = stderr.readlines()
return_code = stdout.channel.recv_exit_status()
except paramiko.SSHException as e:
LOG.error("Command execution failed at %s. Giving up", host)
raise e
finally:
commander.close()
if return_code != 0:
error = cmd_err
raise sol_ex.VMRunningFailed(error_info=error)
result = "cmd: %s, stdout: %s, stderr: %s, return code: %s" % (
command, cmd_out, cmd_err, return_code)
LOG.debug("Remote command execution result: %s", result)
return cmd_out
def main():
operation = "coordinate_vnf"
vnfc_param = pickle.load(sys.stdin.buffer)
script = SampleOldCoordinateVNFScript(vnfc_param)
try:
getattr(script, operation)()
except Exception:
raise Exception
if __name__ == "__main__":
try:
main()
os._exit(0)
except Exception as ex:
sys.stderr.write(str(ex))
sys.stderr.flush()
os._exit(1)

View File

@ -0,0 +1,4 @@
TOSCA-Meta-File-Version: 1.0
CSAR-Version: 1.1
Created-by: Onboarding portal
Entry-Definitions: Definitions/change_vnf_pkg_top.vnfd.yaml

View File

@ -0,0 +1,93 @@
{
"flavourId": "simple",
"instantiationLevelId": "instantiation_level_1",
"extVirtualLinks": [
{
"id": "cea931f1-829f-4de5-8c0e-c2990bb53d04",
"resourceId": "859db81a-2d3f-4634-be04-bdf052af5792",
"extCps": [
{
"cpdId": "VDU1_CP1",
"cpConfig": {
"VDU1_CP1_1": {
"cpProtocolData": [
{
"layerProtocol": "IP_OVER_ETHERNET",
"ipOverEthernet": {
"ipAddresses": [
{
"type": "IPV4",
"numDynamicAddresses": 1
}
]
}
}
]
}
}
},
{
"cpdId": "VDU2_CP1",
"cpConfig": {
"VDU2_CP1_1": {
"cpProtocolData": [
{
"layerProtocol": "IP_OVER_ETHERNET",
"ipOverEthernet": {
"ipAddresses": [
{
"type": "IPV4",
"fixedAddresses": [
"10.10.0.101"
]
}
]
}
}
]
}
}
},
{
"cpdId": "VDU3_CP1",
"cpConfig": {
"VDU3_CP1_1": {
"cpProtocolData": [
{
"layerProtocol": "IP_OVER_ETHERNET",
"ipOverEthernet": {
"ipAddresses": [
{
"type": "IPV4",
"fixedAddresses": [
"10.10.0.102"
]
}
]
}
}
]
}
}
}
]
}
],
"vimConnectionInfo": {
"vim1": {
"vimType": "ETSINFV.OPENSTACK_KEYSTONE.V_3",
"vimId": "4e4b7eef-cdff-43a1-93a8-63af4f962948",
"interfaceInfo": {
"endpoint": "http://localhost/identity/v3"
},
"accessInfo": {
"username": "nfv_user",
"region": "RegionOne",
"password": "devstack",
"project": "nfv",
"projectDomain": "Default",
"userDomain": "Default"
}
}
}
}

View File

@ -1,23 +1,23 @@
@startuml
frame "python-tackerclient" {
component "tacker-client" as client
component "tacker-client" as client
}
frame "tacker" {
component "tacker-server" {
component "server" as serv
}
component "tacker-conductor" {
component "conductor" as cond
component "OpenStack\ninfra-driver" as infra
}
component "tacker-server" {
component "server" as serv
}
component "tacker-conductor" {
component "conductor" as cond
component "OpenStack\ninfra-driver" as infra
}
}
node "OpenStack\nHeat" as heat
cloud "Hardware Resources" as hw {
node "VM" as ins1
node "VM" as ins2
node "VM" as ins1
node "VM" as ins2
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More