Skip to content

iinsys/openstack-ansible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Minimal OpenStack Cloud Lab

A learning-focused OpenStack deployment using Multipass VMs and Ansible automation.

🎯 Project Goals

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"

πŸ—οΈ Architecture

High-Level Topology

OpenStack Architecture

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 Architecture

Network Architecture

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

πŸš€ Quick Start

Prerequisites

Before you begin, ensure you have the following installed on your system:

πŸ–₯️ Operating System

  • macOS 10.15+ or Linux (Ubuntu 20.04+, CentOS 8+, Fedora 32+)
  • Windows: Use WSL2 with Ubuntu or Multipass for Windows

πŸ› οΈ Required Software

  1. Multipass - Lightweight VM manager

  2. 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+
  3. 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+
  4. Git - Version control

    • macOS: brew install git
    • Ubuntu/Debian: sudo apt install git
    • CentOS/RHEL: sudo yum install git
    • Windows: Git for Windows

πŸ’» System Requirements

  • RAM: Minimum 8GB (16GB recommended)
  • Storage: At least 20GB free space
  • CPU: 4 cores minimum (8 cores recommended)
  • Network: Internet connection for downloads

πŸ”§ Optional but Recommended

  • 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

πŸ“‹ Quick Verification

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

🚨 Troubleshooting Prerequisites

If you encounter issues:

  1. 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
  2. Ansible connection issues:

    • Install SSH client: sudo apt install openssh-client (Linux)
    • macOS: SSH is included by default
  3. Python dependencies:

    • Upgrade pip: pip3 install --upgrade pip
    • Install build tools: sudo apt install build-essential (Linux)
  4. Permission issues:

    • Ensure you have sudo access
    • Check file permissions on scripts

Installation

  1. Clone the repository:

    git clone https://github.com/iinsys/openstack-ansible
    cd openstack-ansible
  2. Setup environment:

    ./setup.sh
  3. Configure environment variables:

    cp env.example .env
    # Edit .env with your preferences (optional)
  4. Create Multipass VMs:

    ./scripts/create-vms.sh
  5. Deploy OpenStack:

    ansible-playbook site.yml
  6. Access Horizon Dashboard:

πŸ“ Project Structure

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/

πŸŽ“ Learning Path

  1. Week 1: Infrastructure Setup

    • Understanding Multipass and VM management
    • Basic Ansible concepts and inventory
    • Network planning and IP addressing
  2. Week 2: Identity Service (Keystone)

    • Authentication and authorization concepts
    • Service catalog and endpoints
    • User, project, and role management
  3. Week 3: Image Service (Glance)

    • Image formats and metadata
    • Image upload and management
    • Integration with other services
  4. Week 4: Compute Service (Nova)

    • Virtual machine lifecycle
    • Hypervisor integration (KVM/QEMU)
    • Scheduling and resource management
  5. Week 5: Networking Service (Neutron)

    • Virtual network concepts
    • Provider and tenant networks
    • Security groups and floating IPs
  6. Week 6: Integration and Testing

    • End-to-end deployment testing
    • Dashboard access and CLI usage
    • Troubleshooting common issues

πŸ”§ Configuration

Environment Variables

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

Important Security Notes

⚠️ Security Best Practices:

  • 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

πŸ§ͺ Testing Your Deployment

After deployment, test your OpenStack installation:

  1. Upload a test image:

    openstack image create --file cirros-0.5.2-x86_64-disk.img --disk-format qcow2 --container-format bare cirros
  2. Create a network:

    openstack network create test-network
    openstack subnet create --network test-network --subnet-range 10.0.0.0/24 test-subnet
  3. Launch an instance:

    openstack server create --image cirros --flavor m1.tiny --network test-network test-instance

πŸ“š Additional Resources

🀝 Contributing

This is a learning project! Feel free to:

  • Report issues
  • Suggest improvements
  • Add new features
  • Improve documentation

πŸ“„ License

MIT License - see LICENSE file for details.

About

Openstack minimal setup

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published