# Cloud Init Script This script automates the setup of a virtual machine using a cloud image in Proxmox, with options to create a template and override any existing virtual machine within a specified range of IDs. ## Usage You can execute this script directly using `curl` with the following commands: ### 1. **Default Storage (`proxmox`) and Default VM Name (`ubuntu-cloudinit2404`):** To run the script using the default storage (`proxmox`) and the default VM name (`ubuntu-cloudinit2404`), with VM IDs starting from `8000`: ```bash curl -sSL https://git.nixc.us/colin/cloud-init/raw/branch/main/install.sh | bash ``` ### 2. **Specify a Different Storage:** To specify a different storage (`local`) while using the default VM name (`ubuntu-cloudinit2404`), with VM IDs starting from `8000`: ```bash curl -sSL https://git.nixc.us/colin/cloud-init/raw/branch/main/install.sh | bash -s -- local ``` ### 3. **Specify a Starting VM ID, Cloud Image, VM Name, and Storage:** The script allows you to specify a starting VM ID, cloud image URL, image name, distribution name, version, and storage. The script will delete all VMs in the range starting from the specified ID up to the number of VMs being created (e.g., six VMs). #### Example for Debian 11: ```bash curl -sSL https://git.nixc.us/colin/cloud-init/raw/branch/main/install.sh | bash -s -- https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-amd64.img debian-11-genericcloud-amd64.img debian 11 local ``` This command will: - Download the Debian 11 cloud image. - Save it as `debian-11-genericcloud-amd64.img`. - Set the distribution name as `debian` and the version as `11`. - Use `local` as the Proxmox storage location. - Prompt for a starting VM ID. ## Manual Template Creation After configuring your VM, when you're ready, create a template using the following command: ```bash qm template ``` Where `` is the ID of the VM you created. No license or contributors are defined for this script.