[Bug] ESXi / vCenter migrations fail with spaces in folder/VM names
Hey there! 👋 Thanks for taking the time to report this bug — we appreciate it!
Please keep in mind: PegaProx is developed and maintained entirely by volunteers in our free time. We do our best, but we can't work magic 🪄 — please be patient, we'll get to your issue as soon as we can.
Want to help keep PegaProx alive?
- ⭐ Star the project — it's free and helps a lot!
- 💖 Become a Sponsor — helps us dedicate more time to development
- 🤝 Contributing code or docs is always welcome too!
Describe the bug
I will probably have to make 2 seperate reports about this but as my main issue lays with migration I will summarize here. SO I connected my VMware vCenters to PegaProx and tried migrating , running into the issue that vcenter doesnt offer the same solution for migration as just connecting an ESXi host directlly...I guess this is compound as it woudl have to pull ESXi it is running on currently and in which datacenter and what storage etc :)
So I moved to adding a single ESXi hsot per vCenter to do the migrations from ....
Here is where I ran into the issue that if a VM has spaces in its name , and consequently in the folder name the transfer fails with erros that it cant "find" the requested file , at first I thought it was a quoting issue but Iit seems ok , unless at some point the quetes are missing ..... not sure so becasue of that this ticket.
Addtionally :) SSH "hammering" (looslly used :)) cause ssh to become unavailable after 1 transfer , I have litterally got 500+ Vms to migrate it is kidna an obstacle.
Furthermore in the logs I noticed the password being handed in plain text , and it had unintended charachters in it , this could cause the http transfer to fail at login already ... we do have 1 special character in the password but the are more then that %2 entries in the password , the logs reflects that with a modified value ofcourse :) and 2 seperate transfer attemtps with different VMs
Steps to Reproduce
- create any vm with a space in the name and try to transfer, possibly this is not at all the issue so :)
- try the migration
Expected behavior
as the fiel transfer always seems to fail at the start of the transfer I assume the issue is aorudn there but I expect the fiel to transfer and take it s time. either via ssh or https neiter seem to work.
Environment
- PegaProx Version: 0.9.8.2
- Installation Method: Native daemon via shell script provided
- OS: Debian 13.3
- Browser: chrome or firefox or ...
- Behind Reverse Proxy? no
- UI? Corporate
Logs
[10:50:06] VM name sanitized: 'DefGuard - POC' -> 'DefGuard-POC' (PVE requires DNS-valid names) [10:50:06] VMware hardware: firmware=bios, scsi=vim.vm.device.ParaVirtualSCSIController, nic=vim.vm.device.VirtualVmxnet3, bus=scsi [10:50:06] Proxmox config: bios=seabios, machine=pc, scsihw=pvscsi, disk=scsi, net=vmxnet3 [10:50:06] Creating VM 666029: DefGuard-POC, 12288MB RAM, 4 cores, l26, disk=scsi, net=vmxnet3 [10:50:08] VM shell created [10:50:08] Phase: pre_sync [10:50:08] === PRE-SYNC: VM continues running on VMware === [10:50:08] Mounting ESXi datastore via SSHFS... [10:50:09] TMPDIR for subprocesses: /var/tmp [10:50:10] Resolved datastore symlink: Pure-eVC-Intern-Vol2 → /vmfs/volumes/65f1a20b-eb3e6bbd-061c-f8f21ec29b20 [10:50:12] SSHFS mounted: /tmp/v2p-3f823a7b [10:50:12] VMDK files via SSHFS: 2 [10:50:12] === TRANSFER MODE: Auto (pre-sync + delta) === [10:50:12] Creating VMware snapshot for safe pre-sync copy... [10:50:13] Migration snapshot created - base VMDKs are now read-only [10:50:13] Pre-sync disk 0: POC.vmdk (100.0 GB) [10:50:14] Cannot stat VMDK on ESXi [10:50:14] Pre-sync failed (VMDK locked) - switching to QEMU SSH boot [10:50:14] Stopping VMware VM... [10:50:16] VM stopped after 2s
[10:52:38] smbios1: uuid=482eac40-b531-4b8c-9883-6c55e3b28fe9 [10:52:38] sockets: 1 [10:52:38] vga: vmware [10:52:38] vmgenid: e719d05e-3d3f-40f2-88ed-ce236a88681c [10:52:38] args: -device pvscsi,id=scsihw0 -drive file.driver=ssh,file.host=10.66.111.203,file.port=22,file.path=/vmfs/volumes/Pure... [10:52:38] Testing QEMU SSH connectivity to ESXi... [10:52:38] QEMU SSH driver test failed: qemu-img: Could not open 'json:{"file.driver":"ssh","file.host":"10.66.111.203","file.port":22,"file.path":"/vmfs/volumes/Pure-eVC-Intern-Vol2/DefGuard - POC/POC-flat.vmdk","file.user":"root","file.ho [10:52:39] libssh cannot connect - trying HTTPS-backed boot (ESXi datastore)... [10:52:39] QEMU HTTPS test failed: qemu-img: Could not open 'json:{"file.driver":"https","file.url":"https://root:pass%2Cword%[email protected]/folder/DefGuard%20-%20POC/POC-flat.vmdk?dcPath=ha-datacenter&dsName=Pure-eVC-Intern-Vol2","fi [10:52:39] libssh cannot connect - trying SSHFS-backed boot (OpenSSH)... [10:52:40] SSHFS disk 0: NOT accessible at /tmp/v2p-3f823a7b/DefGuard - POC/POC-flat.vmdk [10:52:40] SSHFS not available - trying to remount... [10:52:40] No remote boot method available (QEMU-SSH/SSHFS/NBD all failed) [10:52:40] Hint: install sshfs and qemu-utils (apt install sshfs qemu-utils) for more transfer options [10:52:40] Switching to offline mode: copy first, then start VM [10:52:41] === DISK COPY: SSH → vmnfs === [10:52:41] (Copying disks, VM will start after copy completes) [10:52:42] Transfer: bs=64MB, compress=gzip, nc=yes [10:52:46] Background copy isolation: cgroup=v2p-copy-666029, io.weight=10 [10:52:57] Disk copy failed [10:53:24] FAILED: Disk copy to local storage failed. Check logs above for details. Ensure qemu-utils, sshfs and sshpass are installed on the Proxmox node. [10:53:24] Phase: failed
[10:58:49] Phase: planning [10:58:49] Planning migration of 'Crypt 01' from 10.66.111.203 [10:58:49] VM has 1 disk(s), 250.0 GB total [10:58:49] Testing SSH to 10.66.111.203... [10:59:14] FAILED: Cannot SSH to ESXi 10.66.111.203: Paramiko auth failed (3 methods): M1(ki-transport): Authentication failed.; M2(ki-client): Bad authentication type; allowed types: ['publickey', 'keyboard-interactive']; M3(password): Bad authentication type; allowed types: ['publickey', 'keyboard-interactive'] [10:59:14] Phase: failed
[11:00:29] VM name sanitized: 'Crypt 01' -> 'Crypt-01' (PVE requires DNS-valid names) [11:00:29] VMware hardware: firmware=bios, scsi=vim.vm.device.ParaVirtualSCSIController, nic=vim.vm.device.VirtualVmxnet3, bus=scsi [11:00:29] Proxmox config: bios=seabios, machine=pc, scsihw=pvscsi, disk=scsi, net=vmxnet3 [11:00:29] Creating VM 666030: Crypt-01, 16384MB RAM, 8 cores, l26, disk=scsi, net=vmxnet3 [11:00:31] VM shell created [11:00:31] Phase: pre_sync [11:00:31] === PRE-SYNC: VM continues running on VMware === [11:00:31] Mounting ESXi datastore via SSHFS... [11:00:33] TMPDIR for subprocesses: /var/tmp [11:00:34] Resolved datastore symlink: Pure-eVC-Intern-Vol1 → /vmfs/volumes/65f1a1f6-54487d80-b4b6-f8f21ec29b20 [11:00:35] SSHFS mounted: /tmp/v2p-e6e0a7fb [11:00:36] VMDK files via SSHFS: 2 [11:00:36] === TRANSFER MODE: Auto (pre-sync + delta) === [11:00:36] Creating VMware snapshot for safe pre-sync copy... [11:00:37] Migration snapshot created - base VMDKs are now read-only [11:00:37] Pre-sync disk 0: 01.vmdk (250.0 GB) [11:00:37] Cannot stat VMDK on ESXi [11:00:37] Pre-sync failed (VMDK locked) - switching to QEMU SSH boot [11:00:37] Stopping VMware VM... [11:00:39] VM stopped after 2s
[11:02:56] QEMU SSH driver test failed: qemu-img: Could not open 'json:{"file.driver":"ssh","file.host":"10.66.111.203","file.port":22,"file.path":"/vmfs/volumes/Pure-eVC-Intern-Vol1/Crypt 01/01-flat.vmdk","file.user":"root","file.host-key- [11:02:56] libssh cannot connect - trying HTTPS-backed boot (ESXi datastore)... [11:02:57] QEMU HTTPS test failed: qemu-img: Could not open 'json:{"file.driver":"https","file.url":"https://root:again%2Cnot%[email protected]/folder/Crypt%2001/01-flat.vmdk?dcPath=ha-datacenter&dsName=Pure-eVC-Intern-Vol1","file.sslver [11:02:57] libssh cannot connect - trying SSHFS-backed boot (OpenSSH)... [11:02:57] SSHFS disk 0: NOT accessible at /tmp/v2p-e6e0a7fb/Crypt 01/01-flat.vmdk [11:02:57] SSHFS not available - trying to remount... [11:02:58] No remote boot method available (QEMU-SSH/SSHFS/NBD all failed) [11:02:58] Hint: install sshfs and qemu-utils (apt install sshfs qemu-utils) for more transfer options [11:02:58] Switching to offline mode: copy first, then start VM [11:02:59] === DISK COPY: SSH → vmnfs === [11:02:59] (Copying disks, VM will start after copy completes) [11:03:00] Transfer: bs=64MB, compress=gzip, nc=yes [11:03:04] Background copy isolation: cgroup=v2p-copy-666030, io.weight=10 [11:03:04] Copying disk 0 (250.0 GB) → Formatting '/mnt/pve/vmnfs/images/666030/vm-666030-disk-0.raw', fmt=raw size=268435456000 preallocation=off [11:03:04] nc+gzip 10.66.111.203→10.32.69.14:50211 [11:03:04] SSH+compress × 8 [11:03:04] Copy failed! [11:03:04] Disk copy failed [11:03:04] FAILED: Disk copy to local storage failed. Check logs above for details. Ensure qemu-utils, sshfs and sshpass are installed on the Proxmox node. [11:03:04] Phase: failed
Screenshots
see logs ;)
Checklist
- [ x] I have searched existing issues to make sure this is not a duplicate
- [ x] I am using the latest version of PegaProx
@abyss1 VCenter is not supported by us and works on best effort as described in the docs.
Please use ESXI direct instead. We will look into the other problems.
@MrMasterbay
I shoudl have been clear about what I did , I added the ESXi alon aswell , counter intuitiive with 200+ esxi hosts but ok :)
The log fiels were from esxi migration alone , I have done some cli testing on my own and it seems sshfs gets killed early and ESXi ssh kilsl the connection afetr 3 attempts , this is reprodusable , I am resolving to SCP currently which also eliminates the need for a local storage and allows pre conversion scp to anywhere :)
But ok goal woudl be to do it within the PegaProx UI not over CLI :) Also I switched on CLI to UID instead of name however folder names are what they are .... what I found is that sshfs at somepoint drops the quotes and becasue of that when a folder has a space in it the folder structure fails.
ls: cannot access '/tmp/vm-migration/.../Crypt': Input/output error ls: cannot access '01/': No such file or directory
@abyss1 thanks for the careful follow-up — confirmed the space-in-path bug. Two spots in `xhm.py` were interpolating `{datastore_name}/{flat_path}` into shell strings without quoting, so anything with a space (`DefGuard - POC`, `Crypt 01`, …) got word-split when scp passed the path through the remote ssh shell. Both spots now single-quote the remote path AND shlex-quote the wrapping local command, so the file actually opens on the ESXi side.
Pushed to main — will land in the next release.
The SSH "hammering" you described is a separate problem (ESXi caps concurrent sessions per source IP and rejects after a few rapid connects). I've kept it on the list — likely fix is a connection-reuse layer (ControlMaster-style) on the PegaProx side. Will tackle that as a follow-up.
— Marcus