Last active
November 3, 2022 00:36
-
-
Save chris2k20/181ef4e4308e678657459d40ea94af90 to your computer and use it in GitHub Desktop.
Proxmox-Cloudinit-Ubuntu-20.10.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Creats a Ubuntu 20.10 Cloud-Init Ready VM Template in Proxmox | |
# | |
# Ubuntu 20.04: https://gist.github.com/chris2k20/dba14515071bd5a14e48cf8b61f7d2e2 | |
# Ubuntu 20.10: https://gist.github.com/chris2k20/181ef4e4308e678657459d40ea94af90 | |
export IMAGENAME="groovy-server-cloudimg-amd64.img" | |
export IMAGEURL="https://cloud-images.ubuntu.com/groovy/current/" | |
export STORAGE="local-zfs-cache" | |
export VMNAME="ubuntu-2010-cloudinit-template" | |
export VMID=9000 | |
export VMMEM=2048 | |
export VMSETTINGS="--net0 virtio,bridge=vmbr0" | |
wget -O ${IMAGENAME} --continue ${IMAGEURL}/${IMAGENAME} && | |
qm create ${VMID} --name ${VMNAME} --memory ${VMMEM} ${VMSETTINGS} && | |
qm importdisk ${VMID} ${IMAGENAME} ${STORAGE} && | |
qm set ${VMID} --scsihw virtio-scsi-pci --scsi0 ${STORAGE}:vm-${VMID}-disk-0 && | |
qm set ${VMID} --ide2 ${STORAGE}:cloudinit && | |
qm set ${VMID} --boot c --bootdisk scsi0 && | |
qm set ${VMID} --serial0 socket --vga serial0 && | |
qm template ${VMID} && | |
echo "TEMPLATE ${VMNAME} successfully created" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment