From 907714d7408ba9b9b66b0eada1679ca4657f0b09 Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Thu, 11 Sep 2025 15:58:42 -0600 Subject: [PATCH] Update Servers/Virtualization/Proxmox/Cloud-Init Templates/Ubuntu Server.md --- .../Cloud-Init Templates/Ubuntu Server.md | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/Servers/Virtualization/Proxmox/Cloud-Init Templates/Ubuntu Server.md b/Servers/Virtualization/Proxmox/Cloud-Init Templates/Ubuntu Server.md index da2c2e2..0f970dc 100644 --- a/Servers/Virtualization/Proxmox/Cloud-Init Templates/Ubuntu Server.md +++ b/Servers/Virtualization/Proxmox/Cloud-Init Templates/Ubuntu Server.md @@ -1,7 +1,7 @@ ## Purpose You may need to deploy many copies of a virtual machine rapidly, and don't want to go through the hassle of setting up everything ad-hoc as the needs arise for each VM workload. Creating a cloud-init template allows you to more rapidly deploy production-ready copies of a template VM (that you create below) into a ProxmoxVE environment. -### Pull Down Ubuntu Server Cloud-Init Image +### Download Image and Import into ProxmoxVE You will first need to pull down the OS image from Ubuntu's website via CLI, as there is currently no way to do this via the WebUI. Using SSH or the Shell within the WebUI of one of the ProxmoxVE servers, run the following commands to download and import the image into ProxmoxVE. ```sh # Make a place to keep cloud images @@ -27,5 +27,31 @@ qm set 9000 --scsi0 nfs-cluster-storage:9000/vm-9000-disk-0.qcow2 # Configure Disk to Boot qm set 9000 --boot c --bootdisk scsi0 +``` + +### Add Cloud-Init Drive & Configure Template Defaults +Now that the Ubuntu cloud image is attached as the VM’s primary disk, you need to attach a Cloud-Init drive. This special drive is where Proxmox writes your user data (username, SSH keys, network settings, etc.) at clone time. +```sh +# Add a Cloud-Init drive to the VM +qm set 9000 --ide2 nfs-cluster-storage:cloudinit + +# Enable QEMU Guest Agent +qm set 9000 --agent enabled=1 + +# Set a default Cloud-Init user (replace 'nicole' with your preferred username) +qm set 9000 --ciuser nicole + +# Set a default password (this will be resettable per-clone) +qm set 9000 --cipassword 'SuperSecretPassword' + +# Download your infrastructure public SSH key onto the Proxmox node +wget -O /root/infrastructure_id_rsa.pub \ + https://git.bunny-lab.io/Infrastructure/LinuxServer_SSH_PublicKey/raw/branch/main/id_rsa.pub + +# Tell Proxmox to inject this key via Cloud-Init +qm set 9000 --sshkey /root/infrastructure_id_rsa.pub + +# Configure networking to use DHCP by default (this will be overridden at cloning) +qm set 9000 --ipconfig0 ip=dhcp ``` \ No newline at end of file