Tacker扮演ETSI NFV MANO中的NFVO及VNFM,其VIM為OpenStack,因此需建置一個OpenStack叢集,Tacker服務才可完成實驗,本次實驗採用kolla-ansible安裝建置OpenStack環境及Tacker相依專案
Node | OS | IP | CPU | Memory | Disk |
---|---|---|---|---|---|
controller1 | Ubuntu 16.04 | 10.0.1.94 | 8 | 16 GB | 128 GB |
compute1 | Ubuntu 16.04 | 10.0.1.97 | 8 | 16 GB | 1 TB |
controller1、compute1
$ sudo apt-get update
$ sudo apt-get install -y python-dev libffi-dev gcc libssl-dev python-selinux python-setuptools
controller1、compute1
$ sudo apt-get install -y python-pip
controller1
$ ssh-keygen
# 將其輸出複製
$ cat /root/.ssh/id_rsa.pub
# 貼上id_rsa.pub內容
$ vim /root/.ssh/authorized_keys
compute1
# 貼上controller1 id_rsa.pub內容
$ vim /root/.ssh/authorized_keys
controller1
$ sudo apt-get install -y python-virtualenv
$ sudo su
$ virtualenv env
$ source env/bin/activate
controller1
$ sudo apt-get install -y ansible
$ pip install ansible
controller1
$ vim /etc/ansible/ansible.cfg
[defaults]
host_key_checking=False
pipelining=True
forks=100
$ git clone https://github.com/openstack/kolla -b stable/rocky
$ git clone https://github.com/openstack/kolla-ansible -b stable/rocky
$ pip install -r kolla/requirements.txt --ignore-installed PyYAML
$ pip install -r kolla-ansible/requirements.txt
$ sudo mkdir -p /etc/kolla
$ sudo chown $USER:$USER /etc/kolla
$ cp -r kolla-ansible/etc/kolla/* /etc/kolla
# 隨機產生密碼
$ python kolla-ansible/tools/generate_passwords.py
controller1、compute1
$ vim /etc/hosts
127.0.0.1 localhost
10.0.1.94 controller1
10.0.1.97 compute1
controller1
$ vim kolla-ansible/ansible/inventory/multinode
[control]
controller1 neutron_external_interface=ens3 api_interface=eno1 network_interface=eno1 tunnel_interface=eno1 ansible_user=root
[network]
controller1 neutron_external_interface=ens3 api_interface=eno1 network_interface=eno1 tunnel_interface=eno1 ansible_user=root
[external-compute]
compute1 neutron_external_interface=ens3 api_interface=eno1 network_interface=eno1 tunnel_interface=eno1 ansible_user=root
[monitoring]
#monitoring01
compute1 neutron_external_interface=ens3 api_interface=eno1 network_interface=eno1 tunnel_interface=eno1 ansible_user=root
[storage]
compute1 neutron_external_interface=ens3 api_interface=eno1 network_interface=eno1 tunnel_interface=eno1 ansible_user=root
[deployment]
controller1 ansible_connection=local
$ ansible -i kolla-ansible/ansible/inventory/multinode all -m ping
$ ansible -i kolla-ansible/ansible/inventory/multinode all -m raw -a "apt-get -y install python-dev"
controller1
$ vim /etc/kolla/globals.yml
kolla_base_distro: "ubuntu"
kolla_install_type: "source"
openstack_release: "rocky"
kolla_internal_vip_address: "10.0.1.100"
network_interface: "eno1"
neutron_external_interface: "ens3"
keepalived_virtual_router_id: "96"
enable_aodh: "yes"
enable_barbican: "yes"
enable_ceilometer: "yes"
enable_gnocchi: "yes"
enable_heat: "yes"
enable_horizon: "yes"
enable_mistral: "yes"
enable_neutron_sfc: "yes"
enable_redis: "yes"
enable_tacker: "yes"
$ kolla-ansible/tools/kolla-ansible -i kolla-ansible/ansible/inventory/multinode bootstrap-servers
$ kolla-ansible/tools/kolla-ansible -i kolla-ansible/ansible/inventory/multinode prechecks
$ kolla-ansible/tools/kolla-ansible -i kolla-ansible/ansible/inventory/multinode deploy
等待安裝完成
controller1
$ pip install python-openstackclient python-glanceclient python-neutronclient --ignore-installed PyYAML
$ pip install python-tackerclient
$ kolla-ansible/tools/kolla-ansible post-deploy
$ . /etc/kolla/admin-openrc.sh
controller1
# cirros
$ wget http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img
$ openstack image create "cirros" \
--file cirros-0.4.0-x86_64-disk.img \
--disk-format qcow2 --container-format bare \
--public
# ubuntu
$ wget http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img
$ openstack image create "ubuntu" \
--file xenial-server-cloudimg-amd64-disk1.img \
--disk-format qcow2 --container-format bare \
--public
# Flat Physical Network
physical_interface_mappings = physnet1:{{ neutron_external_interface }