public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH container/manager/qemu-server 0/6] persist auto-generated MAC addresses of guest network devices
@ 2026-11-24 14:56 Stefan Hanreich
  2026-11-24 14:56 ` [PATCH pve-container 1/6] setup: do not read datacenter.cfg inside the container's root Stefan Hanreich
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Stefan Hanreich @ 2026-11-24 14:56 UTC (permalink / raw)
  To: pve-devel

A guest network device without a MAC address is valid for qemu-server
and pve-container, which generate a random one each time they parse the
device. The API always stores one, but manual edits and restored
backups can lack it, as can containers created with pve-container
3.0-8 to 3.0-10.

Since libpve-cluster-perl 9.1.11, such a container fails to start, as
the setup code reads datacenter.cfg from pmxcfs for the random MAC
address, from within the container's root:

  Transport endpoint is not connected
  error in setup task PVE::LXC::Setup::pre_start_hook

Without a persisted MAC address, the guest, the SDN DHCP mapping and
cloud-init each use a different random address. So persist a generated
MAC address when starting a guest, and when restoring a backup without
'unique', for containers and VMs. Starting such a guest now writes a
MAC address into the config.

Resuming or live-migrating a VM is intentionally left out, as the VM
already runs with the auto-generated MAC address. It needs a cold start
for this fix to apply.

The last patch keeps the container network panel working for devices
without a MAC address.


pve-container:

Stefan Hanreich (3):
  setup: do not read datacenter.cfg inside the container's root
  start: persist a MAC address for network devices without one
  restore: add missing MAC addresses of the backup config

 src/PVE/LXC.pm              |  7 ++++-
 src/PVE/LXC/Config.pm       | 23 ++++++++++++++--
 src/PVE/LXC/Create.pm       |  3 +++
 src/PVE/LXC/Setup/Alpine.pm |  2 +-
 src/PVE/LXC/Setup/Base.pm   |  2 +-
 src/PVE/LXC/Setup/CentOS.pm |  4 +--
 src/PVE/LXC/Setup/Debian.pm |  2 +-
 src/PVE/LXC/Setup/Gentoo.pm |  2 +-
 src/PVE/LXC/Setup/SUSE.pm   |  2 +-
 src/test/config_tests.pl    | 53 +++++++++++++++++++++++++++++++++++++
 src/test/run_setup_tests.pl |  3 +--
 11 files changed, 91 insertions(+), 12 deletions(-)


qemu-server:

Stefan Hanreich (2):
  start: persist a MAC address for network devices without one
  restore: add missing MAC addresses of the backup config

 src/PVE/QemuServer.pm                     | 11 +++++++
 src/PVE/QemuServer/Network.pm             | 30 ++++++++++++++++++
 src/test/Makefile                         |  5 ++-
 src/test/run_network_tests.pl             | 38 +++++++++++++++++++++++
 src/test/run_qemu_restore_config_tests.pl | 18 +++++++++++
 5 files changed, 101 insertions(+), 1 deletion(-)
 create mode 100755 src/test/run_network_tests.pl


pve-manager:

Stefan Hanreich (1):
  ui: lxc: network: handle network devices without a MAC address

 www/manager6/lxc/Network.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Summary over all repositories:
  17 files changed, 193 insertions(+), 14 deletions(-)

-- 
Generated by murpp 0.12.0




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

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

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 14:56 [PATCH container/manager/qemu-server 0/6] persist auto-generated MAC addresses of guest network devices Stefan Hanreich
2026-11-24 14:56 ` [PATCH pve-container 1/6] setup: do not read datacenter.cfg inside the container's root Stefan Hanreich
2026-11-24 14:56 ` [PATCH pve-container 2/6] start: persist a MAC address for network devices without one Stefan Hanreich
2026-11-24 18:06   ` Dominik Csapak
2026-11-24 14:56 ` [PATCH pve-container 3/6] restore: add missing MAC addresses of the backup config Stefan Hanreich
2026-11-24 14:56 ` [PATCH qemu-server 4/6] start: persist a MAC address for network devices without one Stefan Hanreich
2026-11-24 18:06   ` Dominik Csapak
2026-11-24 14:56 ` [PATCH qemu-server 5/6] restore: add missing MAC addresses of the backup config Stefan Hanreich
2026-11-24 14:56 ` [PATCH pve-manager 6/6] ui: lxc: network: handle network devices without a MAC address Stefan Hanreich
2026-11-24 18:06 ` [PATCH container/manager/qemu-server 0/6] persist auto-generated MAC addresses of guest network devices Dominik Csapak
2026-11-24 18:38   ` Dominik Csapak
2026-11-24 19:09   ` Stefan Hanreich
2026-11-24 23:45 ` applied: " Thomas Lamprecht

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