Bug Fix
Cancelled qm clone --full no longer leaves an invisible orphan zvol on TrueNAS. When a user hits Stop on a full-clone task partway through, PVE's clone error branch calls vdisk_free on the partial target. The sync phase of _free_image_iscsi / _free_image_nvme deletes the iSCSI target-extent mapping + extent (or the NVMe namespace), then returns a cleanup_worker closure that vdisk_free is supposed to fork as an imgdel UPID task for the slow pool.dataset.delete. But PVE escalates the cancel to SIGKILL fast enough that our sync phase gets cut off mid-extent-delete — the TrueNAS side processes the request and the extent disappears, but our process never captures the reply, never returns the cleanup_worker, and vdisk_free never forks the imgdel UPID. The zvol survives with no extent and no VM config pointing at it; pvesm list doesn't show it, so it's invisible orphan storage.
The fix: both free_image paths now spawn a double-fork detached worker (fork + POSIX::setsid + grandchild) at entry that sleeps 30 s and then calls _delete_dataset_with_retry on the same dataset. setsid puts the grandchild in its own session and process group, so a SIGKILL sent to the task's process tree does not reach it. On the happy path the normal imgdel UPID deletes the zvol first; on the cancel path the detached worker does. Whichever runs first succeeds, the other sees "does not exist" and exits silently.
Validation
- Unit tests:
prove -I t/nvme/lib t/nvme/*.t t/iscsi/*.t— 342/342 pass. - Live reproduction on pve 9.2.31 against TrueNAS 25.10.x (iSCSI, 32 GiB full clone from a template):
- Pre-fix (2.1.25~beta9): cancel at ~12 GiB left zvol
tank/proxmox/vm-9099-disk-0orphan;pvesm listhid it; no imgdel task fired. - Post-fix: same cancel sequence; at the 30 s mark the detached child logs "Deleting dataset ..." then "Successfully deleted dataset ...". zvol gone, no manual cleanup.
- Pre-fix (2.1.25~beta9): cancel at ~12 GiB left zvol
Install
wget https://github.com/truenas/truenas-proxmox-plugin/releases/download/v2.1.25-beta10/truenas-proxmox-plugin_2.1.25.beta10_all.deb
sha256sum -c <(curl -sL https://github.com/truenas/truenas-proxmox-plugin/releases/download/v2.1.25-beta10/SHA256SUMS)
dpkg -i truenas-proxmox-plugin_2.1.25.beta10_all.deb
systemctl restart pvedaemon pveproxy
GitHub renames the asset's ~ to . on upload; the published filename is _2.1.25.beta10_all.deb even though SHA256SUMS lists _2.1.25~beta10_all.deb. The bytes are identical — verify with sha256sum by hand.
Upgrading from 2.1.25beta6 or 2.1.25beta7: if you created a storage via the GUI on those betas, the API key was never written into /etc/pve/storage.cfg (fixed in 2.1.25~beta8). Before upgrading, paste the missing tn_api_key <value> line back into the broken entry's block in /etc/pve/storage.cfg manually; the plugin cannot recover it on its own.
Upgrading from 2.1.24: the same postinst fix that 2.1.25~beta1 shipped for #144 still applies. On 2.1.24 and older, upgrade from an SSH session rather than the Proxmox Web Shell / Updates > Upgrade button. From 2.1.25 onwards, future upgrades from the Web Shell are safe.