网络服务描述符支持¶
https://blueprints.launchpad.net/tacker/+spec/nsd-support
本提案描述了在 Tacker 中添加网络服务描述符 (NSD) 支持的计划。为了实现网络服务的动态组合,NFV 引入了网络服务描述符 (NSD),用于指定要创建的网络服务。
TOSCA NFV
+-----------------------------------+ +----------------+
| Service Template | | Network Service|
| +-------------------+ | | Descriptor |
| | Topology Template | | | |
| | +---------+ | +----------+| | +-----+ |
| | | Node | <--+-| NodeTypes|<----+----| VNFD| |
| | | Template| | +----------+| | +-----+ |
| | +---------+ | | | |
| | +---------+ | +----------+| | +-----+ |
| | | Node | <--+-| NodeTypes|<----+----| VLD | |
| | | Template| | +----------+| | +-----+ |
| | +---------+ | | | |
| | +---------+ | +----------+| | +-------+ |
| | | Node | <--+-| NodeTypes|<----+----| VNFFGD| |
| | | Template| | +----------+| | +-------+ |
| | +---------+ | | | |
| | +---------+ | +----------+| | +-----+ |
| | | Node | <--+-| NodeTypes|<----+----| PNFD| |
| | | Template| | +----------+| | +-----+ |
| | +---------+ | | | |
| +-------------------+ | | |
+-----------------------------------+ +----------------+
- 如图所示,NSD 可以包括 VNFD、VNFFGD、VLD 和 PNFD。
VNFD –> 虚拟网络功能描述符
VNFFGD –> VNF 转发图
VLD –> 虚拟链路描述符
PNFD –> 物理网络功能
在当前范围内,Tacker 不包括 PNFD。
问题描述¶
Tacker 构建了一个通用的 VNF 管理器和一个 NFV 编排器,用于在 OpenStack 等 NFV 基础设施平台上部署和运行虚拟网络功能 (VNFs)。但目前需要描述和编排一组 VNFs 以呈现网络服务的能力。社区希望管理和编排网络服务。NSD 模板是引入该能力的方式。
为了实现网络服务的动态组合,NFV 引入了网络服务描述符 (NSD),用于描述要创建的网络服务。NSD 主要描述了要在 NFVI 中实例化所有网络服务的内容。NFV 编排器可以使用 NSD 来实例化一个网络服务,该服务可能包含一个或多个 VNFs、VLs 和 VNFFGs。
Tacker 将提供对 NSD 的支持,以便用户可以编排 VNFs 和网络服务的集合。通过 NSD 支持,Tacker 将提供基于 TOSCA 的端到端网络服务。
提议的变更¶
引入一个新的模板来描述网络服务,其中包含 VNFs、连接点和虚拟链路。
+---------------------------------+
| Network Service Descriptor |
| |
| +--------+ |
| | VNF1 | |
| +--------+ |
| |
| +--------+ |
| | VNF2 | |
| +--------+ |
| |
| |
| |
| +--------+ |
| | VNFn | |
| +--------+ |
| |
| +------------+ |
| | End Point1 | |
| +------------+ |
| |
| +------------+ |
| | End Point2 | |
| +------------+ |
| |
| +-------------+ |
| |VirtualLink 1| |
| +-------------+ |
| |
| +-------------+ |
| |VirtualLink 2| |
| +-------------+ |
| |
| |
| +-------------+ |
| |VirtualLink m| |
| +-------------+ |
| |
+---------------------------------+
需要进行多项更改,包括对 Tacker 客户端、Horizon 和服务器的更改。
+-------------------------------------------+
| +------------------+ |
| |Client Application| |
| +--------+---------+ |
| | |
| +------v-----+ |
| | NFVO NS +----------------+ |
| | API | | |
| +------+-----+ +--v---+ |
| | | VNFM | |
| | +---+--+ |
| | | |
| +------------v-------------+ +---v-+ |
| |Network Service Descriptor| | VNF | |
| +--------------------------+ +-----+ |
+-------------------------------------------+
API 更改
将在 NFVO 插件中引入新的 API,用于 NSD 和 NS。
数据库更改
将在数据库中添加新的表来存储 ‘nsd’ 和 ‘ns’。需要对现有的 ‘vnfd’ 进行更改,其中涉及 substitution_mappings。
Mistral 驱动程序更改
在 NFVO 插件和 VNFM 插件之间引入一个新的 Mistral 驱动程序层,将 tosca 模板转换为 Mistral 工作流,并将所有 Mistral API 用于实例化 NS。这个中间层将提供 NFVO 和 Mistral 之间的协调。例如
从 TOSCA 模板生成工作流。
调用 Mistral 接口进行 NS 请求。
在所有 VNFs 变为 ACTIVE 状态之前,在 PENDING_CREATE 状态下等待 NS。
在部分失败的情况下决定前进/后退。
TOSCA 解析器更改
为了处理 nsd 模板,应配置 TOSCA 解析器。TOSCA 解析器将被更新以处理 VNFD、VLD 和 CP,用于网络服务描述符。
A sample Tosca template for VNFD is below.
Please refer appendix section for complete template.
node_types:
tosca.nodes.nfv.VNF1:
requirements:
- virtualLink1:
type: tosca.nodes.nfv.VL
required: true
capabilities:
forwarder1:
type: tosca.capabilities.nfv.Forwarder
topology_template:
substitution_mappings:
node_type: tosca.nodes.nfv.VNF1
requirements:
virtualLink1: [CP11, virtualLink]
capabilities:
forwarder1: [CP11, forwarder]
node_templates:
VDU1:
type: tosca.nodes.nfv.VDU.Tacker
.
.
CP11:
type: tosca.nodes.nfv.CP.Tacker
.
.
CP12:
type: tosca.nodes.nfv.CP.Tacker
.
.
VDU2:
type: tosca.nodes.nfv.VDU.Tacker
.
.
CP13:
type: tosca.nodes.nfv.CP.Tacker
.
.
VL1:
type: tosca.nodes.nfv.VL
.
.
VL2:
type: tosca.nodes.nfv.VL
.
.
Proposed sample Tosca template for NSD:
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0
imports:
- VNF1
- VNF2
topology_template:
VNF1:
type: tosca.nodes.nfv.VNF1
requirements:
- virtualLink1: VL1
VNF2:
type: tosca.nodes.nfv.VNF2
VL1:
type: tosca.nodes.nfv.VL
properties:
network_name: net_mgmt
vendor: tacker
- 关于上述模板
‘CP’ 属性表示将作为 VNF 的一部分公开的连接点(主要用于将来支持 VNF 转发图)。
对于每个 VNF,可以在属性部分中提及 VIM,否则选择默认 VIM。在当前范围内,所有 VNF 将着陆在同一个 VIM 上,该 VIM 可以在输入中提供。
注意:本规范的范围是处理现有的 vnfd 并定义 NS 的 API,以及支持创建 NS 而不创建转发路径。
数据模型影响¶
数据模型影响包括创建 ‘NetworkServiceTemplate’ 和 ‘NetworkService’ 资源模型。这些模式如下
+--------------------------+
| nsd |
+--------------------------+
| id |
| name |
| type |
| description |
| network_service_template |
| project_id |
+--------------------------+
+-----------------+
| ns |
+-----------------+
| id |
| name |
| description |
| nsd_id |
+-----------------+
现有的 vnfd 资源模型会受到影响。将为 nsd 添加一个新的字段 ‘nsd_id’ 到 vnfd 中。在正常的 VNFD 列表调用中,与 ‘nsd_id’ 对应的行将为空。
REST API 影响¶
需要创建 NSD 才能实例化网络服务。创建 NSD 的方法遵循我们在上述部分中提到的 TOSCA 模板方案。
示例 CLI 调用
首先创建所需的 VNFD
tacker vnfd-create vnf1 --vnfd-file samples/nsd/tosca-vnf1.yaml
tacker vnfd-create vnf2 --vnfd-file samples/nsd/tosca-vnf2.yaml
创建 NSD
tacker nsd-create --name NSD1 --nsd-file samples/nsd/tosca-nsd.yaml
创建 NS
tacker ns-create --name ns1 --nsd-name NSD1 --vim-name VIM1 --param-file <PARAM-FILE>
--config-file <CONFIG-FILE>
示例参数文件
vnfs:
VNF1:
vdu-name: VDU1
cp-name: CP11
nsd:
virtual-link: VL1
示例配置文件
vnfs:
VNF1:
....config
/nsd
+------------------------------------------------------------------------+
|Attribute |Type |Access |Default |Validation/ |Description |
|Name | | |Value |Conversion | |
+------------------------------------------------------------------------+
|id |string |RO, All |generated |N/A |identity |
| |(UUID) | | | | |
+------------------------------------------------------------------------+
|name |string |RW, All |None |string |human+readable |
| | | |(required)| |name |
+------------------------------------------------------------------------+
|description |string |RW, All |'' |string |description of |
| | | | | |NSD |
+------------------------------------------------------------------------+
|network_servic|dict |RW, All |None |template/ |network service |
|e_template | | | |dict |template |
+------------------------------------------------------------------------+
|project_id |string |RW, All |None |string |project id to |
| | | |(required)| |launch NSD |
+------------------------------------------------------------------------+
+--------------------------------------------------------------------------+
|REST Calls |Type |Expected |Request |Response |Description |
| | |Response |Body Schema |Body Schema | |
+--------------------------------------------------------------------------+
|create_nsd |post |201 |create_req |create_resp |Creates NSD |
| | |Created | | | |
+--------------------------------------------------------------------------+
|delete_nsd |delete|204 No |None | |Deletes NSD by |
| | |Content | | |name or ID |
+--------------------------------------------------------------------------+
|show_nsd |get |200 OK |None |show_resp |Returns output of|
| | | | | |specific NSD ID |
+--------------------------------------------------------------------------+
|list_nsd |get |200 OK |None |list_resp |Returns list of |
| | | | | |NSD Names/IDs |
+--------------------------------------------------------------------------+
JSON 请求和响应示例
POST /v1.0/nsds
create_req
{
"nsd": {
"name": "NSD_demo",
"service_types": [
{
"service_type": "nsd",
}
],
"description": "Sample NSD",
"project_id": "4dd6c1d7b6c94af980ca886495bcfed0",
"network_service_template": {
"nsd": "vnf1: template_name: \r\ndescription: template_description\r\n "vnf2: template_name: OpenWRT \r\ndescription: template_description
},
}
}
create_resp
{
"nsd": {
"name": "NSD_demo",
"service_types": [
{
"service_type": "nsd",
"id": "336fe422-9fba-47c7-87fb-d48475c3e0ce"
}
],
"description": "Sample NSD",
"project_id": "4dd6c1d7b6c94af980ca886495bcfed0",
"network_service_template": {
"nsd": "template_name: OpenWRT \r\ndescription:
template_description <sample_vnfd_template>"
},
"id": "ab10a543-22ee-43af-a441-05a9d32a57da",
}
}
GET /v1.0/nsds
列出 nsds - 列出存储在目录中的 nsds。
list_res
{
"nsds": [
"nsd": {
"name": "NSD_demo",
"service_types": [
{
"service_type": "nsd",
"id": "336fe422-9fba-47c7-87fb-d48475c3e0ce"
}
],
"description": "Sample NSD",
"project_id": "4dd6c1d7b6c94af980ca886495bcfed0",
"network_service_template": {
"nsd": "template_name: OpenWRT \r\ndescription:
template_description <sample_vnfd_template>"
},
"id": "ab10a543-22ee-43af-a441-05a9d32a57da",
}
]
}
GET /v1.0/nsds/{nsd_id}
显示 nsd - 显示指定 nsd id 的信息。
show_res
{
"nsd": {
"name": "NSD_demo",
"service_types": [
{
"service_type": "nsd",
"id": "336fe422-9fba-47c7-87fb-d48475c3e0ce"
}
],
"description": "Sample NSD",
"project_id": "4dd6c1d7b6c94af980ca886495bcfed0",
"network_service_template": {
"nsd": "template_name: OpenWRT \r\ndescription:
template_description <sample_vnfd_template>"
},
"id": "ab10a543-22ee-43af-a441-05a9d32a57da",
}
}
/ns
+-----------------------------------------------------------------------+
|Attribute |Type |Access |Default |Validation/ |Description |
|Name | | |Value |Conversion | |
+-----------------------------------------------------------------------+
|id |string |RO, All |generated |N/A |identity |
| |(UUID) | | | | |
+-----------------------------------------------------------------------+
|name |string |RW, All |None |string |human+readable |
| | | |(required)| |name |
+-----------------------------------------------------------------------+
|description |string |RW, All |'' |string |description of |
| | | | | |NSD |
+-----------------------------------------------------------------------+
|vim_id |string |RW, All |None |string |VIM ID where it |
| | | |(required)| |launches |
+-----------------------------------------------------------------------+
|project_id |string |RW, All |None |string |project id to |
| | | |(required)| |launch NSD |
+-----------------------------------------------------------------------+
|nsd_id |string |RW, All |None |string |NSD id to launch |
| | | |(required)| | |
+-----------------------------------------------------------------------+
|attributes |dict |RW, All |None |dict |dict containing |
| | | |(required)| |config and/or |
| | | | | |param values |
+-----------------------------------------------------------------------+
+-----------------------------------------------------------------------+
|REST Calls |Type |Expected |Body Data |Response |Description |
| | |Response |Schema |Body Schema| |
+-----------------------------------------------------------------------+
|create_ns |post |202 |schema 1 | |Creates NSD |
| | |Accepted | | | |
+-----------------------------------------------------------------------+
|delete_ns |delete|202 |None | |Deletes NSD by |
| | |Accepted | | |name or ID |
+-----------------------------------------------------------------------+
|show_ns |get |200 OK |None | |Returns output of |
| | | | | |specific NSD ID |
| | | | | | |
+-----------------------------------------------------------------------+
|list_ns |get |200 OK |None | |Returns list of |
| | | | | |NSD Names/IDs |
+-----------------------------------------------------------------------+
安全影响¶
通知影响¶
无
其他最终用户影响¶
性能影响¶
无
其他部署者影响¶
开发人员影响¶
使用 Mistral 工作流进行 nsd
使用 Mistral 工作流进行 nsd 功能。Tacker NFVO 将通过工作流生成器生成 Mistral 工作流,并调用 Mistral 以获取生成的 workflow 请求。Mistral 将创建资源(VNFs、FFG)并响应 NFVO。
+-------------------------------------------+
| +------------------+ |
| |Client Application| |
| +--------+---------+ |
| | +-------------+ |
| +-----v----+ | Workflow | |
| | NFVO:NSD +-------> Generator | |
| +-----+----+ +---------+---+ |
| | | |
| +------------v-------------+ +----v---+ |
| |Network Service Descriptor| | Mistral| |
| +--------------------------+ +----+---+ |
| | |
| +---v--+ |
| | VNFM | |
| +------+ |
+-------------------------------------------+
- 优点
1: 工作流已经可以处理多种情况。 2: 在任何时候发生故障,都可以回滚。 3: 我认为使用 mistral 工作流实现 nsd 类似的功能应该很容易。 4: 在将 mistral 嵌入到 Tacker 之后,任何工作流或其他已经编码的此类修复都将触手可及。
- 缺点
- Mistral 作为第三个组件
- 1: 由于 Mistral 是第三个组件,因此
Mistral 的任何更改都可能影响 nsd 流程。
有时,在兼容性或其他问题的情况下,我们可能需要与 Mistral 团队合作。
Mistral 接受 json 文件作为输入,因此我们首先需要创建这些 json 数据。在 VNFD 数量很多的情况下,将创建多个文件。需要处理这些创建/清理。(需要对此部分进行调查)
- 对于 ns 调用
tacker –> Mistral –> tackerClient –> tacker 多次上下文切换导致耗时。
- 2: 自动生成的工作流可能容易出错,应该更加
小心地创建 mistral 工作流以处理边缘情况。
- 3: 我们必须为 nsd
模板中的每个资源(即 vnfd/vnf)生成工作流,这在 VNFs 数量很多的情况下可能会很复杂。
实现¶
负责人¶
- 主要负责人
Dharmendra Kushwaha
- 其他贡献者
Bharath Thiruveedula <bharath_ves@hotmail.com>
工作项¶
NFVO 插件中 NSD 和 NS 的新 API
NFVO 插件侧的实现。
Tacker DB 配置 ‘NetworkServiceTemplate’ 和 ‘NetworkService’。
TOSCA 解析器支持 NSD。
TOSCA 节点到工作流任务的映射。
工作流生成器:TOSCA 解析器将遍历模板中的每个节点,然后将它们转换为任务。
从 NFVO-NSD 插件到 Mistral 的调用,以实例化 NS。
逻辑,用于在所有 VNFs 变为 ACTIVE 状态之前,在 PENDING_CREATE 状态下等待 NS
逻辑,用于在 NS 级别获取参数并将其传递到 VNFs
tacker-horizon 和 python-tackerclient 中 NSD 的更改。
文档,用于解释 NSD 支持功能。
单元测试用例
功能测试用例
依赖项¶
无
测试¶
单元测试¶
将为新接口添加单元测试。将在 VNFM 中引入新的测试用例,用于相关的扩展。
功能测试¶
将添加功能测试,以检查所有 VNFs 的部署状态。
文档影响¶
用户文档¶
用户文档将描述 NSD 功能、操作和示例。Python-tackerclient 和 tacker-horizon 侧的文档将添加以描述 cli/界面详细信息。
开发者文档¶
添加开发者文档,用于 api 和用法详细信息
参考资料¶
附录¶
TOSCA 示例 vnf1¶
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: Demo example
node_types:
tosca.nodes.nfv.VNF1:
requirements:
- virtualLink1:
type: tosca.nodes.nfv.VL
required: true
- virtualLink2:
type: tosca.nodes.nfv.VL
required: true
capabilities:
forwader1:
type: tosca.capabilities.nfv.Forwarder
forwader2:
type: tosca.capabilities.nfv.Forwarder
topology_template:
substitution_mappings:
node_type: tosca.nodes.nfv.VNF1
requirements:
virtualLink1: [CP11, virtualLink]
virtualLink2: [CP14, virtualLink]
capabilities:
forwarder1: [CP11, forwarder]
forwarder2: [CP14, forwarder]
node_templates:
VDU1:
type: tosca.nodes.nfv.VDU.Tacker
properties:
image: cirros-0.3.4-x86_64-uec
flavor: m1.tiny
availability_zone: nova
mgmt_driver: noop
config: |
param0: key1
param1: key2
CP11:
type: tosca.nodes.nfv.CP.Tacker
properties:
management: true
anti_spoofing_protection: false
requirements:
- virtualBinding:
node: VDU1
- virtualLink:
node: VL1
CP12:
type: tosca.nodes.nfv.CP.Tacker
properties:
anti_spoofing_protection: false
requirements:
- virtualLink:
node: VL2
- virtualBinding:
node: VDU1
VDU2:
type: tosca.nodes.nfv.VDU.Tacker
properties:
image: cirros-0.3.4-x86_64-uec
flavor: m1.medium
availability_zone: nova
mgmt_driver: noop
config: |
param0: key1
param1: key2
CP13:
type: tosca.nodes.nfv.CP.Tacker
properties:
management: true
requirements:
- virtualLink:
node: VL1
- virtualBinding:
node: VDU2
CP14:
type: tosca.nodes.nfv.CP.Tacker
requirements:
- virtualBinding:
node: VDU2
VL1:
type: tosca.nodes.nfv.VL
properties:
network_name: net_mgmt
vendor: Tacker
VL2:
type: tosca.nodes.nfv.VL
properties:
network_name: net0
vendor: Tacker
TOSCA 示例 vnf2¶
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: Demo example
node_types:
tosca.nodes.nfv.VNF2:
capabilities:
forwarder1:
type: tosca.capabilities.nfv.Forwarder
topology_template:
substitution_mappings:
node_type: tosca.nodes.nfv.VNF2
capabilities:
forwarder1: [CP21, forwarder]
node_templates:
VDU1:
type: tosca.nodes.nfv.VDU.Tacker
properties:
image: cirros-0.3.4-x86_64-uec
flavor: m1.tiny
availability_zone: nova
mgmt_driver: noop
config: |
param0: key1
param1: key2
CP21:
type: tosca.nodes.nfv.CP.Tacker
properties:
management: true
anti_spoofing_protection: false
requirements:
- virtualLink:
node: VL1
- virtualBinding:
node: VDU1
VDU2:
type: tosca.nodes.nfv.VDU.Tacker
properties:
image: cirros-0.3.4-x86_64-uec
flavor: m1.medium
availability_zone: nova
mgmt_driver: noop
config: |
param0: key1
param1: key2
CP22:
type: tosca.nodes.nfv.CP.Tacker
requirements:
- virtualLink:
node: VL2
- virtualBinding:
node: VDU2
VL1:
type: tosca.nodes.nfv.VL
properties:
network_name: net_mgmt
vendor: Tacker
VL2:
type: tosca.nodes.nfv.VL
properties:
network_name: net0
vendor: Tacker
TOSCA 示例 nsd 模板¶
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
imports:
- VNF1
- VNF2
topology_template:
node_templates:
VNF1:
type: tosca.nodes.nfv.VNF1
requirements:
- virtualLink1: VL1
VNF2:
type: tosca.nodes.nfv.VNF2
VL1:
type: tosca.nodes.nfv.VL
properties:
network_name: net_mgmt
vendor: tacker
TOSCA 示例 nsd 参数¶
vnfs:
vnf1:
vdus:
vdu1:
param:
vdu-name: ns-test-vdu11
vdu2:
param:
vdu-name: ns-test-vdu12
cp11:
param:
cp-name: ns-test-cp11
cp12:
param:
cp-name: ns-test-cp12
vnf2:
vdus:
vdu1:
param:
vdu-name: ns-test-vdu21
vdu2:
param:
vdu-name: ns-test-vdu22
cp21:
param:
cp-name: ns-test-cp21
cp22:
param:
cp-name: ns-test-cp22