Wednesday, November 20, 2024
Google search engine
HomeUncategorisedOpenStack Deployment on Ubuntu 22.04/20.04/18.04 using DevStack

OpenStack Deployment on Ubuntu 22.04/20.04/18.04 using DevStack

Want to deploy a single Server Openstack Cloud on Ubuntu 22.04/20.04/18.04 for Development and test purposes?. This guide is fit for Developers and SysAdmins looking for a simple Openstack Deployment for Learning, PoC, and Development. DevStack is a collection of scripts which enables you to deploy a complete OpenStack environment from git master, in Virtual Machine, Home Desktop or your Laptop.

For CentOS, check: How To Deploy OpenStack Cloud on CentOS 7 With Packstack RDO

DevStack Minimum Requirements

  • Fresh installation of Ubuntu 22.04/20.04/18.04
  • Minimum memory of 4 GB
  • At least 2 vCPU
  • The storage capacity of 10 GB should be sufficient.
  • Internet connection
  • User with sudo

Step 1: Update Ubuntu system

Login to your Ubuntu system – Can be Desktop or VM in the Cloud and update it.

sudo apt update && sudo apt -y upgrade

Reboot it after an upgrade.

[ -e /var/run/reboot-required ] && sudo reboot

Step 2: Add Stack User

Devstack should be run as a non-root user with sudo enabled. If you’re running your instance in the cloud, standard logins to cloud images such as “centos” or “ubuntu” or “cloud-user” are usually fine.

For other installations of Ubuntu 20.04/18.04, run the commands below to create DevStack deployment user.

sudo useradd -s /bin/bash -d /opt/stack -m stack

Enable sudo privileges for this user without need for a password.

echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack

Switch to stack user to test.

jmutai@devstack:~$ sudo su - stack
stack@devstack:~$ sudo su -
root@devstack:~# 

Step 3: Download DevStack

Clone Destack deployment code from Github.

su - stack
sudo apt -y install git
git clone https://git.openstack.org/openstack-dev/devstack

Create a local.conf file with 4 passwords and Host IP address.

cd devstack
nano local.conf

Add:

[[local|localrc]]

# Password for KeyStone, Database, RabbitMQ and Service
ADMIN_PASSWORD=StrongAdminSecret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD

# Host IP - get your Server/VM IP address from ip addr command
HOST_IP=192.168.10.100

Step 4: Start Openstack Deployment on Ubuntu using DevStack

Now that you’ve configured the minimum required config to get started with DevStack, start the installation of Openstack.

cd devstack
./stack.sh

DevStack will install;

  • Keystone – Identity Service
  • Glance – Image Service
  • Nova – Compute Service
  • Placement – Placement API
  • Cinder – Block Storage Service
  • Neutron – Network Service
  • Horizon – Openstack Dashboard

This will take a 15 – 20 minutes, largely depending on the speed of your internet connection. At the end of the installation process, you should see output like this:

This is your host IP address: 192.168.10.100
This is your host IPv6 address: 2a01:4f8:c2c:308e::1
Horizon is now available at http://192.168.10.100/dashboard
Keystone is serving at http://192.168.10.100/identity/

The default users are: admin and demo
The password: StrongAdminSecret

WARNING:
Using lib/neutron-legacy is deprecated, and it will be removed in the future

Services are running under systemd unit files.
For more information see: https://docs.openstack.org/devstack/latest/systemd.html
DevStack Version: stein
Change: 8bdbf850967b90ebdca428247bb93ad2eb6478c0 Merge "Set ownership of /etc/pki/ files for TLS" 2019-03-26 08:07:26 +0000
OS Version: Ubuntu 18.04 bionic
2019-03-26 21:32:56.743 | stack.sh completed in 1761 seconds.

Step 5: Access OpenStack Dashboard

Copy the Horizon URL shown on the installation output and paste it into your web browser:

http://192.168.10.100/dashboard

Use the default users demo or admin and configured password to login.

deploy openstack devstack ubuntu login

You should see Openstack Management Web console after logging in.

deploy openstack devstack dashboard

If you want to use Openstack command-line tool to manage your devstack. You’ve to source openrc in your shell.

source openrc

You can now add instance images to Glance to use when creating Virtual Machines with Nova. We have a comprehensive guide on Adding images to Openstack Glance.

Adding Cirros Test Image

Download Virtual Image.

VERSION=$(curl -s http://download.cirros-cloud.net/version/released)
wget http://download.cirros-cloud.net/$VERSION/cirros-$VERSION-x86_64-disk.img

Upload it to Glance.

openstack image create \
    --container-format bare \
    --disk-format qcow2 \
    --file cirros-$VERSION-x86_64-disk.img \
    Cirros

Confirm image upload.

openstack image list

It should be visible from the Web UI

openstack glance images

To learn more about DevStack customization, check the system configuration guide. This includes making adjustments to the default networking. Also refer to Openstack Documentation for administration guide.

We have Production deployment guides based on CentOS: Installation of Openstack three Node Cluster on CentOS 7

More on OpenStack:

How To Create OpenStack Instance With a Fixed / Static IP Address

How To Create OpenStack projects, users and roles

How To Migrate OpenStack Instance from one Compute Host to Another

How To Resize OpenStack Instance / Virtual Machine

Adding ssh key pair to Openstack using cli

How to add flavors to openstack using cli

RELATED ARTICLES

Most Popular

Recent Comments