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

[Bug] V2P auto/live clone: snapshot removal always waits for a fixed 120 s SSH timeout

Open ThomasRie opened this issue 1 month ago • 5 comments

Describe the bug

After the source VM is powered off, the clone snapshot is removed over SSH. The call returns "remove timed out" after exactly 120 s, also when ESXi finished the consolidation after 15–40 s (checked in the ESXi task list). PegaProx checks afterwards and continues, so the migration works, but this adds 60–105 s to the downtime of every auto / live clone migration.

With a larger snapshot the log announces a longer limit, but the call still ends after 120 s:

The clone snapshot holds 1.3 GiB of changes, allowing 600s for the merge

Once (live clone, Ubuntu) the SSH connection dropped after 11 s with "Broken pipe" instead; PegaProx checked and continued there as well.

Steps to Reproduce

  1. Migrate a running VM from ESXi with transfer mode auto or live clone.
  2. Compare the timestamps of "Removing the clone snapshot" and "Snapshot removal reported: remove timed out" with the end of the "Remove snapshot" task on ESXi.

Expected behavior

Use the announced limit for the SSH call, or poll the snapshot state on ESXi instead of waiting for the command to return, so the downtime ends when ESXi is done.

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

[14:22:35] === SWITCHOVER: stopping the source VM on ESXi (POWERED_ON), downtime starts ===
[14:22:37] Source VM is powered off
[14:22:37] The clone snapshot holds 1.3 GiB of changes, allowing 600s for the merge
[14:22:37] Removing the clone snapshot, ESXi folds what changed since then back into the source disks...
[14:24:38] Snapshot removal reported: remove timed out
[14:24:39] Snapshot consolidated, every disk is back on its own file

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

Thanks for the timestamps, they point right at it. The 120 s doesn't come from SSH: on a standalone host the remove goes through _soap_delete_snapshot in pegaprox/core/vmware.py, and that loop waits for a task state ending in .success, while pyVmomi gives the plain word success. So it never sees the task finish, runs its full 120 polls and answers "remove timed out", and a remove that really failed reads the same way.

I checked this against the code and pyVmomi 9.1.1, not on a real host. The "Broken pipe" you saw once looks like something else, so that one stays open.

Jan-Philipp

Ghoszbust3r avatar Nov 05 '26 16:11 Ghoszbust3r

Thanks Jan-Philipp, that explains the fixed 120 s nicely. I can run a live clone against my nested ESXi 8.0U3g with the two-line change from #1258 applied and report the timing back here.

ThomasRie avatar Nov 06 '26 07:11 ThomasRie

Tested the fix from #1258 on a real host: nested ESXi 8.0U3g (standalone, no vCenter), PegaProx 1.4.1 with only the two-line change in _soap_delete_snapshot applied, live clone of a Debian 13 guest (32 GB) to Ceph RBD.

07:51:45 Source VM is powered off
07:51:45 The clone snapshot holds 0.1 GiB of changes, allowing 600s for the merge
07:51:45 Removing the clone snapshot, ESXi folds what changed since then back into the source disks...
07:51:48 Snapshot consolidated, every disk is back on its own file

The remove now returns after 3 s instead of running into "remove timed out" after 120 s. Same VM, same mode before the fix (Nov 3): downtime 300.0 s; with the fix: 195.2 s. The rest of the run (checksums on ESXi, 4 delta blocks) was the same, so the ~105 s are exactly the wait that's gone. 👍

The "Broken pipe" case from my report didn't show up in this run.

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

ThomasRie avatar Nov 06 '26 07:11 ThomasRie

Fixed in 1.5.0: removing the snapshot ends as soon as ESXi is done instead of waiting out a fixed timeout. Thanks, closing.

MrMasterbay avatar Nov 15 '26 01:11 MrMasterbay

Retested on 1.5.0-1 with Auto (vmkfstools_clone): confirmed fixed. Snapshot removal started 08:39:13 and was confirmed consolidated at 08:40:02 (49 s, 0.1 GiB delta, 600 s limit), the migration continued right away instead of waiting for the old 120 s timeout.

ThomasRie avatar Nov 16 '26 09:11 ThomasRie