Build Private Cloud with OpenStack Kolla-ansible Step by Step Guide 1.0 -Part 2 -OS Preparation
Index
Part 3 Prepare Docker Registry
Part 5-Ceph Cluster Troubleshooting
Part 6-Deploy Openstack with Kolla-ansible
Part 7-Openstack Cluster Post Installation
Ubuntu Configuration
In this guide, I am not going to repeat on how to install Ubuntu 20.04, there are plenty of guides there, I will focus on packages preparation after you have Ubuntu 20.04 been installed.
The following task running on all of the nodes
apt update
Configure hostname
sudo hostnamectl set-hostname openstack-controller01sudo hostnamectl set-hostname openstack-controller02sudo hostnamectl set-hostname openstack-controller03sudo hostnamectl set-hostname openstack-ceph01sudo hostnamectl set-hostname openstack-ceph02sudo hostnamectl set-hostname openstack-ceph03sudo hostnamectl set-hostname openstack-compute01sudo hostnamectl set-hostname openstack-compute02sudo hostnamectl set-hostname openstack-staging
Configure /etc/hosts
root@openstack-controller01:~# cat /etc/hosts127.0.0.1 localhost192.168.0.1 openstack-controller01192.168.0.2 openstack-controller02192.168.0.3 openstack-controller03192.168.0.4 openstack-ceph01192.168.0.5 openstack-ceph02192.168.0.6 openstack-ceph03192.168.0.7 openstack-compute01192.168.0.8 openstack-compute02192.168.0.9 openstack-staging192.168.0.254 openstack-int.your-domain.com ##<< make sure this match with global.yml file VIP FQDN.10.196.24.221 openstack-vip.your-domain.com
SSH Configuration
sudo vim /etc/ssh/sshd_config
# Change the following lines:Line 100 #ClientAliveInterval 0
Line 101 #ClientAliveCountMax 3# Change to
ClientAliveInterval 60
ClientAliveCountMax 60
Restart SSH service
sudo systemctl restart sshd && systemctl status sshd
Configure SSH allow root login
sed -i '/PermitRootLogin/d' /etc/ssh/sshd_config
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
service sshd reload
SSH password-less login, openstack-staging machine only
ssh-keygen
ssh-copy-id -o StrictHostKeyChecking=no root@openstack-controller01
ssh-copy-id -o StrictHostKeyChecking=no root@openstack-controller02
ssh-copy-id -o StrictHostKeyChecking=no root@openstack-controller03
ssh-copy-id -o StrictHostKeyChecking=no root@openstack-ceph01
ssh-copy-id -o StrictHostKeyChecking=no root@openstack-ceph02
ssh-copy-id -o StrictHostKeyChecking=no root@openstack-ceph03
ssh-copy-id -o StrictHostKeyChecking=no root@openstack-compute01
ssh-copy-id -o StrictHostKeyChecking=no root@openstack-compute02
Install git gcc and python3-pip
sudo apt-get install git gcc python3-pip sshpass -y
Install Dependencies
sudo apt-get install python3-dev libffi-dev libssl-dev -y
Install Docker Dependencies
sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common -y
Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Setup Docker Repo
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Install Docker Engine
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
Configure docker auto-start
sudo systemctl enable docker && systemctl start docker && sudo systemctl status docker
Install pip
sudo apt install python3-pip
sudo pip3 install -U pip
Install ansible
sudo apt install ansible
Install kolla-ansible on staging machine only
sudo pip3 install kolla-ansible==12.0.0.0rc1
Create /etc/kolla directory
sudo mkdir -p /etc/kolla
sudo chown $USER:$USER /etc/kolla
Copy globals.yml and passwords.yml to the new you created in previous step /etc/kolla
cp -r /usr/local/share/kolla-ansible/etc_examples/kolla/* /etc/kolla
Copy all-in-one and multinode file into /root directory
cp /usr/local/share/kolla-ansible/ansible/inventory/* .
Download kolla-ansible on staging machine
Git clone kolla and kolla-ansible repo
git clone https://github.com/openstack/kolla
git clone https://github.com/openstack/kolla-ansible
cd kolla
git checkout stable/wallaby
cd ../kolla-ansible
git checkout stable/wallaby
Install kolla-ansible
pip install ./kolla
pip install ./kolla-ansible
Create the /etc/kolla directory.
sudo mkdir -p /etc/kolla
sudo chown $USER:$USER /etc/kolla
Copy the configuration files to /etc/kolla directory. kolla-ansible holds the configuration files ( globals.yml and passwords.yml) in etc/kolla.
cp -r kolla-ansible/etc/kolla/* /etc/kolla
Copy the inventory files to the current directory. kolla-ansible holds inventory files ( all-in-one and multinode) in the ansible/inventory directory.
cp kolla-ansible/ansible/inventory/* .
Configure ansible
For best results, Ansible configuration should be tuned for your environment. For example, add the following options to the Ansible configuration file /etc/ansible/ansible.cfg:
[defaults]
host_key_checking=False
pipelining=True
forks=100
Now, we have every ready on Host OS packages, in next session, we will start init-install preparation.