Bug 1017284 - (RHEV_Discard_on_DirectLUN) [RFE] Add SCSI discard support for DirectLUN disks sitting on a virtio-scsi controller
[RFE] Add SCSI discard support for DirectLUN disks sitting on a virtio-scsi c...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: RFEs (Show other bugs)
unspecified
Unspecified Unspecified
medium Severity high
: ovirt-3.6.5
: 3.6.0
Assigned To: Idan Shaby
Elad
: FutureFeature, TestOnly
Depends On: 889075 919236
Blocks: 835616 994246 892932 RHEV_pass_discard_from_guest 1331277
  Show dependency treegraph
 
Reported: 2013-10-09 10:53 EDT by Ademar Reis
Modified: 2016-07-17 22:40 EDT (History)
28 users (show)

See Also:
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 13:46:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Storage
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
sherold: Triaged+


Attachments (Terms of Use)

  None (edit)
Comment 5 Nicolas Ecarnot 2014-11-22 16:53:17 EST
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 06:21:58 EST
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 04:33:53 EST
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 11:56:23 EST
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 07:26:34 EDT
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 (Dary) 2016-03-13 07:39:08 EDT
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 (Dary) 2016-03-13 07:40:07 EDT
We will only support this in VirtIO-SCSI disks, IDE interface will not be supported.
Comment 15 Ademar Reis 2016-03-14 10:08:03 EDT
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 08:00:05 EDT
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 08:21:53 EDT
Idan, please add doc text
Comment 22 Allon Mureinik 2016-07-17 11:56:16 EDT
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-17 22:23:58 EDT
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-17 22:40:32 EDT
(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-.

Note You need to log in before you can comment on or make changes to this bug.