Skip to content

Home Lab

Notes from my learning sessions

Menu
Menu

Openstack – Train : Install OS (Ubuntu Bionic) and customize

Posted on October 9, 2020February 4, 2023 by sandeep

                                                                                                                                                               Pre-requisites for Openstack  >>>

Installation of OS : Downloaded Ubuntu ISO image and used it for installing nodes.

Cinder storage required a dedicated partition.  Ensure that a partition is available for the same.

If the plan is to install openstack services on more than one hosts, ensure that you are able to ping each other with host names.  Either you could have the hostnames resolved by a DNS service in your network or you might add required entries in /etc/hosts of all the nodes.

Post installation : Update /etc/hosts – removed IPv6 entries, removed 127.0.1.1 entry – contents after update.

The example is for two node installation, the second one is a dedicated compute node.

127.0.0.1 localhost
10.99.1.3 controller
10.99.1.4 compute

Disable swap usage on all nodes.  

$ sudo systemctl list-units | grep swap
swapfile.swap loaded active active /swapfile
swap.target loaded active active Swap
$

sudo systemctl stop swapfile.swap
sudo systemctl stop swap.target sudo systemctl disable swapfile.swap
sudo systemctl disable swap.target
sudo systemctl mask swapfile.swap
sudo systemctl mask swap.target
sudo swapoff -a

$ ls -ltr /swap*
-rw------- 1 root root 746009600 Jan 29 19:56 /swapfile
$
sudo rm -f /swapfile

Edit /etc/fstab and remove the line related to swap (or comment it out.)  After editing 

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/vda1 during installation
UUID=5a72ad2d-cb54-4048-a4c6-65332f1d705e / ext4 errors=remount-ro 0 1
#/swapfile none swap sw 0 0

Update repository information and install required tools (without libblockdev-mdraid2 had observed some errors in syslog during startup).

sudo apt update
sudo apt upgrade -y
sudo apt install -y net-tools curl make libblockdev-mdraid2 crudini

Install ifupdown to replace netplan – This is more of a personal choice. 

sudo apt install -y ifupdown

With ifupdown, legacy networking, Network configurations to be done in /etc/network/interfaces

Note: We will use only two interfaces, eno1 for management and eno2 for provider network.  (In my server interfaces are detected as eno1, eno2 etc)

References :

https://docs.openstack.org/neutron/train/install/common/get-started-networking.html

https://docs.openstack.org/neutron/train/install/concepts.html

https://docs.openstack.org/neutron/train/install/controller-install-obs.html#configure-networking-options

Update the contents of /etc/network/interfaces with following configuration

source-directory /etc/network/interfaces

auto eno1
iface eno1 inet static
address 10.99.1.3/16
gateway 10.99.0.1

auto eno2
iface eno2 inet manual
up ip link set dev $IFACE up
down ip link set dev $IFACE down

Uncomment and update the configurations in /etc/systemd/resolved.conf.
[Resolve]
DNS=10.99.0.1
FallbackDNS=8.8.8.8

Create a soft link to the systemd generated resolv.conf

sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
sudo systemctl restart systemd-resolved.service

Disable systemd-networkd, uninstall netplan  and enable legacy networking services.

(I had executed these from console to avoid temporary network connectivity disruptions – probably having a script perform the following steps would be an alternate)

sudo systemctl stop systemd-networkd.socket systemd-networkd networkd-dispatcher.service systemd-networkd-wait-online

sudo systemctl disable systemd-networkd.socket systemd-networkd networkd-dispatcher.service systemd-networkd-wait-online

sudo systemctl mask systemd-networkd.socket systemd-networkd networkd-dispatcher.service systemd-networkd-wait-online

sudo apt -y purge nplan netplan.io

sudo systemctl unmask networking

sudo systemctl enable networking

Though not required I rebooted the server to verify the network configurations work as expected.

sudo reboot

Disable message of the day. Edit /etc/default/motd-news and set ENABLE=0 and then

