Ghost Cloud is a lightweight private cloud platform for managing VMs on local infrastructure using KVM/Libvirt and Terraform.
- Simplicity - Easy to understand and operate
- Modularity - Clean separation of concerns
- Production-ready - Suitable for real workloads (small scale)
- Multi-environment - Separate dev/staging/prod
- Virtualization: KVM/QEMU/Libvirt
- Infrastructure as Code: Terraform
- VM Configuration: Cloud-init
- CLI: Bash scripts
┌─────────────────────────────────────────┐
│ Ghost Cloud CLI │
│ (Interactive + Direct Commands) │
└──────────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ Terraform │
│ (Infrastructure as Code) │
└──────────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ Libvirt/KVM │
│ (Virtualization Layer) │
└──────────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ Physical Host (Your Machine) │
└─────────────────────────────────────────┘
- bootstrap/ - One-time setup scripts
- cloud - Main CLI entry point
- environments/ - Environment-specific configs
- terraform/ - Infrastructure definitions
- terraform/modules/ - Reusable Terraform modules
- templates/ - VM provisioning scripts
- scripts/ - Operational scripts
- data/ - Runtime state and logs
- User runs:
./ghost create web-1 --flavor compute.medium --template nginx - CLI reads flavor from
flavors.yaml - CLI calls Terraform with parameters
- Terraform creates VM using instance module
- Cloud-init runs template script on first boot
- VM boots and gets IP via DHCP
- Terraform outputs VM details
- User can SSH:
./ghost ssh web-1
- Default Network: NAT mode (192.168.122.0/24)
- DHCP: Automatic IP assignment
- DNS: Local resolution via libvirt
- SSH: Direct access from host
- SSH key-based authentication
- No password authentication
- Sudo access for ubuntu user
- Firewalls configured per template
- AppArmor disabled for libvirt (compatibility)
Current design supports:
- 10-50 VMs comfortably
- Single physical host
- 1-5 administrators
To scale beyond:
- Add load balancer module
- Implement shared storage (Ceph/NFS)
- Add multiple compute nodes
- Centralized monitoring
- Declarative infrastructure
- State management
- Modular and reusable
- Industry standard
- Production-grade hypervisor
- Same technology as AWS/GCP
- Native Linux support
- No licensing costs
- Standard VM configuration method
- Same as AWS EC2
- Flexible and extensible
- Well-documented
- Single host (no HA)
- Manual scaling
- Basic networking
- Local state storage