# Create cloud-init template

1. Download the image on the Hypervisor (Proxmox)

```bash
wget https://cdimage.debian.org/cdimage/cloud/bullseye/20220121-894/debian-11-generic-amd64-20220121-894.raw
```

2\. Rename the image to something more normal:

```bash
mv debian-11-generic-amd64-20220121-894.raw debian11-cloudinit.raw
```

3\. Create the VM with a free number

```bash
qm create 101
```

4\. Import the raw image as disk for the vm (101 in our case) and specify the volume (vms in our case)

```bash
qm importdisk 101 debian11-cloudinit.raw vms
```

5\. Change the Bus Device to SCSI, Tick Discard, Click add&#x20;

![](https://3885248957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoE4wMO1dMVDOGDjh0En7%2Fuploads%2FMJzLnZvmgJIFTYMjnluG%2Fimage.png?alt=media\&token=c49a349a-734b-4352-90e5-41133c1a0dfe)

6\. Enable the SCSI Device as the boot device (Click enable)&#x20;

![](https://3885248957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoE4wMO1dMVDOGDjh0En7%2Fuploads%2FGLsrsh4HblnSLTdfcHdz%2Fimage.png?alt=media\&token=e2916518-e057-448a-936c-cd8d0720b013)

7\. Add a network device with the following config:&#x20;

![](https://3885248957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoE4wMO1dMVDOGDjh0En7%2Fuploads%2FrL5xcmi4p8aPemabzakF%2Fimage.png?alt=media\&token=87192c64-c340-4328-a5f4-f5aebadcdd90)

8\. Set up <mark style="color:orange;">`cloudinit`</mark> storage device:&#x20;

![](https://3885248957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoE4wMO1dMVDOGDjh0En7%2Fuploads%2FQhVRyGewinTY1UjoQ76y%2Fimage.png?alt=media\&token=0997911d-5181-4f37-8682-842f490e48be)

With the following config:&#x20;

![](https://3885248957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoE4wMO1dMVDOGDjh0En7%2Fuploads%2FFkCcL14ysbMEiI7JybzT%2Fimage.png?alt=media\&token=22cbbbf7-3dc6-4100-aae1-d1e972fc13c7)

1. Set up credentials:&#x20;

![](https://3885248957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoE4wMO1dMVDOGDjh0En7%2Fuploads%2FHxNWWiVzNVczK3ct9vmM%2Fimage.png?alt=media\&token=ea7d1dd8-9fbd-41ad-9659-e50b4cf76760)

### To configure network IP:

![](https://3885248957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoE4wMO1dMVDOGDjh0En7%2Fuploads%2FoSxGMShPtkDcfJnNm7JU%2Fimage.png?alt=media\&token=782be687-9f5f-47e4-8419-33a564dc9b46)

Example of IP and Gateway:&#x20;

![](https://3885248957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoE4wMO1dMVDOGDjh0En7%2Fuploads%2FgRscIHAsUKAsVKtIobVa%2Fimage.png?alt=media\&token=5a2073ad-06d6-40db-b739-76dc9ad7a8a0)

* This will make it so that the VM starts with the defined params

{% hint style="info" %}
**Note:** If you have added multiple network devices (say you need the device to be reachable on 2 vlans, then you will have multiple network adapters in cloudinit tab
{% endhint %}
