public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH qemu-server/pve-manager 0/2] fix #7100: allow disabling cloud-init /etc/hosts management
@ 2026-11-24 21:26 negineri
  2026-11-24 21:26 ` [PATCH qemu-server 1/2] fix #7100: cloud-init: make /etc/hosts management configurable negineri
  2026-11-24 21:26 ` [PATCH pve-manager 2/2] fix #7100: ui: cloud-init: allow configuring /etc/hosts management negineri
  0 siblings, 2 replies; 3+ messages in thread
From: negineri @ 2026-11-24 21:26 UTC (permalink / raw)
  To: pve-devel

Proxmox VE writes manage_etc_hosts: true in its generated cloud-init user
data. This can overwrite /etc/hosts during provisioning, before a guest
administrator has a chance to configure it. Bug #7100 asks for a way to
opt out through the GUI or API before first boot, without supplying a
custom user-data file:

https://bugzilla.proxmox.com/show_bug.cgi?id=7100

The series adds the per-VM boolean cimanagehosts. It defaults to enabled
to preserve existing VM behavior. For a VM with a cloud-init disk, set it
to 0 before boot and regenerate the image:

    qm set <vmid> --cimanagehosts 0
    qm cloudinit update <vmid>

This writes manage_etc_hosts: false explicitly. Deleting the option
restores the default. Custom user data continues to take precedence.

Apply the qemu-server patch first. It registers the option, requires
VM.Config.Cloudinit to change it, and reports zero correctly in the
cloud-init image diff. The pve-manager patch then exposes the option in
the Cloud-Init panel, with the same permission for editing and removal.

On a Debian 13 test VM with qemu-server 9.2.22 and pve-manager 9.2.38,
the generated NoCloud and ConfigDrive2 images contained the expected
values. A nested Debian guest with cloud-init 25.1.4 kept a manual
/etc/hosts entry across a reboot with the option disabled. After it was
enabled and the image regenerated, cloud-init replaced the file using
its template. I also compared the image diff transitions and checked
the Edit and Remove buttons under Cloudinit, Audit and Network roles
in Chrome.

On the rebased series (qemu-server base 6a0c35f5 and pve-manager
base 75610602), both packages built with make deb and tests enabled.
The qemu-server API and cloud-init tests passed, including the five
new image diff cases, and pve-manager passed make -C www check.

I used an AI coding assistant to prepare and test these changes.

qemu-server
 src/PVE/API2/Qemu.pm                     |  9 ++---
 src/PVE/QemuServer.pm                    |  6 ++++
 src/PVE/QemuServer/Cloudinit.pm          |  3 +-
 src/test/run_api_cloudinit_dump_tests.pl | 42 ++++++++++++++++++++++++

pve-manager
 www/manager6/qemu/CloudInit.js | 22 ++++++++++++++++++++++

 5 files changed, 77 insertions(+), 5 deletions(-) in total



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-24 21:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 21:26 [PATCH qemu-server/pve-manager 0/2] fix #7100: allow disabling cloud-init /etc/hosts management negineri
2026-11-24 21:26 ` [PATCH qemu-server 1/2] fix #7100: cloud-init: make /etc/hosts management configurable negineri
2026-11-24 21:26 ` [PATCH pve-manager 2/2] fix #7100: ui: cloud-init: allow configuring /etc/hosts management negineri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal