iT邦幫忙

第 11 屆 iThome 鐵人賽

DAY 23
0
自我挑戰組

SDN/NFV 網路虛擬化調度平台系列 第 23

Day23 - 部署OpenStack Cluster + Tacker

  • 分享至 

  • xImage
  •  

前言

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

安裝步驟

  1. Install dependencies

controller1、compute1

$ sudo apt-get update
$ sudo apt-get install -y python-dev libffi-dev gcc libssl-dev python-selinux python-setuptools
  1. Install python

controller1、compute1

$ sudo apt-get install -y python-pip
  1. 加入ssh key

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
  1. Install dependencies using a virtual environment

controller1

$ sudo apt-get install -y python-virtualenv
$ sudo su
$ virtualenv env
$ source env/bin/activate
  1. Install ansible

controller1

$ sudo apt-get install -y ansible
$ pip install ansible
  1. Configure Ansible

controller1

$ vim /etc/ansible/ansible.cfg
[defaults]
host_key_checking=False
pipelining=True
forks=100
  1. Install kolla-ansible
$ 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
  1. 編輯/etc/hosts

controller1、compute1

$ vim /etc/hosts
127.0.0.1 localhost
10.0.1.94 controller1
10.0.1.97 compute1
  1. Prepare initial configuration(multinode)

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"
  1. Prepare initial configuration(globals)

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
  1. Use OpenStack

等待安裝完成
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
  1. Upload image

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
  1. Create network
# Flat Physical Network
physical_interface_mappings = physnet1:{{ neutron_external_interface }

上一篇
Day22 - NFV MANO 名詞定義 VNFD、VNFFGD、NSD
下一篇
Day24 - Tacker使用教學 Part1
系列文
SDN/NFV 網路虛擬化調度平台30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言