centos7 部署 Openstack tacker (N版)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_21398167/article/details/53082990

网上基本是devstack搭建的,在官网看见一个手动搭建的,系统为Ubuntu


只有按照这个文档  搭建到我的centos7环境中 openstack 环境为 Newton

http://docs.openstack.org/developer/tacker/install/manual_installation.html

由于系统不同,方便注释相关修改  我讲原文复制过来修改


1). Ensure that OpenStack components Keystone, Glance, Nova, Neutron, Heat and Horizon are installed. Refer http://docs.openstack.org/ for installation of OpenStack on different Operating Systems.

2). Create client environment scripts “admin-openrc.sh” and “demo-openrc.sh” for the admin and demo projects. Sample instructions for Ubuntu can be found at link below:http://docs.openstack.org/liberty/install-guide-ubuntu/keystone-openrc.html#creating-the-scripts

3).Ensure that the below required packages are installed on the system.

yum install python-pip git

4). Ensure entry for extensions drivers in ml2_conf.ini. Restart neutron services after the below entry has been added.

[ml2]
extension_drivers = port_security
5). Modify heat’s policy.json file under /etc/heat/policy.json file to allow
users in non-admin projects with ‘admin’ roles to create flavors.
到这一步由于看见上面要修改  /etc/heat/policy.json 文件,我的环境并没有安装heat ,于是停在这里,先去把heat安装了
链接  http://docs.openstack.org/project-install-guide/orchestration/newton/install-rdo.html
安装成功后继续
"resource_types:OS::Nova::Flavor": "role:admin"

Installing Tacker server

1). Create MySQL database and user.

mysql -uroot -p
CREATE DATABASE tacker;
GRANT ALL PRIVILEGES ON tacker.* TO 'tacker'@'localhost' \
    IDENTIFIED BY '<TACKERDB_PASSWORD>';
GRANT ALL PRIVILEGES ON tacker.* TO 'tacker'@'%' \
    IDENTIFIED BY '<TACKERDB_PASSWORD>';
exit;

2). Create users, roles and endpoints.

a). Source the admin credentials to gain access to admin-only CLI commands:

source admin-openrc.sh

b). Create tacker user with admin privileges.

Note

 

Project_name can be “service” or “services” depending on your OpenStack distribution.

openstack user create --password <PASSWORD> tacker
openstack role add --project service --user tacker admin

c). Create tacker service.

openstack service create --name tacker \
    --description "Tacker Project" nfv-orchestration

d). Provide an endpoint to tacker service.

openstack endpoint create --region RegionOne <SERVICE_ID> public http://<TACKER_NODE_IP>:9890
openstack endpoint create --region RegionOne <SERVICE_ID> admin http://<TACKER_NODE_IP>:9890
openstack endpoint create --region RegionOne <SERVICE_ID> internal http://<TACKER_NODE_IP>:9890

3). Clone tacker repository.

git clone https://github.com/openstack/tacker

4). Install all requirements.

cd tacker
pip install -r requirements.txt

Note

 

If OpenStack components mentioned in pre-requisites section have been installed, the below command would be sufficient.

cd tacker
pip install tosca-parser

5). Install tacker.

python setup.py install

6). Create ‘tacker’ directory in ‘/var/log’.

Note

 

The above referenced path ‘/var/log’ is for Ubuntu and may be different for other Operating Systems.

mkdir /var/log/tacker
7). Generate the tacker.conf.sample using tools/generate_config_file_sample.sh
or ‘tox -e config-gen’ command and rename it to tacker.conf. Then edit it to ensure the below entries:

Note

 

Project_name can be “service” or “services” depending on your OpenStack distribution in the keystone_authtoken section.

在centos7 下面,会生成一个 /usr/etc/tacker/ 目录  在这个目录下新建一个 tacker.conf 内容如下:(也可将整个目录换到/etc/tacker/下)
[DEFAULT]
auth_strategy = keystone
policy_file = /usr/etc/tacker/policy.json
debug = True
use_syslog = False
state_path = /var/lib/mysql/tacker
...
[keystone_authtoken]
project_name = service
password = <TACKER_SERVICE_USER_PASSWORD>
auth_url = http://<KEYSTONE_IP>:35357
#identity_uri = http://<KEYSTONE_IP>:5000
auth_uri = http://<KEYSTONE_IP>:5000
...
[agent]
root_helper = /usr/bin/tacker-rootwrap /usr/etc/tacker/rootwrap.conf
...
[DATABASE]
connection = mysql://tacker:<TACKERDB_PASSWORD>@<MYSQL_IP>:3306/tacker?charset=utf8
...
[tacker_heat]
heat_uri = http://<HEAT_IP>:8004/v1

8). Populate Tacker database:

Note

 

The below command is for Ubuntu Operating System.

/usr/bin/tacker-db-manage --config-file /usr/etc/tacker/tacker.conf upgrade head

Install Tacker client

1). Clone tacker-client repository.

git clone https://github.com/openstack/python-tackerclient

2). Install tacker-client.

cd python-tackerclient
python setup.py install

Install Tacker horizon

1). Clone tacker-horizon repository.

git clone https://github.com/openstack/tacker-horizon

2). Install horizon module.

cd tacker-horizon
python setup.py install

3). Enable tacker horizon in dashboard.

Note

 

The below destination path referred is for Ubuntu 14.04 and may change for other Operating Systems.

cp openstack_dashboard_extensions/* \
    /usr/share/openstack-dashboard/openstack_dashboard/enabled/

4). Restart Apache server.

systemctl restart httpd

Starting Tacker server

1).Open a new console and launch tacker-server. A separate terminal is required because the console will be locked by a running process.

Note

 

Ensure that ml2_conf.ini as per Step 4 from the pre-requisites section has been configured.

python /usr/bin/tacker-server \
    --config-file /usr/etc/tacker/tacker.conf \
    --log-file /var/log/tacker/tacker.log

Registering default VIM

Register the VIM that will be used as a default VIM for VNF deployments. This will be required when the optional argument –vim-id is not provided by the user during vnf-create.

tacker vim-register --is-default --config-file config.yaml \
--description <Default VIM description> <Default VIM Name>

config.yaml will contain VIM specific parameters as below:

auth_url: http://<keystone_public_endpoint_url>:5000
username: <username>
password: <password>
project_name: <project_name>

Add following parameters to config.yaml if VIM is using keystone v3:

project_domain_name: <domain>
user_domain_name: <domain>

Note

 

Here username must point to the user having ‘admin’ and ‘advsvc’ role on the project that will be used for deploying VNFs.

3). Restart tacker server.



为验证是否搭建成功,在官网找里一个例子测试 

http://docs.openstack.org/developer/tacker/install/getting_started.html


出错了 

提示   The server has either erred or is incapable of performing the requested operation.<br /><br />

到 日志中查看 

2016-11-07 22:44:46.991 4616 ERROR oslo_middleware.catch_errors SSLError: SSL exception connecting to https://127.0.0.1:35357: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:765)

各种Google  没有找到解决方法,于是只有继续寻找搭建方法,找到一篇博友的文章

http://blog.csdn.net/bc_vnetwork/article/details/51479684

他贴出来了Devstack 自动生成的 tacker.conf  ,我显现里面多了很多东西,于是怀疑官网的这文章版本过旧,都没有涉及到domain

于是按照他贴出来的 tacker.conf  将官网的置换掉,配置好参数,意外的成功了,故记录于此,希望能帮助到新朋友





猜你喜欢

转载自blog.csdn.net/qq_21398167/article/details/53082990