project-pegaprox icon indicating copy to clipboard operation
project-pegaprox copied to clipboard

[Bug] V2P: VirtIO driver injection always fails on Ceph RBD targets (pool and image taken from the volume ID)

Open ThomasRie opened this issue 1 month ago • 6 comments

Describe the bug

With "Prepare VirtIO drivers" enabled and an RBD storage as target, the injection never runs. The migration still reports COMPLETED; the only hint is one log line (see Logs). The guest comes up without VirtIO drivers.

In pegaprox/core/v2p.py (line 2598 in 1.4.1, same on Testing), the rbd) branch builds pool and image from $VOL_ID. For RBD that is <storage>:<image> (here vm-rbd:vm-100-disk-0) and contains no pool, so both cut calls return the image name and rbd map -p vm-100-disk-0 vm-100-disk-0 fails. The pool is only in $VOL (rbd:<pool>/<image>:conf=…).

Already described in the fork CMO-Internet-Dienstleistungen-GmbH/project-pegaprox#46 (open since 16 Sep), which also notes that conf/id/keyring from the RBD path are not passed to rbd map. I found no issue for it here.

What I tested (locally, then reverted): reading pool and image from $VOL instead

POOLIMG=$(echo "$VOL" | sed 's|^rbd:||; s|:.*$||')

With that the injection completes (INJECTION_OK, drivers copied, registry merged).

Steps to Reproduce

  1. Use a Ceph RBD storage as migration target.
  2. Migrate a Windows VM from ESXi: offline copy, "Prepare VirtIO drivers" on, path to virtio-win ISO set.
  3. Check the migration log and the guest: injection failed, no VirtIO drivers.

Expected behavior

Pool and image taken from the RBD path (or the storage config), and a failed injection shown as a warning in the result, not only as a log line.

Environment

  • PegaProx Version: 1.4.1 (build 2026.10.24)
  • Installation Method: Debian package (pegaprox 1.4.1-1)
  • OS: Debian 13 (trixie)
  • UI? Corporate
  • Browser: Chrome (latest)
  • Behind Reverse Proxy? No
  • Source / Target: standalone ESXi 8.0U3 (VMFS6) → Proxmox VE 9, 3 nodes, Ceph RBD

Logs

[VirtIO] Target storage type: rbd (rbd:vm-rbd/vm-100-disk-0:conf=/etc/pve/ceph.conf:id=admin:keyring=/etc/pve/priv/ceph/vm-rbd.keyring)
[VirtIO] ✗ Injection failed (rc=2). Last 400 chars of output:
RBD_MAP_FAILED: rbd: error opening pool 'vm-100-disk-0': (2) No such file or directory
Phase: completed
COMPLETED: win2025-122 -> VMID 100 (offline copy)

Screenshots

n/a

Checklist

  • [x] I have searched existing issues to make sure this is not a duplicate
  • [x] I am using the latest version of PegaProx
  • [x] I've put enough in here that someone can start on it without asking me three questions first
  • [x] I understand PegaProx is maintained by volunteers in their free time. Nobody is on call, and writing URGENT doesn't get anyone out of bed 🪄

ThomasRie avatar Nov 05 '26 14:11 ThomasRie

Confirmed, and your diagnosis is right. On Testing the rbd) branch of the injection script in pegaprox/core/v2p.py still cuts pool and image out of the volume ID, which has no pool in it, so rbd map asks for a pool named after the image. It also leaves out the conf, id and keyring from the RBD path, as you noted. A failed injection ending as COMPLETED with only a log line is a separate gap worth a look.

Thanks for the log and for trying the path-based parsing, that made this quick to check.

Jan-Philipp

Ghoszbust3r avatar Nov 05 '26 16:11 Ghoszbust3r

Thanks for the exact pointer. Fixed on Testing: the rbd branch now takes pool, namespace and image from the pvesm path answer and passes the storage's conf, monitors, id and keyring to rbd map, the way PVE maps a volume itself. An image PVE already has mapped through krbd is used as it is and left mapped.

A failed injection is no longer just a log line under COMPLETED either. It shows as a warning on the migration result, with the reason.

#1247 and #1248 are noted, those are separate. Ships with the next release, closing this then. PegaProx runs on donations, opencollective.com/pegaprox if you want to chip in.

Cheers, Marcus

mkellermann97 avatar Nov 05 '26 19:11 mkellermann97

Thanks Marcus, great turnaround – also for turning the failed injection into a visible warning. I'll re-run the injection test against Ceph RBD with the next release.

ThomasRie avatar Nov 06 '26 07:11 ThomasRie

Thanks Marcus – tested d3835c1 on a real host: nested ESXi 8.0U3g, Windows Server 2025 guest in its original state (VMware Tools, PVSCSI), offline copy to Ceph RBD, "Prepare VirtIO drivers" on, PegaProx 1.4.1 with only the v2p.py part of d3835c1 applied (applies cleanly).

[VirtIO] SUBDIR=2k25/amd64
[VirtIO] COPIED viostor / vioscsi / NetKVM / Balloon / pvpanic / vioserial / viorng
[VirtIO] MSI_STAGED virtio-win-gt-x64.msi
[VirtIO] SVC_REGISTERED
[VirtIO] INJECTION_OK

After the first boot vioscsi, netkvm and BALLOON are running and the NIC comes up as "Red Hat VirtIO Ethernet Adapter". So the RBD mapping works now without any local change. (Guest agent still missing, that's #1247.)

AI disclosure: write-up with help from Claude; the run is from my own lab.

ThomasRie avatar Nov 06 '26 10:11 ThomasRie

1.5.0 is out and VirtIO driver injection works on Ceph RBD targets now. Closing this one.

Nico

MrMasterbay avatar Nov 15 '26 02:11 MrMasterbay

Retested on 1.5.0-1: confirmed fixed. Offline copy of an unprepared Windows Server 2025 VM to a Ceph RBD target with "Prepare VirtIO drivers": target storage detected as rbd, 7 drivers copied, both MSI_STAGED lines, SVC_REGISTERED, INJECTION_OK. First boot on pvscsi installed the drivers and QEMU-GA is running without manual steps (in an earlier run on 1.4.1 the guest agent MSI failed with 1055).

ThomasRie avatar Nov 16 '26 09:11 ThomasRie