每一个VNFD的yaml文件模板都有以下部分:
tosca_definitions_version:
This defines the TOSCA definition version on which the template is based.
The current version being tosca_simple_profile_for_nfv_1_0_0.
tosca_default_namespace:
This is optional. It mentions default namespace which includes schema,
types version etc.
description:
A short description about the template.
metadata:
template_name: A name to be given to the template.
topology_template:
Describes the topology of the VNF under node_template field.
node_template:
Describes node types of a VNF.
VDU:
Describes properties and capabilities of Virtual Deployment
Unit.
CP:
Describes properties and capabilities of Connection Point.
VL:
Describes properties and capabilities of Virtual Link.
topology_template:
node_templates:
VDU1:
type: tosca.nodes.nfv.VDU.Tacker
properties:
image: cirros-0.3.5-x86_64-disk
availability_zone: nova
capabilities:
nfv_compute:
properties:
disk_size: 10 GB
mem_size: 2048 MB
num_cpus: 2
topology_template:
node_templates:
VDU1:
type: tosca.nodes.nfv.VDU.Tacker
properties:
image: cirros-0.3.5-x86_64-disk
flavor: m1.tiny
availability_zone: nova
当nfv_compute properties 与 flavor同时存在的时候,优先使用flavor
..
VDU1:
type: tosca.nodes.nfv.VDU.Tacker
properties:
monitoring_policy:
name: ping
parameters:
monitoring_delay: 20
count: 3
interval: 2
timeout: 2
actions:
failure: respawn
retry: 6
port: 22
..
VDU1:
type: tosca.nodes.nfv.VDU.Tacker
properties:
user_data_format: RAW
user_data: |
#!/bin/sh
echo "Adding this line to demofile" > /tmp/demofile
..
VDU1:
type: tosca.nodes.nfv.VDU.Tacker
artifacts:
VNFImage:
type: tosca.artifacts.Deployment.Image.VM
file: http://download.cirros-cloud.net/0.3.5/ \
cirros-0.3.5-x86_64-disk.img
3.6 VDU Capabilities
一个VDU的计算属性定义为capabilities。包括内存,磁盘、大页内存,cpu以及核数 每个核的线程数。 一个10GB磁盘,2GB内存,2核CPU,4 KB内存也可以定义如下:
..
VDU1:
type: tosca.nodes.nfv.VDU.Tacker
capabilities:
nfv_compute:
properties:
disk_size: 10 GB
mem_size: 2048 MB
num_cpus: 2
mem_page_size: small
cpu_allocation:
cpu_affinity: dedicated
thread_count: 4
core_count: 2
..
topology_template:
node_templates:
VDU1:
..
CP1:
type: tosca.nodes.nfv.CP.Tacker
properties:
mac_address: fa:40:08:a0:de:0a
ip_address: 10.10.1.12
type: vnic
anti_spoofing_protection: false
management: true
order: 0
security_groups:
- secgroup1
- secgroup2
requirements:
- virtualLink:
node: VL1
- virtualBinding:
node: VDU1
CP2:
type: tosca.nodes.nfv.CP.Tacker
properties:
type: vnic
anti_spoofing_protection: false
management: true
order: 1
requirements:
- virtualLink:
node: VL2
- virtualBinding:
node: VDU1
VL1:
..
VL2:
..
properties: |
---|
Name | Required | Type | Constraints | Description |
type | No | String | One of
|
Specifies the type of CP |
anti_spoofing_protection | No | Boolean | None | Indicates whether anti_spoof rule is enabled for the VNF or not. Applicable only when CP type is virtual NIC |
management | No | Boolean | None | Specifies whether the CP is accessible by the user or not |
order | No | Integer | >= 0 | Uniquely numbered order of CP within a VDU. Must be provided when binding more than one CP to a VDU and ordering is required. |
security_groups | No | List | None | List of security groups to be associated with the CP |
mac_address | No | String | None | The MAC address |
ip _address | No | String | None | The IP address |
..
topology_template:
node_templates:
VDU1:
..
CP1:
..
VL1:
type: tosca.nodes.nfv.VL
properties:
vendor: Acme
network_name: net-01
..
topology_template:
node_templates:
VDU1:
..
CP1:
type: tosca.nodes.nfv.CP.Tacker
properties:
management: true
requirements:
- virtualLink:
node: VL1
- virtualBinding:
node: VDU1
VL1:
..
FIP1:
type: tosca.nodes.network.FloatingIP
properties:
floating_network: public
requirements:
- link:
node: CP1
..
topology_template:
node_templates:
VDU1:
..
VDU2:
..
CP1:
..
CP2:
..
VL1:
..
VL2:
..
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: Sample VNFD template mentioning possible values for each node.
metadata:
template_name: sample-tosca-vnfd-template-guide
topology_template:
node_templates:
VDU:
type: tosca.nodes.nfv.VDU.Tacker
capabilities:
nfv_compute:
properties:
mem_page_size: [small, large, any, custom]
cpu_allocation:
cpu_affinity: [shared, dedicated]
thread_allocation: [avoid, separate, isolate, prefer]
socket_count: any integer
core_count: any integer
thread_count: any integer
numa_node_count: any integer
numa_nodes:
node0: [ id: >=0, vcpus: [host CPU numbers], mem_size: >= 0MB]
properties:
image: Image to be used in VM
flavor: Nova supported flavors
availability_zone: available availability zone
mem_size: in MB
disk_size: in GB
num_cpus: any integer
metadata:
entry_schema:
config_drive: [true, false]
monitoring_policy:
name: [ping, noop, http-ping]
parameters:
monitoring_delay: delay time
count: any integer
interval: time to wait between monitoring
timeout: monitoring timeout time
actions:
[failure: respawn, failure: terminate, failure: log]
retry: Number of retries
port: specific port number if any
config: Configuring the VDU as per the network function requirements
mgmt_driver: [default=noop]
service_type: type of network service to be done by VDU
user_data: custom commands to be executed on VDU
user_data_format: format of the commands
key_name: user key
artifacts:
VNFImage:
type: tosca.artifacts.Deployment.Image.VM
file: file to be used for image
CP:
type: tosca.nodes.nfv.CP.Tacker
properties:
management: [true, false]
anti_spoofing_protection: [true, false]
type: [ sriov, vnic ]
order: order of CP within a VDU
security_groups: list of security groups
requirements:
- virtualLink:
node: VL to link to
- virtualBinding:
node: VDU to bind to
VL:
type: tosca.nodes.nfv.VL
properties:
network_name: name of network to attach to
vendor: Acme
9、参考文档