[ShotInTheFoot] cloud-init package on the host

mapache

New Member
Feb 5, 2022
5
2
3
40
Don't know if its a bug or an unexpected behavior but installing cloud-init package on the proxmox host can break the system.

Yesterday I was playing with cloud-init images and installed libguestfs-tools and the cloud-init package on the host.
Today I restarted the proxmox host and on boot the cloud-init picked one of the configs for the vm and applied to the host, that config changed the hostname and broke the host.

I purged cloud-init package and restored the hostname and its running again. Now i see that the cloud-init package is intended to be run on the 'guest' only, but is a non intuitive way of accidentally breaking the system.
 
While that is surely true, why would anyone want to kickstart a hypervisor with cloud-init? ;-)
 
Now i see that the cloud-init package is intended to be run on the 'guest' only, but is a non intuitive way of accidentally breaking the system.

Yeah, the question is, how did you come to the idea to install it on the host?
Is there something unintuitive or even wrong described in the official Proxmox documentation/wiki, that lead you to do this step?
If so, maybe it could be improved.
 
well for me cloud-init is running on my Debian install's on my oracle cloud servers

shame its now broken currently disabled with sudo touch /etc/cloud/cloud-init.disabled ,
just means I can not import onto the new servers anymore
 
I broke my system this way following the directions on this page. There is indeed a big warning, but the layout tricked me.

Basically, the wget and qm commands are run on the host, and temporally would come before you can run any commands on the VM (because it's not created yet). So my brain assumed that if you don't have a VM to run commands on, the cloud-init step above must be on the host too.

In any case, here's how I fixed it, rebooting after each step.
Code:
apt uninstall cloud-init
hostnamectl set-hostname <correct hostname>
Then edit /etc/hosts back into the format explained here.

I'm not 200% sure that all of the damage is undone, but at least my services are available again and I don't have to restore from backup (which exist and are tested!).
 
Last edited:

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!