
Deploying a minimal OpenStack environment for testing or development on a single machine is a common practice, and DevStack provides an incredibly useful tool for this purpose. It automates the complex process of installing and configuring various OpenStack services. This guide focuses on getting DevStack up and running on Ubuntu 22.04 or Ubuntu 20.04, two popular Linux distributions for this kind of work.
Before starting the DevStack installation, ensure your system meets the basic prerequisites. A clean installation of either Ubuntu 22.04 or 20.04 is highly recommended to avoid potential conflicts with existing software. You’ll also need sufficient hardware resources; while DevStack can run on modest systems, more RAM and CPU cores will significantly improve performance.
The first crucial step is to set up a dedicated user for DevStack. Running DevStack as the root user is strongly discouraged due to security implications. Create a new standard user (often named stack
) and grant it sudo
privileges. This user will own the DevStack installation directory and execute the necessary scripts. After creating the user, log in as this new user to perform the subsequent steps.
Next, you need to obtain the DevStack source code. This is typically done by cloning the official DevStack repository from GitHub. Use the git clone
command within the stack user’s home directory.
The core of customizing your DevStack installation lies in the configuration. Navigate into the cloned devstack
directory. Here, you will create a local.conf file. This file is essential as it overrides default settings and allows you to specify which OpenStack services you want to enable, define network settings, passwords, and other parameters. A minimal local.conf should include credentials (like ADMIN_PASSWORD
, DATABASE_PASSWORD
, RABBIT_PASSWORD
, SERVICE_PASSWORD
) and potentially specify IP addresses or interfaces. For a basic setup, enabling core services like Nova (compute), Neutron (networking), Glance (image service), and Keystone (identity service) is typical.
Once the local.conf file is correctly set up, you are ready to deploy. Execute the stack.sh script from within the devstack
directory as the stack user. This script automates the entire installation process: installing dependencies, downloading service code, configuring services, and starting them. This process can take a significant amount of time depending on your internet connection and system performance. Be patient and monitor the output for any errors.
Upon successful completion of the stack.sh script, your OpenStack environment should be running. The script will typically output the URL for the OpenStack dashboard (Horizon) and the credentials required to log in. You can access the dashboard through a web browser to interact with your newly deployed OpenStack cloud.
Remember that a DevStack installation is primarily for development and testing purposes and is not suitable for production use. It’s a fantastic way to quickly spin up an OpenStack environment, experiment with its services, and develop applications that interact with it. Cleaning up a DevStack installation is as simple as running the unstack.sh
script in the same directory, followed by clean.sh
to remove residual files.
Source: https://kifarunix.com/deploy-openstack-using-devstack-on-ubuntu/