Kolla ansible deploying OpenStack multi node

Keywords: network OpenStack Virtualization

https://zerosun.top/2019/08/12/openstack-deploying-by-OSA/

https://www.bookstack.cn/read/deployopenstackwithpuppet/deployment_tool-osa.md

1. Preparation environment:

Three physical machines or virtual machines (CentOS7 system and virtual machine environment are used in this paper)
One deploy and two network cards (ens192 and ens224)
One control+network and two network cards (ens192 and ens224)
One compute+storage, three network cards (ens192, ens224, ens256)
Compute compute node plus a hard disk

1.1 network configuration
  • deploy:
    vim /etc/sysconfig/network-scripts/ifcfg-ens192
    BOOTPROTO=static
    DEVICE=ens192
    ONBOOT=yes
    IPADDR=10.24.3.10
    NETMASK=255.255.255.0
    GATEWAY=10.24.3.254
    
    
  • control:
    ens-192 configuration ip:
    vim /etc/sysconfig/network-scripts/ifcfg-ens192
    TYPE=Ethernet
    BOOTPROTO=static
    DEVICE=ens192
    ONBOOT=yes
    IPADDR=10.24.3.12
    NETMASK=255.255.255.0
    GATEWAY=10.24.3.254
    
    

The ens-224 network card is configured with three sub interfaces (xvlan s), which are:

  1. ens-224.10
vim /etc/sysconfig/network-scripts/ifcfg-ens224.10
VLAN=yes
DEVICE=ens224.10
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.10.20
NETMASK=255.255.255.0


vim /etc/sysconfig/network-scripts/ifcfg-vlan10
VLAN=yes
VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD
DEVICE=vlan10
PHYSDEV=ens224
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.10.20
NETMASK=255.255.255.0

  1. ens-224.20
vim /etc/sysconfig/network-scripts/ifcfg-ens224.20
VLAN=yes
DEVICE=ens224.20
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.20.20
NETMASK=255.255.255.0


vim /etc/sysconfig/network-scripts/ifcfg-vlan20
VLAN=yes
VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD
DEVICE=vlan20
PHYSDEV=ens224
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.20.20
NETMASK=255.255.255.0

  1. 3ns-224.30
vim /etc/sysconfig/network-scripts/ifcfg-ens224.30
VLAN=yes
DEVICE=ens224.30
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.30.20
NETMASK=255.255.255.0


vim /etc/sysconfig/network-scripts/ifcfg-vlan30
VLAN=yes
VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD
DEVICE=vlan30
PHYSDEV=ens224
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.30.20
NETMASK=255.255.255.0

Configure ip:

# External network card configuration
vim /etc/sysconfig/network-scripts/ifcfg-ens256
DEVICE=ens256
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
  • compute:

The configuration of ens192 and ens224 is the same as that of control. Ens224 is configured with three sub interfaces. The IP segment of the sub interface is not changed. Only the IP is changed:

vim /etc/sysconfig/network-scripts/ifcfg-ens192
BOOTPROTO=static
DEVICE=ens192
ONBOOT=yes
IPADDR=10.24.3.11
NETMASK=255.255.255.0
GATEWAY=10.24.3.254

vim /etc/sysconfig/network-scripts/ifcfg-ens224.10
IPADDR=192.168.10.10

vim /etc/sysconfig/network-scripts/ifcfg-ens224.20
IPADDR=192.168.20.10

vim /etc/sysconfig/network-scripts/ifcfg-ens224.30
IPADDR=192.168.30.10

1.2 restart the network card
systemctl restart network 

ip a View network card information

The ping command detects whether the host is connected, for example:[ root@compute ~]# ping 192.168.20.10

1.3 compute newly added hard disk partition initialization
fdisk -l
pvcreate /dev/sdb
vgcreate cinder-volumes /dev/sdb

[operate the following on deploy to deploy the node server]

2. Ready to deploy

2.1 installation dependencies

yum install -y epel-release
yum install -y python-pip
pip install -U pip

yum install python-devel libffi-devel gcc openssl-devel libselinux-python

2.2 installing deployment tools [ansible, kolla ansible]

yum install ansible
pip install kolla-ansible

