How to deploy ubuntu using CloudInit and Proxmox (BETA)?

Hello,
I was trying to follow the instructions on the wiki https://pve.proxmox.com/wiki/Cloud-Init_Support but i had to change bits for things to work.

I am using proxmox 5.2-8 and I wanted to install centos-7 cloud image.
Good news, it works (a bit)!!
I have a zfs pool under /tank, that is where all my VMs end up.
I downloaded some cloud-init images to /tank/cloud-init-images/
My vm ID was 401.

Code:
qm importdisk 401 /tank/cloud-init-images/CentOS-7-x86_64-GenericCloud-1808.qcow2 tank
qm set 401 --scsihw virtio-scsi-pci --scsi0 tank:401/vm-401-disk-1.raw
qm set 401 --ide2 tank:cloudinit
qm set 401 --boot c --bootdisk scsi0
qm template 401

Now I am trying to figure out the contents of the cloudinit disk in proxmox, because I know you can seed it with bash scripts and puppet and chef and install packages.

God bless proxmox for adding cloud-init support, and I want more!!!
Does anyone know what or or how the data is stored on the cloudinit disk "vm-401-cloudinit.qcow2" ?

If I cat the /dev/sr0, I get some odd output and some readable text that looks like cloud-init yaml file.
 
If I cat the /dev/sr0, I get some odd output and some readable text that looks like cloud-init yaml file.
mount it instead of using cat, it is an iso inside with the cloudinit configs
 
  • Like
Reactions: egidijus
How can I extend the contents of the iso and add the full cloud-init spec options, like arbitrary user-data puppet/chef?
this is not possible with our tools, but in general you can make your own iso and put it in one of the vms cdrom drive
 
  • Like
Reactions: egidijus
I don't understand how this worked/works for you guys. I tested a lot on Proxmox 5.2-11 using all sorts of Ubuntu Cloud Images, and all of them return:

error: no such device: root

Unless I create the template manually, I`m afraid none of this works. Not even the docs: https://pve.proxmox.com/wiki/Cloud-Init_Support

Unless something changed and you guys can tell me ?
 
I don't understand how this worked/works for you guys. I tested a lot on Proxmox 5.2-11 using all sorts of Ubuntu Cloud Images, and all of them return:

error: no such device: root

Unless I create the template manually, I`m afraid none of this works. Not even the docs: https://pve.proxmox.com/wiki/Cloud-Init_Support

Unless something changed and you guys can tell me ?
can you post your vm config?
 
can you post your vm config?

Well the VM config is as the docs say, nothing changed or special. However no way to properly boot the images.

Tried all sorts of Ubuntu and even CentOS, it's always the same message.

I will add however, that if you leave it for like 5-10 minutes it will boot eventually... but that is not good. It should normally boot without errors.

Also found this: https://bugs.launchpad.net/cloud-images/+bug/1726476

Now the question is... what's the fix.
 
I can't reproduce it here with either 18.04 or 18.10 cloud images. Could you provide some more information about your environment? (pveversion -v and the output of qm config <VMID>)
 
I can't reproduce it here with either 18.04 or 18.10 cloud images. Could you provide some more information about your environment? (pveversion -v and the output of qm config <VMID>)

I honestly don't understand how this works for you, or anyone else. See the config requested below:

Code:
proxmox-ve: 5.2-2 (running kernel: 4.15.18-8-pve)
pve-manager: 5.2-11 (running version: 5.2-11/13c2da63)
pve-kernel-4.15: 5.2-11
pve-kernel-4.15.18-8-pve: 4.15.18-28
corosync: 2.4.4-pve1
criu: 2.11.1-1~bpo90
glusterfs-client: 3.8.8-1
ksm-control-daemon: 1.2-2
libjs-extjs: 6.0.1-2
libpve-access-control: 5.0-8
libpve-apiclient-perl: 2.0-5
libpve-common-perl: 5.0-41
libpve-guest-common-perl: 2.0-18
libpve-http-server-perl: 2.0-11
libpve-storage-perl: 5.0-31
libqb0: 1.0.3-1~bpo9
lvm2: 2.02.168-pve6
lxc-pve: 3.0.2+pve1-3
lxcfs: 3.0.2-2
novnc-pve: 1.0.0-2
proxmox-widget-toolkit: 1.0-20
pve-cluster: 5.0-30
pve-container: 2.0-30
pve-docs: 5.2-9
pve-edk2-firmware: 1.20181023-1
pve-firewall: 3.0-14
pve-firmware: 2.0-6
pve-ha-manager: 2.0-5
pve-i18n: 1.0-6
pve-libspice-server1: 0.14.1-1
pve-qemu-kvm: 2.12.1-1
pve-xtermjs: 1.0-5
qemu-server: 5.0-40
smartmontools: 6.5+svn4324-1
spiceterm: 3.0-5
vncterm: 1.5-3

Code:
boot: c
bootdisk: scsi0
cores: 2
cpu: cputype=kvm64
description: Ubuntu 18.04 cloud image
ide2: local:9001/vm-9001-cloudinit.qcow2,media=cdrom
kvm: 1
memory: 2048
name: ubuntu-cloud-image
net0: virtio=E6:02:8E:55:83:30,bridge=vmbr0
numa: 0
scsihw: virtio-scsi-pci
serial0: socket
smbios1: uuid=32b3f665-16f3-4bd1-a2bf-d21495ae65ca
sockets: 1
virtio0: local:9001/vm-9001-disk-0.raw,size=2252M
vmgenid: dd10341b-36a0-4e28-b711-332ca3594616
 
Looks like it's a bug in the 18.04 cloudimg. Could you try the 18.10 version to see if it is fixed for you? In my tests it only delayed the boot by at most 10 seconds.
 
Looks like it's a bug in the 18.04 cloudimg. Could you try the 18.10 version to see if it is fixed for you? In my tests it only delayed the boot by at most 10 seconds.

Yes, I tried as I said multiple versions ( 16, 18... ). However even the ones that actually boot, it's not OK and imagine this on a provision...

There is no other option but to make them manually I guess.
 
Or follow the documentation to the letter (using scsi instead of virtio and lvm-thin instead of directory storage). Following the instructions does work, although I could reproduce it with your settings. Strangely enough 18.10 seemed to work even using your settings.
 
I used scsi and made no difference, right now I cannot chane to lvm-thin my storage for this... and I don't think it would make a difference anyway. The images are bugged, the GRUB loader inside them are missing the UID...
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, 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 yours easily in our online shop.

Buy now!