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",