cloud-init is configured with hardcoded manage_etc_hosts: true

Jacolex

New Member
Aug 8, 2019
3
1
1
48
Hello
I'm struggling with issue, that loud-init is configured with hardcoded manage_etc_hosts: true, which causes rewriting of /etc/hosts file every reboot (Centos 8). I don't know, why cloud init configuration was patched to do so:
https://lists.proxmox.com/pipermail/pve-devel/2018-March/030988.html
I think it should be configurable or disabled. Spent many days to find out, why /etc/hosts files on my servers re always rewriting, even when manage_etc_hosts was set to false in cloud.cfg configuration.
 
i found it's hardcoded in `/usr/share/perl5/PVE/QemuServer/Cloudinit.pm`, modify the config in this file, then everything is ok for me~
 
Sorry to resurrect an old thread, but we're running into the same problem.

Would be nice if this could be turned off in the UI or in a config file, as opposed to by editing a random script which could get overwritten during an update.
 
The post is quite old, but as I had the same problem today, I post the workaround I found.
You can delete the line:

`update_etc_hosts` in file `/etc/cloud/cloud.cfg` as it interely disable the module without worried about hardcoded userdata