[SOLVED] Errors following doc: Preparing Cloud-Init Templates

Michel V

Member
Jul 5, 2018
31
1
8
120
Hey,

I'm following the docs on creating a cloud-init template via cli, and ran into some errors. Maybe it's me, maybe others can check as well.

USER@HOST: user with root privs on current pve


Code:
 /var/lib/vz/template/iso # wget https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img
(OK)

Code:
/var/lib/vz/template/iso # qm create 9000 --memory 2048 --net0 virtio,bridge=vmbr0
(OK)
Code:
 /var/lib/vz/template/iso # qm importdisk 9000 bionic-server-cloudimg-amd64.img local-lvm
storage 'local-lvm' does not exists
Change local-lvm to local
Code:
/var/lib/vz/template/iso # qm importdisk 9000 bionic-server-cloudimg-amd64.img local-lvm
Configuration file 'nodes/controller/qemu-server/9000.conf' does not exist
Remove this VM with gui, rerun command that removes the error.

Code:
 /var/lib/vz/template/iso # qm set 9000 --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-9000-disk-1
storage 'local-lvm' does not exists
 /var/lib/vz/template/iso # qm importdisk 9000 bionic-server-cloudimg-amd64.img local
Formatting '/var/lib/vz/images/9000/vm-9000-disk-1.raw', fmt=raw size=2361393152
    (100.00/100%)
So here the local-lvm works does not work for me, local does

Code:
 /var/lib/vz/template/iso # qm set 9000 --scsihw virtio-scsi-pci --scsi0 local:vm-9000-disk-1
unable to parse directory volume name 'vm-9000-disk-1'
/var/lib/vz/template/iso # qm set 9000 --scsihw virtio-scsi-pci --scsi0 local:9000/vm-9000-disk-1
unable to parse volume filename 'vm-9000-disk-1'
First change does not work.

What works is to only use the id:
Code:
/var/lib/vz/images/9000 # qm set 9000 --scsihw virtio-scsi-pci --scsi0 local:9000
update VM 9000: -scsi0 local:9000 -scsihw virtio-scsi-pci
Formatting '/var/lib/vz/images/9000/vm-9000-disk-2.raw', fmt=raw size=9663676416000
Note that then also

Code:
qm set 9000 --ide2 local-lvm:cloudinit
fails, you need local in there as well.

Again: it might be me, but maybe it helps others.
 
Last edited:

Michel V

Member
Jul 5, 2018
31
1
8
120
Hey, nothing special (I presume):

dir: backup
path /var/lib/vz/
content backup
maxfiles 10
shared 0

dir: local
path /var/lib/vz
content vztmpl,images,rootdir,iso
maxfiles 0
 

Michel V

Member
Jul 5, 2018
31
1
8
120
Yes, hence my notes here to change the settings. And maybe more people encounter this, and are reading the docs for it. So hopefully it is useful for someone...
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!