public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: negineri <negineri@sfc.wide.ad.jp>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server/pve-manager 0/2] fix #7100: allow disabling cloud-init /etc/hosts management
Date: Wed, 25 Nov 2026 06:26:06 +0900	[thread overview]
Message-ID: <20261124212608.12996-1-negineri@sfc.wide.ad.jp> (raw)

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



             reply	other threads:[~2026-11-24 21:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 21:26 negineri [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261124212608.12996-1-negineri@sfc.wide.ad.jp \
    --to=negineri@sfc.wide.ad.jp \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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