Cloud-Init overwriting entire Proxmox VE node (7.1)

exounx

New Member
Dec 12, 2021
1
0
1
32
I'm trying to use cloud-init so I can setup k8s nodes much more quickly but the node I set it up on gets overwritten by cloud-init on reboot.

I followed this exactly - https://pve.proxmox.com/wiki/Cloud-Init_Support

I've done this many times before on PVE 6.x with no issues like this.

This has happened twice now. I thought I had done something wrong initially so I just deleted the node and created a new one.

However I tried again while being extra careful and it happened again.

It's overwriting the proxmox node with the cloud-init of the VM that I create on this.

I also have ceph setup. The storage drive gets placed on ceph but it mounts cloud-init from local-lvm.

I'm not quite sure what I could be doing wrong here...

Help appreciated.
 
Last edited:
you are not supposed to install cloud-init on the PVE host - you should install it inside the VM (either via a cloud-init enabled disk image that you import, or manually)
 
I ran into the same problem as the OP. After rebooting the node from the next round of updates after following the Cloud-init doc, the node booted up with the hostname of the Cloud-init VM that I had created and was no longer showing as active in the cluster. It did, however, still use the root password for the pve node, so I was able to log in.

The steps that I used to recover (without having to rebuild the node) were:
1. Deleted the cloud-init OS .img file that I had downloaded, which in my case was in the /root directory.
2. apt remove cloud-init
3. apt autoremove (to remove the additional python modules and other leftover stuff related to cloud-init)
4. hostnamectl set-hostname <original node hostname>
5. reboot

After a reboot, the node returned to active in the cluster, however, its host keys had changed, so I had to remove the entries from the other nodes' /.ssh/known_hosts files and reconnect (via ssh as root from the other nodes to the rejoined host).
 
  • Like
Reactions: tasmandevil
@AppState95 Thank you very much, you saved my homelab.
I wouldn't lost all since I had backups but they were a bit old...
Thank you again for coming posting this answer here even 7 months later I'm sure it's useful for a lot of users ! :)

If anyone else come here, the tricky part will be maygbe to have the original node hostname.
For me I though it was pve but after reboot, I had access to the proxmox GUI but I had one node pve running empty and one pve1 offline.
So I changed my hostnamectl to pve1, rebooted and all is working again :)
 

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!