virt-sparsify --in-place /dev/KVMVol/C7Image .... Trimming /dev/sda1 ... Clearing Linux swap on /dev/sda2 ... virt-sparsify: libguestfs error: blkdiscard: ioctl: /dev/sda2: BLKDISCARD: Input/output error Here is fdisk -l of given volume Device Boot Start End Blocks Id System /dev/ThinVol/C7Image1 * 2048 1026047 512000 83 Linux /dev/ThinVol/C7Image2 1026048 9185279 4079616 82 Linux swap / Solaris /dev/ThinVol/C7Image3 9185280 83881983 37348352 83 Linux
Created attachment 964804 [details] verbose output
I meant to type "virt-sparsify --in-place /dev/ThinVol/C7Image"
Thanks for filing the bug. Is there anything special about how the CentOS 7 guest was installed? I think you mentioned something about LVM thinp, which I've never used in CentOS (wouldn't even know how you'd get the installer to use it).
The actual failure is interesting: guestfsd calls ioctl (BLKDISCARD) on the swap device, and we see: [ 3.253330] sd 2:0:0:0: [sda] [ 3.253936] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 3.254316] sd 2:0:0:0: [sda] [ 3.254316] Sense Key : Aborted Command [current] [ 3.254316] sd 2:0:0:0: [sda] [ 3.254316] Add. Sense: I/O process terminated [ 3.254316] sd 2:0:0:0: [sda] CDB: [ 3.254316] Write same(16): 93 08 00 00 00 00 00 0f a8 00 00 7c 80 00 00 00 [ 3.254316] end_request: I/O error, dev sda, sector 1026048 guestfsd: error: ioctl: /dev/sda2: BLKDISCARD: Input/output error There are several possible things that might be indicated by that: - actual disk corruption (unlikely, but something to check) - LVM thinp doesn't support/pass through the SCSI WRITESAME command properly - partition table mismatches or overlaps somehow - not all guest disks are being presented to libguestfs (is it a multi-disk guest?)
This Debian bug is interesting: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757927
My setup Host Fedora 20 running on SSD + LVM Additional spinning disk with Thin LVM Volumes used mostly for KVM Disks For any KVM guest a LVM Thin Volume is created and used for Guest. CentOS 7 was installed using desk setting using DVD. Partition scheme was to use btrfs (/ ext3, / btrfs and swap). Disk was added to guest as Virtio-SCSI. Looking at fdisk -l at least not showing overlap. virt-sparsify only fails on swap cleaning. I get no error when I do it manually: kpartx -av <lvm thin vol> mount partitions with discard options and run fstrim.
Looks like this issues was resolved, I am not getting this error with F25 + updates.