2.3
Copy globals.yml and passwords.yml to the / etc/kolla directory

cp -r /usr/share/kolla-ansible/etc_examples/kolla /etc/kolla/

2.4 copy all in one and multinode inventory files to the current directory.

cp /usr/share/kolla-ansible/ansible/inventory/* .

3. Download kolla source code

If there is no git command, install yum install -y git manually

3.1 get Kolla and Kolla ansible repositories

git clone https://github.com/openstack/kolla
git clone https://github.com/openstack/kolla-ansible

3.2 kolla ansible save the configuration files (globals.yml and passwords.yml) in etc/kolla and copy the configuration files to / etc/kolla directory

cp -r kolla-ansible/etc/kolla /etc/kolla/

3.3 kolla ansible saves inventory files (all in one and multinode) in ansible / inventory.
Now copy the manifest file to the current directory

cp kolla-ansible/ansible/inventory/* .

4. Ready to deploy

4.1 the passwords used in the deployment are stored in the / etc/kolla/passwords.yml file. Generate a random password by running the following command:

kolla-genpwd

After initialization, keystone can be changed manually_ admin_ Password (OpenStack login password)

vim /etc/kolla/passwords.yml
keystone_admin_password:admin

4.2 configuring multinode files

[control]
10.24.3.12 ansible_user=root ansible_password=1234 ansible_become=true

[network]
10.24.3.12 ansible_user=root ansible_password=1234 ansible_become=true

[external-compute]
10.24.3.11 ansible_user=root ansible_password=1234 ansible_become=true

[monitoring]
10.24.3.12 ansible_user=root ansible_password=1234 ansible_become=true

[storage]
10.24.3.11 ansible_user=root ansible_password=1234 ansible_become=true

[deployment]
localhost       ansible_connection=local

Test: confirm whether the inventory configuration file is correct:

ansible -m ping all

result:
[root@deploy /]# ansible -m ping all
10.24.3.11 | SUCCESS => {
    "changed": false, 
    "ping": "pong"
}
10.24.3.12 | SUCCESS => {
    "changed": false, 
    "ping": "pong"
}

4.3 editing the globals.yml configuration file

kolla_base_distro: "centos"
# binary uses software repositories like apt or yum, source uses original source code archives, git repositories, or local source code directories
kolla_install_type: "source"  
openstack_release: "queens"  # Version used

kolla_internal_vip_address: "192.168.10.120"  # Internal VIP
kolla_external_vip_address: "10.24.3.120"  # External VIP

network_interface: "ens224.10"
kolla_external_vip_interface: "ens192"
api_interface: "ens224.10"

storage_interface: "ens224.20"
cluster_interface: "ens224.20"
tunnel_interface: "ens224.30"

# The interface is active and has no IP address. Otherwise, the instance will not be able to access the external network
neutron_external_interface: "ens256"

enable_cinder: "yes"

5. Start deployment

''' 1,have kolla Boot server deployment dependencies for''' 
kolla-ansible -i ./multinode bootstrap-servers

''' 2,Perform a pre deployment check on the host''' 
kolla-ansible -i ./multinode prechecks

''' 3,implement OpenStack deploy'''
kolla-ansible -i ./multinode deploy

6. Using OpenStack

6.1 OpenStack requires an openrc file that sets the credentials of the admin user.
To generate this file, run the following command:

kolla-ansible post-deploy
. /etc/kolla/admin-openrc.sh

6.2 installing the basic OpenStack CLI client:

pip install python-openstackclient python-glanceclient python-neutronclient

6.3 run scripts to create sample networks, images, etc

. /usr/share/kolla-ansible/init-runonce

Open the browser and enter 10.24.3.120 (external VIP). The user admin and password admin can log in to openstack_dashboard, as shown in the figure:

 
openstack_dashboard.png


Author: no two 1
Link: https://www.jianshu.com/p/6b7ebcb82196
Source: Jianshu
The copyright belongs to the author. For commercial reprint, please contact the author for authorization, and for non-commercial reprint, please indicate the source.

Kolla ansible deploying OpenStack multi node

Posted by hofdiggity on Fri, 03 Dec 2021 05:09:45 -0800