From: Stefan Hanreich <s.hanreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH container/manager/qemu-server 0/6] persist auto-generated MAC addresses of guest network devices
Date: Tue, 24 Nov 2026 15:56:44 +0100 [thread overview]
Message-ID: <20261124145651.335234-1-s.hanreich@proxmox.com> (raw)
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
next reply other threads:[~2026-11-24 14:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 14:56 Stefan Hanreich [this message]
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
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=20261124145651.335234-1-s.hanreich@proxmox.com \
--to=s.hanreich@proxmox.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.