通过动作驱动器定制 VNF 工作流¶
问题描述¶
ETSI NFV 没有定义生命周期管理 (LCM) 工作流行为。目前,Tacker 具有默认 LCM 工作流,VNF 厂商无法更改默认工作流。默认工作流无法满足某些 VNF 的 LCM 要求。
对于修复,使用撤销而不是删除和创建。
我们希望使 VNF 厂商能够通过动作驱动器定制其工作流。
提议的变更¶
本提案建议提供动作驱动器功能,以灵活选择定制的 LCM 工作流。扩展 Tacker 的能力最好通过类似于现有管理和基础设施驱动器的驱动模型来实现。
目前,管理驱动器 (Mgmt Driver) 功能配置 VNF 厂商提供的应用程序。因此,我们也应该使 VNF 厂商能够通过管理驱动器定制应用程序的配置方法。
这些定制由 ETSI NFV-SOL001 [1] “6.7 接口类型”中的“接口”定义指定。
动作驱动器功能的概述如下(具体的非标准驱动程序实现是未来的工作。仅导入 Python 实现驱动程序是第一阶段的目标。)
+------------------+ interface of Lifecycle
| | +-----------------+ +-----------------+ +----------------+
| | | | | | | |
| VNFM API +------->+ VNF Lifecycle +-----+-->+ Action Driver +---------->+ Infra Driver |
| | | Management | | | | | |
| | | | | | +-+ | +-+
| | +-----------------+ | +-+---------------+ | +-+--------------+ |
+------------------+ | | [standard] | | OpenStack_T |
| | Instantiate | | OpenStack_V |
| | Heal_evacuate | | Kubernetes_3 |
| | Heal_recreate | | : |
| | | +----------------+
| | [custom] |
| | Heal_evacuate |
| | |
| | [mistral WF] |
| | (Future work) |
| | Instantiate_ |
| | VNF_A |
| | Instantiate_ |
| | VNF_B |
| | |
| +-----------------+
|
| +----------------+
+---->+ |
interface of | Mgmt Driver |
Lifecycle start/end | |
(xxx_start/xxx_end) | +-+
+-+--------------+ |
| Ansible |
| cloud+init |
| Kubernetes |
| : |
+----------------+
使用动作驱动器的 VNF 实例实例化流程如下
+----------+ +---------------+ +-----------+ +---------------+ +--------------+
| | | | | | | | | |
| VNFM API | | VNF Lifecycle | | Tacker DB | | Action Driver | | Mgmt Driver |
| | | Management | | | | | | |
| | | | | | | | | |
+----+-----+ +------+--------+ +-----+-----+ +-------+-------+ +------+-------+
| | | | |
| Instantiate VNF | | | |
+------------------> | | |
<- - - - - - - - - + Fetch action | | |
| (async) | from vnfd_dict | | |
| | | | |
| +-------------------> | |
| <-------------------+ | |
| | | | |
| | | | |
| | mgmt_call( | | |
| | method='instantiate_start') | |
| | | | |
| +----------------------------------------------------------->|
| <------------------------------------------------------------+
| | | | |
| | | | |
| | action_call( | | |
| | method='action_instantiate_vnf') | |
| | | | |
| +---------------------------------------> +------+ |
| | | | |Infra | |
| | | | |Driver| |
| | | | +---+--+ |
| | | | | |
| | | | | |
| | | | instantiate_vnf |
| | | | | |
| | | +---------> |
| | | <---------+ |
| <---------------------------------------+ | |
| | | | + |
| | | | |
| | mgmt_call( | | |
| | method='instantiate_end') | |
| | | | |
| +----------------------------------------------------------->|
| <------------------------------------------------------------+
| | | | |
| | | | |
+ + + + +
如何定义驱动程序¶
动作驱动器和管理驱动器由 VNFD 指定。
如何指定动作驱动器如下
node_templates:
VNF:
type: tacker.sample.VNF
properties:
flavour_description: A simple flavour
interfaces:
Vnflcm:
instantiate:
implementation: action-drivers-custom
.
.
.
artifacts:
action-drivers-custom:
description: Action driver standard
type: tosca.artifacts.Implementation.Python
file: /usr/local/lib/python3.6/site-packages/tacker/vnfm/action_drivers/custom_action_driver_1.py
如何指定管理驱动器如下
node_templates:
VNF:
type: tacker.sample.VNF
properties:
flavour_description: A simple flavour
interfaces:
Vnflcm:
instantiate: []
instantiate_start:
implementation: mgmt-drivers-noop
instantiate_end:
implementation: mgmt-drivers-custom
terminate: []
terminate_start: []
terminate_end: []
artifacts:
mgmt-drivers-custom:
description: Management driver custom
type: tosca.artifacts.Implementation.Python
file: /usr/local/lib/python3.6/site-packages/tacker/vnfm/mgmt_drivers/custom_mgmt.py
artifacts:
mgmt-drivers-noop:
description: Management driver noop
type: tosca.artifacts.Implementation.Python
file: /usr/local/lib/python3.6/site-packages/tacker/vnfm/mgmt_drivers/noop.py
在 VNF 包中使用工件的情况下,我们将相对路径作为 ‘artifacts:’ 块中 ‘file:’ 的值写入。
以下是默认 VNFD 描述,它将所有驱动程序实现指定为标准。即,我们可以定制以下实现。
interfaces:
Vnflcm:
instantiate: []
instantiate_start: []
instantiate_end: []
terminate: []
terminate_start: []
terminate_end: []
heal: []
heal_start: []
heal_end: []
scale: []
scale_start: []
scale_end: []
动作驱动器目录结构¶
本规范建议在 tacker/vnfm 下创建 “action_drivers”。
tacker
|-- plugin.py
|-- vnfm
|-- action_drivers
|-- abstract_driver.py
|-- custom_action_driver_1.py
|-- custom_action_driver_2.py
:
备选方案¶
无
数据模型影响¶
无
REST API 影响¶
无
安全影响¶
无
通知影响¶
无
其他最终用户影响¶
用户可以通过 VNFD 指定 LCM 操作和预/后设置。
性能影响¶
无
其他部署者影响¶
无
开发人员影响¶
无
实现¶
负责人¶
主要负责人
高桥 俊明 (Toshiaki Takahashi)
工作项¶
动作驱动器主流程
与现有管理驱动器框架的协作
从 LCM 流程调用动作驱动器流程
VNFD 读取和动作驱动器设置
单元测试
功能测试
依赖项¶
测试¶
单元和功能测试足以测试 VNFD 中编写的指定流程是否被正确调用。
文档影响¶
添加关于如何使用动作驱动器定制 LCM 的文档