From 65bacb25fad37fd02db5c0808a9acdee40eaa26b Mon Sep 17 00:00:00 2001 From: sjat Date: Thu, 18 Jun 2026 15:05:49 +0200 Subject: [PATCH] feat(integration-vm): force DHCP via explicit cloud-init network-config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't rely on the genericcloud image's network fallback; the seed now carries a network-config forcing dhcp4 on en* interfaces. A correct prerequisite for the VM to network once cloud-init processes the seed. (Note: a separate no-DHCP-lease issue on first real boot is still under investigation — the guest isn't networking and, under the no-sudo claude model, the VM console/logs aren't introspectable without libguestfs; see next steps.) Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/integration-vm.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/integration-vm.py b/scripts/integration-vm.py index a425c40..9afbe0e 100644 --- a/scripts/integration-vm.py +++ b/scripts/integration-vm.py @@ -190,7 +190,16 @@ def up(host, name=None, mem_mib=DEFAULT_MEM_MIB, vcpus=DEFAULT_VCPUS): (RUN_DIR / "user-data").write_text(render_user_data(_ssh_pubkey(), "ansible")) (RUN_DIR / "meta-data").write_text(render_meta_data(f"iid-{name}", name)) seed = CACHE_DIR / f"{name}-seed.img" - sh(["cloud-localds", str(seed), str(RUN_DIR / "user-data"), str(RUN_DIR / "meta-data")]) + # Force DHCP on the VM NIC — don't rely on the genericcloud image's network fallback. + (RUN_DIR / "network-config").write_text( + 'version: 2\n' + 'ethernets:\n' + ' primary:\n' + ' match:\n' + ' name: "en*"\n' + ' dhcp4: true\n') + sh(["cloud-localds", "--network-config", str(RUN_DIR / "network-config"), + str(seed), str(RUN_DIR / "user-data"), str(RUN_DIR / "meta-data")]) console = CACHE_DIR / f"{name}-console.log" sh(["virt-install", "--name", name, "--memory", str(mem_mib), "--vcpus", str(vcpus), "--import",