Bug 1226977 - [RFE] Discard Unused blocks
Summary: [RFE] Discard Unused blocks
Keywords:
Status: CLOSED DUPLICATE of bug 981626
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: RFEs
Version: 3.5.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Scott Herold
QA Contact: Gil Klein
URL:
Whiteboard: storage
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-01 15:11 UTC by Anand Nande
Modified: 2019-12-16 04:45 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-14 09:29:08 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Anand Nande 2015-06-01 15:11:09 UTC
Description of problem:

When data is deleted from inside virtual machine the underlying block devices in the RHEV Storage Domain do not know this and blocks are not actually freed. An Example (similar to) mechanism is currently found in: http://ceph.com/docs/master/rbd/qemu-rbd/, section "Enabling Discard/TRIM"

Qemu does support trim - but RHEV 3.5 doesn't seem to enable it:

host# virsh -r dumpxml VM_NAME | grep -B3 -A5 sda
    <disk type='block' device='disk' snapshot='no'>
      <driver name='qemu' type='qcow2' cache='none' error_policy='stop' io='native'/>
      <source dev='/rhev/data-center/00000002-0002-0002-0002-000000000237/1312236c-5b8d-4d60-8c84-7e92c19ec064/images/19b6d07c-becd-4cbe-8bf6-5b1bcd37de7a/3b8ddefb-68b1-4b1c-9fc6-47f2f040b07f'/>
      <target dev='sda' bus='scsi'/>
      <serial>19b6d07c-becd-4cbe-8bf6-5b1bcd37de7a</serial>
      <boot order='1'/>
      <alias name='scsi0-0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

In order to enable it, <driver> element should contain "discard='unmap'"
parameter. qemu in RHEL7 can free TRIMmed space taken by qcow2-file-backed
disks and even earlier version of qemu should be able to mark TRIMmed
space in qcow2 for further allocation.

Version-Release number of selected component (if applicable):
rhev-3.5


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