说明: 本文主要是描述 openstack Pika版本的tacker的简单使用说明(更多请见后面分析)。
tacker是一个NVF管理器,用于管理NVF的生命周期。 Tacker的重点是配置VNF, 并监视他们。
并且支持重启和/或扩展(自动修复)NVF。
本文主要是基于tacker创建一个简单的NVF实例。
1、环境准备
1)3个网络:
net_mgmt:管理网络,需要与云平台管理网络能够通信(flat网络)
(flat网络的环境配置见:
http://blog.csdn.net/linshenyuan1213/article/details/78124661)
net0,net1 两个vxlan网络
2) 镜像获取 cirros-0.3.5-x86_64-disk.img 下载路径
http://download.cirros-cloud.net/0.3.5/
3)一个vnfd的定义文件 tosca-vnfd-nova-flavor.yaml,获取路径:
https://github.com/openstack/tacker/blob/master/samples/tosca-templates/vnfd/tosca-vnfd-nova-flavor.yaml
4) 创建目录,并设置权限
mkdir -p /etc/tacker/vim/fernet_keys
chown tacker:tacker /etc/tacker/* -R
(依次创建VIM,VNFD,VNF)
2、创建一个VIM
1) 定义一个VIM配置文件
# cat /root/config.yaml
auth_url: http://127.0.0.1:5000/v3
username: admin
password: admin
project_name: admin
user_domain_name: Default
project_domain_name: Default
2)创建
tacker vim-register --is-default --config-file /root/config.yaml test_vim
3)创建VIM 会使用到mistral,该组件的安装见:
http://blog.csdn.net/linshenyuan1213/article/details/78131590
3、创建一个vnfd
# tacker vnfd-create --vnfd-file vnfd/tosca-vnfd-nova-flavor.yaml tosca-vnfd-nova-flavor
Created a new vnfd:
+-----------------+--------------------------------------+
| Field | Value |
+-----------------+--------------------------------------+
| created_at | 2017-09-29 02:33:51.190691 |
| description | Demo example |
| id | ef6ef5f4-45c0-4c9c-b360-81069d38da65 |
| name | tosca-vnfd-nova-flavor |
| service_types | vnfd |
| template_source | onboarded |
| tenant_id | eaad10cdd84743bf90bdbd7e781ea9a0 |
| updated_at | |
+-----------------+--------------------------------------+
# tacker vnf-create --vnfd-id ef6ef5f4-45c0-4c9c-b360-81069d38da65 test-001
Created a new vnf:
+----------------+--------------------------------------+
| Field | Value |
+----------------+--------------------------------------+
| created_at | 2017-09-29 02:36:53.684499 |
| description | Demo example |
| error_reason | |
| id | 8accf814-9528-426b-b840-a8201aef341a |
| instance_id | 67cc9d02-9d38-4bbe-ad2c-cd6444295002 |
| mgmt_url | |
| name | test-001 |
| placement_attr | {"vim_name": "test_vim"} |
| status | PENDING_CREATE |
| tenant_id | eaad10cdd84743bf90bdbd7e781ea9a0 |
| updated_at | |
| vim_id | 9ede7118-7d78-4003-8909-63ca6ec956e4 |
| vnfd_id | ef6ef5f4-45c0-4c9c-b360-81069d38da65 |
+----------------+--------------------------------------+
# nova list
+-------------------------------------------------------+------------------------------------------------------------+
| Name | Networks |
+-------------------------------------------------------+------------------------------------------------------------+
| ta-f814-9528-426b-b840-a8201aef341a-VDU1-znhobb4prnnt | net_mgmt=192.168.6.117; net1=172.16.40.8; net0=172.16.30.9 |
#cat tosca-vnfd-nova-flavor.yaml
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: Demo example
metadata:
template_name: sample-tosca-vnfd
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
mgmt_driver: noop
config: |
param0: key1
param1: key2
CP1:
type: tosca.nodes.nfv.CP.Tacker
properties:
management: true
order: 0
anti_spoofing_protection: false
requirements:
- virtualLink:
node: VL1
- virtualBinding:
node: VDU1
CP2:
type: tosca.nodes.nfv.CP.Tacker
properties:
order: 1
anti_spoofing_protection: false
requirements:
- virtualLink:
node: VL2
- virtualBinding:
node: VDU1
CP3:
type: tosca.nodes.nfv.CP.Tacker
properties:
order: 2
anti_spoofing_protection: false
requirements:
- virtualLink:
node: VL3
- virtualBinding:
node: VDU1
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
VL3:
type: tosca.nodes.nfv.VL
properties:
network_name: net1
vendor: Tacker