feat(vm_provision_mixin): set agent=1 on VM create for guest-agent channel
Proxmox only opens the virtio-serial channel qemu-guest-agent needs when agent=1 is set at VM creation — without it, the agent package can be installed but never actually reachable.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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"]
|
||||||
|
|||||||
Reference in New Issue
Block a user