Bug 1017284 (RHEV_Discard_on_DirectLUN)

Summary: [RFE] Add SCSI discard support for DirectLUN disks sitting on a virtio-scsi controller
Product: Red Hat Enterprise Virtualization Manager Reporter: Ademar Reis <areis>
Component: RFEsAssignee: Idan Shaby <ishaby>
Status: CLOSED CURRENTRELEASE QA Contact: Elad <ebenahar>
Severity: high Docs Contact:
Priority: medium    
Version: unspecifiedCC: acanan, amureini, areis, bmcclain, cww, fsimonce, iheim, ishaby, jentrena, juzhang, lbopf, lpeer, michen, mkenneth, mtessun, ngupta, nicolas, pbonzini, pep, platform-rfe, qzhang, rbalakri, rpacheco, srevivo, tnisan, trichard, xutian, ylavi
Target Milestone: ovirt-3.6.5Keywords: FutureFeature, TestOnly
Target Release: 3.6.0Flags: sherold: Triaged+
lsvaty: testing_plan_complete-
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
With this release, direct LUN disks with a VirtIO-SCSI interface include discard support when Enable SCSI Pass-Through is enabled.
Story Points: ---
Clone Of: 919236 Environment:
Last Closed: 2016-04-26 17:46:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 889075, 919236    
Bug Blocks: 835616, 892932, 994246, 1241106, 1331277    

Comment 5 Nicolas Ecarnot 2014-11-22 21:53:17 UTC
Can we extend this RFE to every parts of oVirt where LVM is used : [master or not] storage domains?

Comment 6 Paolo Bonzini 2014-11-24 11:21:58 UTC
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.

Comment 7 Nicolas Ecarnot 2014-11-27 09:33:53 UTC
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.

Comment 8 Paolo Bonzini 2014-12-01 16:56:23 UTC
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.

Comment 11 Idan Shaby 2016-03-13 11:26:34 UTC
After researching the discard command, these are my conclusions:

The discard command is supported by SCSI and IDE disks (see [1] - 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?


[1] http://wiki.qemu.org/ChangeLog/1.5

Comment 12 Yaniv Lavi 2016-03-13 11:39:08 UTC
Based on the above comment, I'm re-targeting to be VERIFIED in 3.6.5.
Please inform the customers with cases attached.

Comment 13 Yaniv Lavi 2016-03-13 11:40:07 UTC
We will only support this in VirtIO-SCSI disks, IDE interface will not be supported.

Comment 15 Ademar Reis 2016-03-14 14:08:03 UTC
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.

Comment 16 Elad 2016-03-21 12:00:05 UTC
Executed the following:

https://polarion.engineering.redhat.com/polarion/#/project/RHEVM3/testrun?id=4_0_Storage_Discard_support_for_DirectLUNs_run_21_03_2016


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).

Verified using:
ovirt-engine-4.0.0-0.0.master.20160310051350.git3151c66.el7.centos.noarch
vdsm-4.17.999-724.gitb8cb30a.el7.centos.noarch

XtremIO as the underlying storage.

Comment 17 Tal Nisan 2016-04-11 12:21:53 UTC
Idan, please add doc text

Comment 22 Allon Mureinik 2016-07-17 15:56:16 UTC
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.

Comment 23 Tahlia Richardson 2016-07-18 02:23:58 UTC
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.

Comment 24 Allon Mureinik 2016-07-18 02:40:32 UTC
(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
> flag.

BZ#1331277 covers everything we need. As there's really nothing new here, there's no need for a release note. Setting requires-doctext-.