A learning-focused OpenStack deployment using Multipass VMs and Ansible automation.
This project helps you understand:
- How cloud infrastructure components interact
- How to configure OpenStack services manually (via Ansible roles)
- How virtual networking works in a cloud platform
- How to automate full deployment from "empty VMs" to "running cloud"
Key Components:
-
Controller Node: Central management for all OpenStack services
- Keystone: Identity and authentication service
- Glance: Image storage and management
- Nova Controller: VM scheduling and orchestration
- Neutron Controller: Network management and routing
- MySQL: Central database for all services
- RabbitMQ: Message queue for service communication
-
Compute Node: VM execution and local networking
- Nova Compute: Hypervisor management and VM lifecycle
- Neutron Agent: Local network configuration
- Libvirt: Virtualization interface to KVM/QEMU
-
Provider Network: External network connectivity
- br-ex: Bridge interface for external network access
- Floating IPs: Public IP addresses for VM access
Network Layout:
-
Host Machine: Your computer running Multipass
- Multipass: VM management and orchestration
-
Virtual Network (192.168.1.0/24): Internal network for VMs
- Controller VM (192.168.1.10): OpenStack management services
- Compute VM (192.168.1.11): VM execution and networking
- Gateway (192.168.1.1): Internet connectivity
-
Provider Network: External network for VM access
- br-ex Bridge: Network bridge for external connectivity
- Floating IPs (192.168.1.100-200): Public IPs for VM access
Before you begin, ensure you have the following installed on your system:
- macOS 10.15+ or Linux (Ubuntu 20.04+, CentOS 8+, Fedora 32+)
- Windows: Use WSL2 with Ubuntu or Multipass for Windows
-
Multipass - Lightweight VM manager
- macOS:
brew install --cask multipass
- Ubuntu:
sudo snap install multipass
- Other Linux: Installation Guide
- Windows: Windows Installation
- Minimum Version: 1.8.0+
- macOS:
-
Ansible - Automation tool
- macOS:
brew install ansible
- Ubuntu/Debian:
sudo apt install ansible
- CentOS/RHEL:
sudo yum install ansible
- pip:
pip3 install ansible
- Minimum Version: 2.9.0+
- macOS:
-
Python - Programming language
- macOS:
brew install python3
- Ubuntu/Debian:
sudo apt install python3 python3-pip
- CentOS/RHEL:
sudo yum install python3 python3-pip
- Minimum Version: 3.8+
- macOS:
-
Git - Version control
- macOS:
brew install git
- Ubuntu/Debian:
sudo apt install git
- CentOS/RHEL:
sudo yum install git
- Windows: Git for Windows
- macOS:
- RAM: Minimum 8GB (16GB recommended)
- Storage: At least 20GB free space
- CPU: 4 cores minimum (8 cores recommended)
- Network: Internet connection for downloads
- SSH Key: Generate if you don't have one:
ssh-keygen -t rsa -b 4096
- Text Editor: VS Code, Vim, or your preferred editor
- Terminal: iTerm2 (macOS) or your preferred terminal
Run these commands to verify your setup:
# Check Multipass
multipass version
# Check Ansible
ansible --version
# Check Python
python3 --version
# Check Git
git --version
# Check SSH key (optional)
ls -la ~/.ssh/id_rsa.pub
If you encounter issues:
-
Multipass not working:
- macOS: Ensure virtualization is enabled in System Preferences
- Linux: Install KVM/QEMU:
sudo apt install qemu-kvm libvirt-daemon-system
- Windows: Enable Hyper-V or use WSL2
-
Ansible connection issues:
- Install SSH client:
sudo apt install openssh-client
(Linux) - macOS: SSH is included by default
- Install SSH client:
-
Python dependencies:
- Upgrade pip:
pip3 install --upgrade pip
- Install build tools:
sudo apt install build-essential
(Linux)
- Upgrade pip:
-
Permission issues:
- Ensure you have sudo access
- Check file permissions on scripts
-
Clone the repository:
git clone https://github.com/iinsys/openstack-ansible cd openstack-ansible
-
Setup environment:
./setup.sh
-
Configure environment variables:
cp env.example .env # Edit .env with your preferences (optional)
-
Create Multipass VMs:
./scripts/create-vms.sh
-
Deploy OpenStack:
ansible-playbook site.yml
-
Access Horizon Dashboard:
- URL: http://192.168.1.10/horizon
- Username: admin
- Password: admin123
openstack-ansible/
βββ README.md # This file
βββ site.yml # Main Ansible playbook
βββ setup.sh # Environment setup script
βββ env.example # Environment variables template
βββ requirements.txt # Python dependencies
βββ ansible.cfg # Ansible configuration
βββ .gitignore # Git ignore rules
βββ LICENSE # MIT License
βββ CONTRIBUTING.md # Contributing guidelines
βββ CHANGELOG.md # Version history
βββ inventory/ # Ansible inventory
β βββ hosts.yml
βββ roles/ # Ansible roles
β βββ common/ # Base system setup
β βββ keystone/ # Identity service
β βββ glance/ # Image service
β βββ nova/ # Compute service
β βββ neutron/ # Networking service
βββ scripts/ # Helper scripts
β βββ create-vms.sh
βββ docs/ # Documentation
β βββ images/ # Architecture diagrams
β βββ architecture.md # Detailed architecture
β βββ networking.md # Networking guide
β βββ troubleshooting.md # Troubleshooting guide
βββ configs/ # Service configurations
βββ keystone/
βββ glance/
βββ nova/
βββ neutron/
-
Week 1: Infrastructure Setup
- Understanding Multipass and VM management
- Basic Ansible concepts and inventory
- Network planning and IP addressing
-
Week 2: Identity Service (Keystone)
- Authentication and authorization concepts
- Service catalog and endpoints
- User, project, and role management
-
Week 3: Image Service (Glance)
- Image formats and metadata
- Image upload and management
- Integration with other services
-
Week 4: Compute Service (Nova)
- Virtual machine lifecycle
- Hypervisor integration (KVM/QEMU)
- Scheduling and resource management
-
Week 5: Networking Service (Neutron)
- Virtual network concepts
- Provider and tenant networks
- Security groups and floating IPs
-
Week 6: Integration and Testing
- End-to-end deployment testing
- Dashboard access and CLI usage
- Troubleshooting common issues
The project uses environment variables for configuration. Copy the example file and customize it:
# Copy the example environment file
cp env.example .env
# Edit the configuration
nano .env
Key configuration sections in .env
:
- VM Configuration: VM names, IPs, and resource allocation
- Network Configuration: Provider and tenant network settings
- OpenStack Configuration: Release version and region settings
- Database Configuration: MySQL passwords and settings
- Service Passwords: Individual service authentication
- Optional Features: Enable/disable additional services
- Change default passwords in production
- Use strong, unique passwords for each service
- Keep your
.env
file secure and never commit it to version control - The
.env
file is already included in.gitignore
After deployment, test your OpenStack installation:
-
Upload a test image:
openstack image create --file cirros-0.5.2-x86_64-disk.img --disk-format qcow2 --container-format bare cirros
-
Create a network:
openstack network create test-network openstack subnet create --network test-network --subnet-range 10.0.0.0/24 test-subnet
-
Launch an instance:
openstack server create --image cirros --flavor m1.tiny --network test-network test-instance
This is a learning project! Feel free to:
- Report issues
- Suggest improvements
- Add new features
- Improve documentation
MIT License - see LICENSE file for details.