Merge feature/guest-agent-channel: agent=1 for guest-agent virtio-serial channel

This commit is contained in:
Christian Manivong
2026-07-08 12:56:12 +02:00
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -273,6 +273,10 @@ class ProxmoxVMProvisionMixin:
cores=cpu, cores=cpu,
ostype="l26", ostype="l26",
scsihw="virtio-scsi-pci", scsihw="virtio-scsi-pci",
# Without this, Proxmox never attaches the virtio-serial
# channel the QEMU guest agent needs — get_vm_status's
# agent queries (below) would have nothing to talk to.
agent="1",
) )
# Step 3: Download cloud image (cached) and import as root disk # Step 3: Download cloud image (cached) and import as root disk
+5
View File
@@ -123,6 +123,11 @@ def test_create_vm_from_cloud_init_single_nic():
assert mock_node.qemu.post.called assert mock_node.qemu.post.called
mixin._download_cloud_image.assert_called_once() mixin._download_cloud_image.assert_called_once()
# Regression: without agent="1" Proxmox never attaches the virtio-serial
# channel the QEMU guest agent needs, so get_vm_status(wait_for_ip=True)
# can never succeed no matter what's installed inside the guest.
assert mock_node.qemu.post.call_args[1]["agent"] == "1"
# Verify NIC config was set correctly: net0 with tag=10, DHCP enabled # Verify NIC config was set correctly: net0 with tag=10, DHCP enabled
net_call_args = next(c for c in mock_vm.config.post.call_args_list if "net0" in c[1]) net_call_args = next(c for c in mock_vm.config.post.call_args_list if "net0" in c[1])
assert "tag=10" in net_call_args[1]["net0"] assert "tag=10" in net_call_args[1]["net0"]