Skip to content

Commit 43f892f

Browse files
committed
fix(v2p): pick the real device line from pvesm path output
_pvesm_alloc_disk ran `pvesm path <vol> 2>&1` and took line 0 as the device path. With 2>&1 a storage plugin that logs a warning to stderr (e.g. a custom plugin 'implementing an older storage API') prints it BEFORE the path, so line 0 is the warning and the real path is missed — _ensure_block_device then fails and the disk transfer aborts. Now scan for the line that actually looks like a device path (/dev/...) or a librbd URI (rbd:...) instead of blindly taking line 0. Verified end-to-end on a real ESXi->Proxmox->Ceph RBD migration (Windows Server 2025, 90 GB): the migrated RBD holds a real GPT/UEFI disk (EFI System + MSR + NTFS basic-data + WinRE) — data landed on the real block device. Refs #538
1 parent fc92dd5 commit 43f892f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

pegaprox/core/v2p.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3280,7 +3280,13 @@ def _pvesm_alloc_disk(pve_mgr, node, storage, vmid, disk_index, size_bytes, errb
32803280
# volume exists, regardless of the alloc command's rc/warnings.
32813281
rc_p, out_p, _ = _pve_node_exec(pve_mgr, node,
32823282
f"pvesm path {shlex.quote(vol_id)} 2>&1", timeout=10)
3283-
dev_path = str(out_p or '').strip().split('\n')[0]
3283+
# NS 2026-07-17: `2>&1` merges stderr, so a mis-behaving storage plugin's
3284+
# warning (e.g. a custom plugin "implementing an older storage API") can be
3285+
# printed BEFORE the path and mask it. Pick the line that actually looks like
3286+
# a device path / librbd URI rather than blindly taking line 0.
3287+
_plines = [l.strip() for l in str(out_p or '').split('\n') if l.strip()]
3288+
dev_path = next((l for l in _plines if l.startswith('/') or l.startswith('rbd:')),
3289+
(_plines[0] if _plines else ''))
32843290
if dev_path.startswith('/') and rc_p == 0:
32853291
# MK 2026-06-10 (#538 oetti77 / #272): `pvesm path` only computes the path
32863292
# string; for RBD (and other block storages) the kernel device isn't mapped

0 commit comments

Comments
 (0)