Backup failures after VHD to QCOW2 conversion
-
Hi everyone,
After migrating VMs between pools and converting their disks from VHD to QCOW2, some VMs repeatedly fail during backup export and snapshot cleanup. Other QCOW2 VMs and VHD-backed VMs back up successfully.
Environment
- Two XCP-ng 8.3 hosts, both updated and rebooted
- Shared LVM-over-iSCSI storage on Synology (approximately 8.6 TiB free)
- NBD enabled
- XO Server 5.213.0, commit a50776cb7, running in the Ronivay Docker image
Recurring errors
QCOW2 export times out and falls back to a full:
BodyTimeoutError: Body Timeout Error code: UND_ERR_BODY_TIMEOUT can't compute delta …, fall back to a fullOther export attempts receive a host storage-backend error:
invalid HTTP header in response body HTTP/1.1 500 Internal Error SR_BACKEND_FAILURE_1200The response includes a failed disk-close operation:
tapdisk_control_close_image: device qcow2:… still open tap-ctl close … -t 120 Connection timed out status=110Snapshot cleanup then fails:
Couldn't disconnect … from dom0 OPERATION_NOT_ALLOWED: VBD … still attached to … VDI_IN_USE(…, destroy)We confirmed that the affected attachments belong to snapshot VDIs in dom0. Repeated VBD.unplug_force operations appear, and backup retries encounter the same problem.
The problem persists after updating and rebooting both hosts and updating XO.
Has anyone experienced similar QCOW2 backup and snapshot cleanup failures after a cross-pool migration? Is there a known fix or recommended recovery procedure?
-
I don't know the QCOW2 side well enough to say for sure, but your symptoms look close to a thread from last month: https://xcp-ng.org/forum/post/108888 .
There, @dthenot explained that with QCOW2 the tapdisk process holding the disk isn't stopped the way it is for VHD, and that the fixes landed insm-3.2.12-25.1.Could you post the output of
rpm -q sm blktapfrom both hosts? "Updated" can mean a few different package sets, and that would show whether you already have those fixes or are hitting something new.
TheSR_BACKEND_FAILURE_1200and the VBDs still attached to snapshot VDIs in dom0 sound like something @Team-Storage will want to look at either way.
-
rpm -q sm blktap
Both hosts have the following versions installed:
sm-3.2.12-25.2.xcpng8.3.x86_64 blktap-3.55.5-12.3.xcpng8.3.x86_64 -
P poddingue marked this topic as a question
-
Thanks for the versions.

If I read the changelogs right,sm-3.2.12-25.2is one build after the 25.1 that @dthenot mentioned and still carries its QCOW2 patches, and the release note forblktap-3.55.5-12.3says it fixed a tapdisk crash during backups (https://xcp-ng.org/forum/post/109336).
So unless I missed one, you already have every fix I know about.
I think this might be a different bug. I can't tell from here whytap-ctl closetimes out on those snapshot disks, so that one is for @Team-Storage.
I'd guess theSMlogfrom both hosts around one failed run is the first thing they'll ask for. -
Thanks for your help! I have the SMlogs from both hosts ready, but they’re too large to upload here, even compressed
Whats the best way to share them with you or Team-Storage?

-
Thanks for your help! I have the SMlogs from both hosts ready, but they’re too large to upload here, even compressed
Whats the best way to share them with you or Team-Storage?

@seriouz Have you tried using zstd at a high or ultra compression level, to see if you can get it smaller?
You may need to use a Vates recommended or provided cloud temporary file storage service, outside of attaching to your forum post or PM!
-
Hi everyone
Here are the logs (anonymized) for one complete backup run.
Thanks for taking a look! -
Thanks for sharing those. I can't read SMlogs well enough to add anything useful myself, so this is really one for @Team-Storage.
One thing though: if I read the link right, it expires on 23 November, so it would be good if someone grabbed the files before then.
-
here is another link valid for 7 days @Team-Storage
I also created a new backup job. The initial full backup completed successfully, but the incremental backups after still fail with the same errors as before.
-
I noticed that a new SM update candidate sm-3.2.12-25.3 is available with QCOW2 activation and GC cleanup fixes. Both hosts currently run 25.2.
Could these fixes be relevant to the tap-ctl close timeouts and snapshot cleanup failures in our logs?
-
Ping @Team-Storage
-
Hi, I think I'm hitting the same issue, on the same versions (sm-3.2.12-25.2, blktap-3.55.5-12.3, XCP-ng 8.3, XOA stable fully updated). In my case it's incremental replication between two local EXT qcow2 SRs (source Xcpng-02, target Xcpng-03). It's consistent rather than intermittent, and only one VM's 425 GiB disk (~341 GiB used) is affected; 15 other VMs replicate incrementally fine. A fresh reseed doesn't help: the full succeeds, then the next incremental fails again. CBT on or off made no difference. My disks were never VHD. They were imported from VMware directly as qcow2.
I traced the timing on the target host, in case it helps narrow it down:
18:58:00 qcow2-to-stdout.py <replica disk> --diff <replica snapshot> (tapdisk 2181814)
19:04:57 tap-ctl close -p 2181814 -m 4 -t 120 failed ... Connection timed out, status=110
-> SR_BACKEND_FAILURE_1200 on VBD.unplug_force
(xo-server: BodyTimeoutError, "Couldn't disconnect ... from dom0", "can't compute delta ..., fall back to a full")
19:06:59 same tap-ctl close timeout on retry
19:08:14 qcow-tool failed, returning VDI_IO_ERROR ... BrokenPipeError: [Errno 32] Broken pipeThe smaller disk of the same VM (~93 GiB used) completes the same diff in about 3 minutes. qemu-img map on these files takes under 2 seconds, so the time seems to be inside the diff itself. From a quick read of qcow2-to-stdout.py, --diff appears to read and compare all allocated clusters, so for a large disk it can run more than 5 minutes without sending anything.
Here's what I think is happening, though I may be wrong:
- The diff runs for a long time without sending any data back to XO.
- After about 5 minutes of silence, xo-server gives up (BodyTimeoutError) and tries to unplug the disk.
- The unplug fails because the diff is still reading the disk through tapdisk, so tap-ctl close times out (SR_BACKEND_FAILURE_1200).
If that's right, the 1200 error and the stuck VBD are side effects. The real problem would be how long the diff takes on a large disk.
-
Hi everyone
Is there any update on this issue?
Have you had a chance to review the logs from both hosts @Team-Storage? -
@zorro Thanks for sharing your findings
I increased the HTTP inactivity timeout following the XO troubleshooting guide, and the test appears to be working. After roughly 30 minutes, the export started without errors or full-backup fallbacks.
This supports your hypothesis that the QCOW2 delta calculation may take longer than the default five-minute timeout allows, although I havent yet confirmed where that time is spent
-
I’ve now correlated the XO and host logs, which helps narrow down where the time is spent.
The qemu-img info and qemu-img map calls complete within seconds, but the subsequent host-side QCOW2 diff-export process remains active much longer. For example:
09:47:13 Executing …/qcow2-to-stdout.py <snapshot> --diff <reference> … 10:08:57 ConnectionResetError: [Errno 104] Connection reset by peerAt exactly 10:08:57, XO logs:
xo:fs:abstract INFO will output streamFor another VM, the corresponding interval was approximately 18 minutes, again ending when XO opened the backup output streams.
This points to the preparation of the QCOW2 diff stream as the main delay. The connection resets may be caused by XO closing the preparatory HTTP stream before continuing through NBD, rather than an actual backup failure.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login