An open API service indexing awesome lists of open source software.

https://github.com/muthukumar-subramaniam/server-hub

A QEMU/KVM-based automation lab for end-to-end VM provisioning that manages the complete lifecycle of virtual machines, with multi-distribution support, providing a powerful environment for learning, testing, and experimenting with Linux-based technologies.
https://github.com/muthukumar-subramaniam/server-hub

build-automation development devops homelab-automation kubernetes lab-automation linux linux-server opensuse os-provisioning platform-engineering qemu qemu-kvm rhel testing ubuntu virtualization vm-automation vm-provisioning

Last synced: 2 days ago
JSON representation

A QEMU/KVM-based automation lab for end-to-end VM provisioning that manages the complete lifecycle of virtual machines, with multi-distribution support, providing a powerful environment for learning, testing, and experimenting with Linux-based technologies.

Awesome Lists containing this project

README

          

# ๐Ÿš€ Server-Hub: Build Your Own QEMU/KVM Virtual Home Lab

[![stable release](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Muthukumar-Subramaniam/server-hub/main/project_version.json)](https://github.com/Muthukumar-Subramaniam/server-hub/releases/latest)

Transform your Linux workstation into a powerful, automated virtual datacenter! This project allows you to build and manage a virtual home lab, making it easy to deploy, break, and rebuild Linux VMs effortlessly. It automates VM provisioning, manages the complete lifecycle of your VMs, and provides a flexible environment for learning, testing, and experimenting with Linux-based technologies.

Although many open-source alternatives exist, I built this project for the fun of creating something of my own and sharing it with anyone with similar interests.

> โš ๏ธ **DISCLAIMER:** This project is intended for **testing**, **development**, and **experimentation** purposes only.

---

## ๐ŸŽฏ What You'll Get

- ๐Ÿš€ **Automated VM provisioning** via PXE boot & golden images
- ๐ŸŒ **Dynamic DNS management** for your local domain
- ๐Ÿ”ง **Full infrastructure-as-code** automation
- ๐Ÿ’ป **Professional datacenter experience** on your workstation
- ๐ŸŽฎ **Complete VM lifecycle management** with enterprise-grade tools
- ๐Ÿงช **Experiment freely** โ€“ Spin up and destroy VMs in seconds

---

## ๐Ÿ–ฅ๏ธ Automated Lab Environment for Provisioning and Managing Linux VMs

### ๐Ÿง  Central Infra Server VM's OS
The central lab infrastructure server VM is designed to run on **AlmaLinux 10** by default, providing all the essential services for managing the lab environment.

### ๐Ÿ“ฆ VM Guest OS Provisioning

The lab infrastructure server centrally manages all guest VM provisioning using automation scripts and configuration templates.

The toolkits provide automated VM provisioning for all three major Linux families, including ready-to-use configurations for:

| Distro Family | Supported OSes | Provisioning Method | Status |
|------------------|-----------------------------------------------|-------------------------------|--------------------------|
| Red Hat-based | AlmaLinux | Kickstart | โœ… Included by default |
| | Rocky, Oracle Linux, RHEL, CentOS Stream | Kickstart | ๐Ÿ”ง Customizable |
| Debian-based | Ubuntu LTS | Cloud-init (`cloud-config`) | ๐Ÿ”ง Customizable |
| SUSE-based | openSUSE Leap | AutoYaST | ๐Ÿ”ง Customizable |

---

## ๐Ÿงพ Minimum System Requirements

> These are the minimum recommended values. You can adjust them later based on your specific use case and workload.

### ๐Ÿ”น Central Infra Server VM
- ๐Ÿง  **Memory**: 2 GB RAM
- โš™๏ธ **CPU**: 2 vCPUs
- ๐Ÿ’พ **Storage**: 30 GB

### ๐Ÿ”ธ Provisioned VMs
- ๐Ÿง  **Memory**: 2 GB RAM
- โš™๏ธ **CPU**: 2 vCPUs
- ๐Ÿ’พ **Storage**: 20 GB

---

## ๐Ÿ“ฅ Quick Start: Get Up and Running in 5 Steps

### Step 1 โ€“ Download the Latest Release

[![stable release](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Muthukumar-Subramaniam/server-hub/main/project_version.json)](https://github.com/Muthukumar-Subramaniam/server-hub/releases/latest)

```bash
sudo mkdir -p /server-hub
sudo chown ${USER}:$(id -g) /server-hub
curl -sSL https://github.com/Muthukumar-Subramaniam/server-hub/releases/latest/download/server-hub.tar.gz | tar -xzv -C /server-hub
cd /server-hub/qemu-kvm-manage/
```

> ๐Ÿ“ฆ **Using Latest Release**: This downloads the latest stable release directly from GitHub.

**Alternative - Clone from the Repository:**

If you prefer to use the latest code from the repository:

```bash
sudo mkdir -p /server-hub
sudo chown ${USER}:$(id -g) /server-hub
git clone https://github.com/Muthukumar-Subramaniam/server-hub.git /server-hub
cd /server-hub/qemu-kvm-manage/
```

---

### Step 2 โ€“ Install QEMU/KVM

Run the automated setup script to configure your virtualization environment:

```bash
./setup-qemu-kvm.sh
```

This will install and configure all necessary packages and dependencies.

---

### Step 3 โ€“ Download AlmaLinux ISO

Grab the latest AlmaLinux ISO for your lab infrastructure:

```bash
./download-almalinux-latest.sh
```

> โ˜• **Pro tip:** This might take a few minutes depending on your network speed. Perfect time for a coffee break!

---

### Step 4 โ€“ Deploy Your Lab Infrastructure Server

Now comes the magic! This fully automated script will:
- โœจ Guide you through the setup with interactive prompts
- ๐Ÿ”„ Install and configure the centralized lab infrastructure server
- ๐ŸŽ›๏ธ Set up DNS, DHCP, PXE boot, and web services
- ๐Ÿค– Run Ansible automation for consistent configuration

```bash
./deploy-lab-infra-server.sh
```

**What to expect:**
- **First Reboot:** After OS installation and initial configuration
- **Second Reboot:** After services are configured via Ansible playbook
- **Final Step:** Once you see the login prompt, press `Ctrl + ]` to exit the console

> ๐ŸŽฌ Sit back and watch the automation work its magic!

---

### Step 5 โ€“ Access Your Infrastructure Server

Time to explore! SSH into your newly deployed infrastructure server:

```bash
ssh lab-infra-server.lab.local
```

> ๐Ÿ’ก Replace `lab-infra-server.lab.local` with your actual server name and domain if different.

---

# โœ… Your Lab is Ready! Time to Build Something Amazing! ๐ŸŽ‰

---

## ๐Ÿ› ๏ธ Your New Superpowers: VM Management Tools

Your workstation is now equipped with powerful lab management tools:

### ๐Ÿ“ฆ VM Deployment & Management
```bash
qlabvmctl build-golden-image # ๐ŸŽจ Create reusable golden base images
qlabvmctl install-golden # ๐Ÿš€ Deploy VMs instantly from golden images
qlabvmctl install-pxe # ๐ŸŒ Deploy VMs via network PXE boot
qlabvmctl reimage-golden # ๐Ÿ”„ Reinstall VMs from golden images
qlabvmctl reimage-pxe # ๐Ÿ”„ Reinstall VMs via PXE boot
```

### ๐ŸŽฎ VM Operations
```bash
qlabvmctl list # ๐Ÿ“Š View all VMs and their status
qlabvmctl info # โ„น๏ธ Display detailed VM information
qlabvmctl console # ๐Ÿ–ฅ๏ธ Connect to VM serial console
qlabvmctl start # โ–ถ๏ธ Power on VMs
qlabvmctl stop # โน๏ธ Force power-off VMs
qlabvmctl shutdown # ๐Ÿ”ฝ Graceful VM shutdown
qlabvmctl restart # ๐Ÿ”„ Hard restart VMs
qlabvmctl reboot # ๐Ÿ”ƒ Graceful VM reboot
qlabvmctl remove # ๐Ÿ—‘๏ธ Delete VMs completely
```

### ๐Ÿ”ง VM Configuration
```bash
qlabvmctl resize # ๐Ÿ“ Resize memory, CPU, or disk
qlabvmctl disk-add # ๐Ÿ’พ Add new storage disks to VM
qlabvmctl disk-resize # ๐Ÿ“ Resize additional disks
qlabvmctl disk-attach # ๐Ÿ”— Attach disks from detached storage
qlabvmctl disk-detach # ๐Ÿ“ค Detach and save disks for later use
qlabvmctl disk-delete # ๐Ÿ—‘๏ธ Permanently delete detached disks
qlabvmctl nic-add # ๐ŸŒ Add network interfaces to VM
qlabvmctl nic-remove # โŒ Remove network interfaces from VM
```

### ๐ŸŒ Network Management
```bash
qlabvmctl ipv6-route # ๐Ÿ›ฃ๏ธ Manage IPv6 default routes (enable/disable/auto/status)
```

### ๐ŸŒ Infrastructure Management
```bash
qlabstart # ๐Ÿ Start the entire lab infrastructure
qlabhealth # ๐Ÿฅ Check lab infrastructure health
qlabdnsbinder # ๐ŸŒ Manage local DNS records
```

**Pro tips:**
- Use `qlabvmctl --help` or `qlabvmctl --help` for VM management help

---

## ๐ŸŽญ The Secret Sauce: Backend Automation Tools

These powerful tools run on your infrastructure server, making everything work seamlessly:

- **๐ŸŒ dnsbinder** โ€“ Automatically manages DNS records for your local domain as you create/destroy VMs
- **โšก ksmanager** โ€“ Handles iPXE & golden-image based OS provisioning using kickstart automation
- **๐Ÿ“ฆ prepare-distro-for-ksmanager** โ€“ Downloads and prepares multiple Linux distributions (AlmaLinux, Rocky, Ubuntu, openSUSE, and more!)

---

## ๐ŸŽŠ Congratulations! Welcome to Your Virtual Datacenter!

You've just built a **professional-grade, fully automated home lab** that rivals enterprise infrastructure!

### ๐ŸŒŸ What Can You Do Now?

- ๐Ÿงช **Experiment freely** โ€“ Spin up and destroy VMs in seconds
- ๐Ÿ“š **Learn by doing** โ€“ Practice DevOps, automation, and infrastructure management
- ๐Ÿข **Simulate production** โ€“ Test multi-tier applications in realistic environments
- ๐Ÿš€ **Develop skills** โ€“ Master tools used in real enterprise datacenters
- ๐Ÿ”ฌ **Test and break things** โ€“ Build, destroy, rebuild without fear

**Your journey to infrastructure mastery starts here!** ๐Ÿง‘โ€๐Ÿ’ป๐Ÿ–ฅ๏ธ๐Ÿง 

---

## ๐Ÿ’ฌ Support & Contributing

- **Need help?** Found a bug? Have ideas? [Open an issue](https://github.com/Muthukumar-Subramaniam/server-hub/issues) on GitHub!
- **Want to contribute?** Pull requests are welcome! Feel free to improve the automation, add new distros, or enhance documentation.

---

## ๐Ÿ“œ License

This project is open source. See the [LICENSE](LICENSE) file for details.

---

**Built with โค๏ธ for the home lab community**