sudo systemctl disable motd-news.timer
sudo systemctl mask motd-news.timer

Remove execute permissions for motd scripts 

sudo chmod -x /etc/update-motd.d/10-help-text /etc/update-motd.d/50-motd-news /etc/update-motd.d/90-updates-available /etc/update-motd.d/91-release-upgrade

Comment out the following lines in /etc/pam.d/sshd as shown below

# session optional pam_motd.so motd=/run/motd.dynamic
# session optional pam_motd.so noupdate
# session optional pam_mail.so standard noenv # [1]

Optionally enable ‘root’ login (SSH) to the server – Uncomment and update the following configurations in /etc/ssh/sshd_config file

PermitRootLogin yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2

Set a password for ‘root’ account

sudo passwd

Restart ssh daemon

sudo service sshd restart

Disable periodic package list updates – Edit /etc/apt/apt.conf.d/10periodic  and set all values to zero as shown below.

APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";

Disable and stop any upgrade daemons

$ sudo  systemctl list-units | grep upgrade
unattended-upgrades.service loaded active running Unattended Upgrades Shutdown
apt-daily-upgrade.timer loaded active waiting Daily apt upgrade and clean activities
$ sudo systemctl stop unattended-upgrades.service
$ sudo systemctl stop apt-daily-upgrade.timer
$ sudo systemctl disable unattended-upgrades.service
Synchronizing state of unattended-upgrades.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable unattended-upgrades
$ sudo systemctl disable apt-daily-upgrade.timer
Removed /etc/systemd/system/timers.target.wants/apt-daily-upgrade.timer.

Check if any snap services are running

sudo snap list

If any applications are listed remove them before uninstalling snap

sudo snap remove lxd
sudo snap remove core
sudo snap remove snapd

Uninstall snapd

sudo apt purge -y snapd
sudo apt -y autoremove

rm -rf ~/snap
sudo rm -rf /snap
sudo rm -rf /var/snap
sudo rm -rf /var/lib/snapd

Configure timezone as required

timedatectl set-timezone Asia/Kolkata

Install and configure chrony for time synchronization

apt install -y chrony

Optional : Edit /etc/chrony/chrony.conf, Comment out pool entries and add one server entry as shown below

#pool ntp.ubuntu.com iburst maxsources 4
#pool 0.ubuntu.pool.ntp.org iburst maxsources 1
#pool 1.ubuntu.pool.ntp.org iburst maxsources 1
#pool 2.ubuntu.pool.ntp.org iburst maxsources 2
server time.google.com iburst

Restart chrony services

systemctl restart chronyd.service

To running out of file descriptor handles – Add the following at the end of /etc/security/limits.conf

* nproc hard 65535
* nproc soft 65535
* nofiles hard 65535
* nofiles soft 65535

Edit /etc/sysctl.conf and ensure the following configuration are uncommented and value set to 1.  Add if not present. [ Disabling IPv6 – more of a personal choice ]

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-arptables=1
net.ipv4.ip_forward = 1

Reboot the node.
sudo reboot

                                                                                                                                                              Pre-requisites for Openstack >>>

Recent Posts

  • Openstack Xena on Ubuntu 20.04 – Cinder
  • Preparing custom Debian 11 MATE image
  • Setup Ubuntu 20.04 repository mirror server
  • Preparing custom Debian 11 server cloud image
  • Complile Linux Kernel (on Debian 11)
  • Openstack Xena – Test Home Lab
  • Openstack Xena on Ubuntu 20.04 – Horizon
  • Openstack Xena on Ubuntu 20.04 -Home Lab
  • Openstack Xena on Ubuntu 20.04 – Neutron
  • Openstack Xena on Ubuntu 20.04 – Nova

Archives

  • April 2022
  • March 2022
  • February 2022
  • December 2021
  • October 2021
  • September 2021
  • October 2020
  • February 2020
  • January 2020
  • December 2019
© 2023 Home Lab | Powered by Minimalist Blog WordPress Theme