以master版本为例
1. Devstacklocal.conf配置, 新增:
enable_plugin tacker https://git.openstack.org/openstack/tacker master |
2. 进行安装
# stack.sh |
Devstack 会自动配置/etc/tacker/tacker.conf文件, 如果手动通过RPM安装, 有一些地方需要自己配置, 配置文件样例如下:
[DEFAULT] nova_region_name = RegionOne nova_api_insecure = False nova_ca_certificates_file = nova_admin_auth_url = http://127.0.0.1:35357 nova_admin_tenant_id = service nova_admin_password = 123456 nova_amin_user_name = nova nova_url = http://127.0.0.1:8774/v2 auth_strategy = keystone policy_file = /etc/tacker/policy.json debug = True verbose = True logging_exception_prefix = %(color)s%(asctime)s.%(msecs)03d TRACE %(name)s ^[[01;35m%(instance)s^[[00m logging_debug_format_suffix = ^[[00;33mfrom (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d^[[00m logging_default_format_string = %(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [^[[00;36m-%(color)s] ^[[01;35m%(instance)s%(color)s%(message)s^[[00m logging_context_format_string = %(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [^[[01;36m%(request_id)s ^[[00;36m%(user_name)s %(project_id)s%(color)s] ^[[01;35m%(instance)s%(color)s%(message)s^[[00m use_syslog = False state_path = /opt/stack/data/tacker # Print more verbose output (set logging level to INFO instead of default WARNING level). # verbose = False ... [keystone_authtoken] memcached_servers = 127.0.0.1:11211 project_domain_name = Default user_domain_name = Default auth_type = password signing_dir = /var/cache/tacker cafile = /opt/stack/data/ca-bundle.pem project_domain_id = default project_name = service user_domain_id = default password = 123456 username = tacker auth_url = http://127.0.0.1:35357 auth_plugin = password identity_uri = http://127.0.0.1:5000 auth_uri = http://127.0.0.1:5000
[database] connection = mysql+pymysql://root:[email protected]/tacker?charset=utf8 # This line MUST be changed to actually run the plugin.
[tacker] # Specify drivers for hosting device # infra_driver nova deprecated for Mitaka. Will be removed in Newton cycle. # infra_driver = heat,nova,noop
# Specify drivers for mgmt # mgmt_driver = noop,openwrt
# Specify drivers for monitoring # monitor_driver = ping, http_ping
[nfvo_vim] # Supported VIM drivers, resource orchestration controllers such as OpenStack, kvm #Default VIM driver is OpenStack #vim_drivers = openstack #Default VIM placement if vim id is not provided default_vim = VIM0
[vim_keys] #openstack = /etc/tacker/vim/fernet_keys
#Deprecated for Mitaka. Will be removed in Newton cycle. [tacker_nova] # parameters for novaclient to talk to nova region_name = RegionOne project_domain_id = default project_name = service user_domain_id = default password = 123456 username = nova auth_url = http://127.0.0.1:35357 auth_plugin = password
[tacker_heat] heat_uri = http://127.0.0.1:8004/v1 stack_retries = 60 stack_retry_wait = 5 |
命令行
VNFD创建, 即创建VNF模板:
tacker vnfd-create --name ${VNFD_NAME} --vnfd-file${VNFD_TOSCA_YAML-FILE}
$ tacker vnfd-create --vnfd-file ./sample-vnfd.yaml Created a new vnfd: +---------------+------------------------------------------------------------------------+ | Field | Value | +---------------+------------------------------------------------------------------------+ | description | demo-example | | id | 759b90cc-da1f-42bc-a831-daf8ecea76d4 | | infra_driver | heat | | mgmt_driver | noop | | name | sample-vnfd | | service_types | {"service_type": "vnfd", "id": "9f57cb20-4bcb-4875-a8be-12a5b22f1e15"} | | tenant_id | 7af81ea6367340c188c8db2d814713a5 | +---------------+------------------------------------------------------------------------+
infra_driver目前可以是heat或nova,即通过heat编排部署该vnf虚拟机。驱动接口包括: 创建、更新、删除nfv设备, 以及添加删除网络接口。 mgmt_dirver目前有openwrt和noop, 可以用来: 1. 通过自定义配置方式(如ssh)在nfv的各生命周期(创建前/后,更新前/后,删除前/后)对其进行配置 2. 对vnf注入metadata或文件 |
VNF创建:
tacker vnf-create--name vnf-name --vnfd-id ${VNFD_ID}
$ tacker vnf-create --vnfd-name sample-vnfd Created a new vnf: +-------------+--------------------------------------+ | Field | Value | +-------------+--------------------------------------+ | description | demo-example | | id | 76697d1e-5afe-47d1-9944-6843d229aa7f | | instance_id | b3b25b02-20cd-4f19-a7ac-c88610f4d1f2 | | mgmt_url | | | name | | | services | | | status | PENDING_CREATE | | template_id | 759b90cc-da1f-42bc-a831-daf8ecea76d4 | | tenant_id | 7af81ea6367340c188c8db2d814713a5 | +-------------+--------------------------------------+ |
VNF更新:
tacker vnf-update--config "${CONFIG_DATA_YAML} ${VNFD_ID}
Web界面
VNF Catalog
VNFManager
用sample-vnfd.yaml创建出来的NFV虚拟机如下:
TOSCA YAML文件
https://github.com/openstack/tacker/tree/master/devstack/samples
template_name: sample-vnfd description: demo-example
service_properties: Id: sample-vnfd vendor: tacker version: 1
vdus: vdu1: id: vdu1 vm_image: cirros-0.3.4-x86_64-uec instance_type: m1.tiny
network_interfaces: management: network: net_mgmt (管理网口, 通过检测这个口的ip可达性来判断当前状态) management: true pkt_in: network: net0 (入端口) pkt_out: network: net1 (出端口)
placement_policy: availability_zone: nova
auto-scaling: noop (自动调整资源使用大小,cpu/内存/存储等) monitoring_policy: ping (检测状态的策略方法, 可以是ping或者http_ping) failure_policy: respawn (检测到失败后的策略方法, 重启)
config: param0: key0 param1: key1 |
Tacker安装
https://wiki.openstack.org/wiki/Tacker/Installation
Tacker代码
Tackerserver: http://git.openstack.org/cgit/openstack/tacker
Tacker Pythonclient: http://git.openstack.org/cgit/openstack/python-tackerclient
Tacker HorizonUI: http://git.openstack.org/cgit/openstack/tacker-horizon
ETSI GS NFV-MAN V1.1.1
http://www.etsi.org/deliver/etsi_gs/NFV-MAN/001_099/001/01.01.01_60/gs_nfv-man001v010101p.pdf