This repository contains a set of scripts and helpers for deploying and customising Cloud-Init images on Proxmox. These tools are designed to facilitate learning and experimentation with cloud technologies in my own homelab environment.
The primary goal is build my platform for learning and testing cloud deployment techniques, infrastructure-as-code concepts, and system administration skills in a controlled Proxmox environment. By automating the creation and customisation of virtual machines using Cloud-Init, I can quickly spin up consistent, reproducible environments for various learning scenarios.
- Automated deployment of Cloud-Init enabled images on Proxmox
- Customisable VM configurations (size, resources, networking)
- User and SSH key management via Cloud-Init
- Package installation and system configuration automation
- Currently supports Fedora and Ubuntu, with plans to expand to other distributions
- Proxmox VE 8.0 or higher
- SSH access to your Proxmox host
wget
for downloading cloud imagesqemu-img
for image manipulation- Sufficient storage space in your Proxmox local-lvm storage
The create_fedora_cloud_template.sh
script automates the creation of a Fedora Cloud VM template in Proxmox.
- Clone this repository to your Proxmox host:
https://github.com/agstaylor/proxmox-cloud-init-scripts
- Navigate to the script directory:
cd proxmox-cloud-init-scripts
- Make the script executable:
chmod +x create_fedora_cloud_template.sh
- Run the script with appropriate parameters:
./create_fedora_cloud_template.sh <size> <image_id> <username> <ssh_key_path>
Parameters:
- `<size>`: VM size (small or medium)
- `<image_id>`: Proxmox VM ID
- `<username>`: User to be created in the VM
- `<ssh_key_path>`: Path to the SSH public key file
Example:
./create_fedora_cloud_template.sh medium 9000 ataylor ./.ssh/ataylor@labnet.zone.pub
Bake in additional files and folders to home directory:
./create_fedora_cloud_template_with_home.sh small 9001 ataylor ~/.ssh/ataylor@labnet.zone.pub ./home_simple
- Once the script completes, a new VM template will be available in your Proxmox environment.
The create_ubuntu_cloud_template.sh script automates the creation of an Ubuntu 24.04 LTS Cloud VM template in Proxmox.
- Follow steps 1-2 from the Fedora Cloud Image Deployment section above.
- Make the script executable:
chmod +x create_ubuntu_cloud_template.sh
- Run the script with appropriate parameters:
./create_ubuntu_cloud_template.sh <size> <image_id> <username> <ssh_key_path>
Parameters:
- `<size>`: VM size (small or medium)
- `<image_id>`: Proxmox VM ID
- `<username>`: User to be created in the VM
- `<ssh_key_path>`: Path to the SSH public key file
Example:
./create_ubuntu_cloud_template.sh small 9002 ataylor ./.ssh/ataylor@labnet.zone.pub
- Once the script completes, a new Ubuntu VM template will be available in your Proxmox environment.
You can customise various aspects of the VM creation process:
- Modify the
create_custom_cloudinit
function in the script to change installed packages or add custom commands. - Adjust VM sizes by editing the
create_vm
function. - Change the Fedora version by updating the
FEDORA_VERSION
variable in thecreate_fedora_vm
function.
This project offers several learning opportunities in cloud and systems administration:
- Cloud-Init: Understand how Cloud-Init works and how it can be used to initialize cloud instances.
- Infrastructure as Code: Practice defining infrastructure through code and scripts.
- Proxmox Administration: Gain experience with Proxmox VE management and API usage.
- Bash Scripting: Improve bash scripting skills through script customization and extension.
- Linux System Administration: Learn about system configuration, package management, and user setup in a Linux environment.
- Networking: Configure and manage virtual networks within Proxmox.
- Add support for additional Linux distributions (Ubuntu, CentOS, Debian)
- Implement more advanced networking configurations
- Create scripts for common application deployments (web servers, databases, etc.)
- Develop Ansible playbooks for further system configuration
Contributions, issues, and feature requests are welcome. Feel free to check the issues page if you want to contribute.
This project is licensed under the MIT License - see the LICENSE file for details.