Create Openstack Lab. Part 1 – Nodes Preparation
We’ll deploy an Openstack lab. consists of total 6 nodes (3 controllers + 3 computes)
Specifications for controller and compute nodes:
- 8 vCPU (host)
- 16384 MB RAM
- 32 GB HDD for OS (Ubuntu 20.04)
- 2 x 8 GB HDD for OSD
- 3 NICs
Install MaaS – Check here for how-to guide
Commission and deploy Ubuntu 20.04 on all machines
Create user ‘openstack’
sudo adduser openstack
Add user ‘openstack’ to ‘sudo’ group
sudo usermod -aG sudo openstack
Configure user ‘openstack’ to be able to run ‘sudo’ command without being asked for password
echo "openstack ALL=(ALL) NOPASSWD:ALL" | sudo tee \
/etc/sudoers.d/openstack
Configure SSHd to accept connection with password authentication
sudo vi /etc/ssh/sshd_config
Replace following line from
PasswordAuthentication no
To
PasswordAuthentication yes
Then restart sshd service
sudo systemctl restart sshd
Disable cloud-init:
sudo touch /etc/cloud/cloud-init.disabled
Update and upgrade system
sudo apt update && sudo apt upgrade -y
Disable auto-update
sudo vi /etc/apt/apt.conf.d/20auto-upgrades
Edit following lines from
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
To
APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";
APT::Periodic::Unattended-Upgrade "1";
Reboot system
sudo reboot
Modify /etc/hosts
sudo vi /etc/hosts
Add following lines
10.6.10.10 maas
10.6.10.10 maas.lab1
10.6.10.11 node-1
10.6.10.12 node-2
10.6.10.13 node-3
10.6.10.14 node-4
10.6.10.15 node-5
10.6.10.16 node-6
10.6.10.11 node-1.lab1
10.6.10.12 node-2.lab1
10.6.10.13 node-3.lab1
10.6.10.14 node-4.lab1
10.6.10.15 node-5.lab1
10.6.10.16 node-6.lab1
10.6.11.11 internal.node-1.lab1
10.6.11.12 internal.node-2.lab1
10.6.11.13 internal.node-3.lab1
10.6.11.14 internal.node-4.lab1
10.6.11.15 internal.node-5.lab1
10.6.11.16 internal.node-6.lab1
10.6.12.11 public.node-1.lab1
10.6.12.12 public.node-2.lab1
10.6.12.13 public.node-3.lab1
10.6.12.14 public.node-4.lab1
10.6.12.15 public.node-5.lab1
10.6.12.16 public.node-6.lab1
10.6.13.11 ceph-public.node-1.lab1
10.6.13.12 ceph-public.node-2.lab1
10.6.13.13 ceph-public.node-3.lab1
10.6.13.14 ceph-public.node-4.lab1
10.6.13.15 ceph-public.node-5.lab1
10.6.13.16 ceph-public.node-6.lab1
10.6.14.11 ceph-cluster.node-1.lab1
10.6.14.12 ceph-cluster.node-2.lab1
10.6.14.13 ceph-cluster.node-3.lab1
10.6.14.14 ceph-cluster.node-4.lab1
10.6.14.15 ceph-cluster.node-5.lab1
10.6.14.16 ceph-cluster.node-6.lab1
Do ping test
ping -c 1 maas
ping -c 1 maas.lab1
ping -c 1 node-1
ping -c 1 node-2
ping -c 1 node-3
ping -c 1 node-4
ping -c 1 node-5
ping -c 1 node-6
ping -c 1 node-1.lab1
ping -c 1 node-2.lab1
ping -c 1 node-3.lab1
ping -c 1 node-4.lab1
ping -c 1 node-5.lab1
ping -c 1 node-6.lab1
ping -c 1 internal.node-1.lab1
ping -c 1 internal.node-2.lab1
ping -c 1 internal.node-3.lab1
ping -c 1 internal.node-4.lab1
ping -c 1 internal.node-5.lab1
ping -c 1 internal.node-6.lab1
ping -c 1 public.node-1.lab1
ping -c 1 public.node-2.lab1
ping -c 1 public.node-3.lab1
ping -c 1 public.node-4.lab1
ping -c 1 public.node-5.lab1
ping -c 1 public.node-6.lab1
ping -c 1 ceph-public.node-1.lab1
ping -c 1 ceph-public.node-2.lab1
ping -c 1 ceph-public.node-3.lab1
ping -c 1 ceph-public.node-4.lab1
ping -c 1 ceph-public.node-5.lab1
ping -c 1 ceph-public.node-6.lab1
ping -c 1 ceph-cluster.node-1.lab1
ping -c 1 ceph-cluster.node-2.lab1
ping -c 1 ceph-cluster.node-3.lab1
ping -c 1 ceph-cluster.node-4.lab1
ping -c 1 ceph-cluster.node-5.lab1
ping -c 1 ceph-cluster.node-6.lab1
ping -c 1 10.6.11.1
ping -c 1 10.6.12.1
ping -c 1 10.6.13.1
If all ping test give reply then continue, if not check network configuration and connections
Make host public and private key
ssh-keygen -t rsa -b 4096
Copy host public key to self and all other nodes
ssh-copy-id -i /home/openstack/.ssh/id_rsa.pub openstack@10.6.10.10
ssh-copy-id -i /home/openstack/.ssh/id_rsa.pub openstack@10.6.10.11
ssh-copy-id -i /home/openstack/.ssh/id_rsa.pub openstack@10.6.10.12
ssh-copy-id -i /home/openstack/.ssh/id_rsa.pub openstack@10.6.10.13
ssh-copy-id -i /home/openstack/.ssh/id_rsa.pub openstack@10.6.10.14
ssh-copy-id -i /home/openstack/.ssh/id_rsa.pub openstack@10.6.10.15
ssh-copy-id -i /home/openstack/.ssh/id_rsa.pub openstack@10.6.10.16
Test ssh access to self and other names in /etc/hosts
ssh openstack@node-1.lab1 hostname
ssh openstack@node-2.lab1 hostname
ssh openstack@node-3.lab1 hostname
ssh openstack@node-4.lab1 hostname
ssh openstack@node-5.lab1 hostname
ssh openstack@node-6.lab1 hostname
ssh openstack@ceph-public.node-1.lab1 hostname
ssh openstack@ceph-public.node-2.lab1 hostname
ssh openstack@ceph-public.node-3.lab1 hostname
ssh openstack@ceph-public.node-4.lab1 hostname
ssh openstack@ceph-public.node-5.lab1 hostname
ssh openstack@ceph-public.node-6.lab1 hostname
Answer ‘yes’ and enter password as required. When every test returns proper hostname then we’re done with node preparation.