OpenStack Setup All in One
This guide deploys OpenStack 2024.2 (Dalmatian) on a single Ubuntu 22.04 server using DevStack.
Prerequisites
- OS: Ubuntu 22.04 LTS (fresh install, no GUI)
- RAM: 8 GB minimum (16 GB recommended)
- Disk: 60 GB free space
- CPU: 4 vCPUs
- Network: Static IP, internet access, DNS configured
- User: Non-root user with
sudoprivileges
Step 1: Create the Stack User
Create a dedicated user with passwordless sudo access.
sudo useradd -s /bin/bash -d /opt/stack -m stack
sudo chmod +x /opt/stack
echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
sudo -u stack -i
Step 2: Clone DevStack
Clone the repository and checkout the stable branch for Dalmatian.
git clone https://opendev.org/openstack/devstack -b stable/2024.2
cd devstack
Step 3: Configure local.conf
Create the configuration file, replacing 10.0.0.10 with your server's actual IP address.
cat > local.conf <<EOF
[[local|localrc]]
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=secret
RABBIT_PASSWORD=secret
SERVICE_PASSWORD=secret
HOST_IP=10.0.0.10
FLOATING_RANGE=10.0.0.0/24
FIXED_RANGE=10.0.0.0/24
# Core Services
enable_service placement-api
enable_service neutron
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
# Neutron OVN Backend
Q_AGENT=ovn
Q_ML2_PLUGIN_MECHANISM_DRIVERS=ovn
Q_ML2_TENANT_NETWORK_TYPE=geneve
# Cinder LVM Backend
enable_service c-vol c-api c-sch
CINDER_VOLUME_BACKEND=lvm
# Logging
LOGFILE=/opt/stack/logs/stack.sh.log
LOG_COLOR=True
# Service Versions
NOVA_BRANCH=stable/2024.2
GLANCE_BRANCH=stable/2024.2
KEYSTONE_BRANCH=stable/2024.2
NEUTRON_BRANCH=stable/2024.2
CINDER_BRANCH=stable/2024.2
EOF
Step 4: Run the Installer
Execute the stack script, which takes 20–45 minutes to complete.
./stack.sh
Step 5: Verify the Installation
Source the admin credentials and validate that all services report up and enabled.
source openrc admin admin
openstack service list
openstack network agent list
openstack compute service list
Step 6: Access the Dashboard
Open Horizon in a web browser at http://<HOST_IP>/dashboard using username admin and password secret.
Step 7: Launch a Test Instance
Create a network, router, and boot a VM to validate the deployment.
# Create network and subnet
openstack network create demo-net
openstack subnet create --network demo-net \
--subnet-range 192.168.100.0/24 demo-subnet
# Create router and attach to public network
openstack router create demo-router
openstack router set --external-gateway public demo-router
openstack router add subnet demo-router demo-subnet
# Boot instance (requires Cirros image)
openstack server create --flavor m1.tiny \
--image cirros-0.6.2-x86_64-disk \
--network demo-net \
test-vm
openstack server list
Managing the AIO Deployment
- Restart all services:
cd /opt/stack/devstack && ./rejoin-stack.sh - Tear down completely:
cd /opt/stack/devstack && ./unstack.sh - Clean and rebuild:
cd /opt/stack/devstack && ./clean.sh && ./stack.sh - View logs:
tail -f /opt/stack/logs/stack.sh.log
Troubleshooting
stack.shfails mid-run: Inspect/opt/stack/logs/stack.sh.logfor the last error.- Port 80 already in use: Stop conflicting services:
sudo systemctl stop apache2 nginx - Out of disk space: DevStack requires 60 GB+; expand the partition or use a larger disk.
- Neutron agents down: Restart OVN agents:
sudo systemctl restart devstack@q-*