Red Hat Bugzilla – Bug 1017284
[RFE] Add SCSI discard support for DirectLUN disks sitting on a virtio-scsi controller
Last modified: 2016-07-17 22:40:32 EDT
Can we extend this RFE to every parts of oVirt where LVM is used : [master or not] storage domains?
Indeed; for virtio-scsi DirectLUN it should already work, since DirectLUN uses <disk type='lun'> in the libvirt XML. It's when the disk is not DirectLUN that you need to explicit enable discard support.
Paolo, just to be clear : I wanted to speak about master storage domain and other storage domains. They are intensively using LVM.
On these storage domains, the discard option is not set, thus the SAN does not know when volumes get removed. So thin-provisionned LUNS on the SAN never get cleaned up.
This change seem to be easy to implement, and will not degradate performances, as LV deletion are not so frequent.
Ok, this is indeed a different part of oVirt that doesn't deal with libvirt or qemu-kvm. I cannot say if this requires a separate oVirt RFE.
After researching the discard command, these are my conclusions:
The discard command is supported by SCSI and IDE disks (see  - section 2.9, "Block devices"), and will actually work if:
1. The OS supports it.
2. The partition/device you try to send the discard command from is configured to pass it on.
3. The underlying storage supports it.
In terms of oVirt, working with discard is possible via two interfaces of a direct lun: VirtIO-SCSI and IDE (VirtIO is not supported).
- If you work with VirtIO-SCSI, and the disk is configured to "Enable SCSI Pass-Through", you get discard support "for free".
- If you work with VirtIO-SCSI, and the disk is not configured to "Enable SCSI Pass-Through", you can always enable it, which will also enable the support for discard (this will require to turn off the VM, first).
Theoretically, we can add discard='unmap' to VirtIO-SCSI disks that are not configured to "Enable SCSI Pass-Through", so that discard will be supported.
- Same holds for working with IDE disks. They currently don't support discard, but we can add discard='unmap' to an IDE disk to support it.
Anyway, whether your disk's interface is IDE, VirtIO or VirtIO-SCSI (that doesn't enable SCSI Pass-Through), you can always turn off the VM, switch its interface to VirtIO-SCSI, enable SCSI Pass-Through and get the support for discard commands.
Therefore, my conclusion is that we need to close this RFE and document that discard support can be achieved by using the right interface with the configuration of "Enable SCSI Pass-Through".
Yaniv, what do you think?
Based on the above comment, I'm re-targeting to be VERIFIED in 3.6.5.
Please inform the customers with cases attached.
We will only support this in VirtIO-SCSI disks, IDE interface will not be supported.
Thanks for the investigation and the update. I've added comments to the two cases which are currently open. So I guess GSS will follow up with them.
Executed the following:
LUN actual size, on the storage server, decreased after removal of data from it, while it is attached to a VM with VirtIO-SCSI, SCSI pass through enabled and discard specified for the mounted device in the supported file system (tested using ext4).
XtremIO as the underlying storage.
Idan, please add doc text
Tahlia, I think the doctext here might be a bit misleading: "**With this release**, direct LUN disks.."
Nothing has actually been done in this release (4.0) wrt discarding. Enabling SCSI passthrough on any RHEV/DC/Cluster version that supports it (3.3 and above) will also pass through discard requests from the guest down to the storage server.
The request here is to document this behavior, as it may not be obvious, but not to suggest it's something new added to the product.
Discard support in docs is captured as part of BZ#1331277.
If this bug still requires errata doc text for 4.0 release notes, I can remove "With this release". If it doesn't, I'll clear the doc text field and flag.
(In reply to Tahlia Richardson from comment #23)
> Discard support in docs is captured as part of BZ#1331277.
> If this bug still requires errata doc text for 4.0 release notes, I can
> remove "With this release". If it doesn't, I'll clear the doc text field and
BZ#1331277 covers everything we need. As there's really nothing new here, there's no need for a release note. Setting requires-doctext-.