Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
TRIM/Discard doesn't work in Windows VMs. There are two ways to verify: the qcow2 disk image doesn't get shrunk after large file deletion and trimcheck [1] reports TRIM not to work. OTOH disk of rhel7 VM with the same settings backed by file in the same directory gets shrunk just fine on fstrim invocation.
Command: "fsutil behavior query DisableDeleteNotify" reports 0 - so trim is not disabled in the guest.
[1] https://github.com/CyberShadow/trimcheck
Version-Release number of selected component (if applicable):
60.70.104.8000 from 2014/04/23 (virtio-win-1.7.3-1)
How reproducible:
always
Steps to Reproduce:
A. just use trimcheck
B.
1. check size of Windows VM image
2. write a large file, check size again
3. delete the file, check size
4. restart guest OS, cold-reboot the whole VM
Actual results:
A. trimcheck reports trim/discard as not working
B.
size in steps 3. and 4. is the same as in 2
Expected results:
size in step 3. should be smaller than in 2 but it may take some time. The unused block should be trimmed on reboot however - so the size after step 4. should definitely match space used by the VM.
Additional info:
example disk configuration in libvirt xml:
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none' discard='unmap'/>
<source file='/path/to/disk.qcow2'/>
<target dev='sda' bus='scsi'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
in short - disk must be connected to virtio-scsi and <driver> element must contain discard="unmap" attribute.
In RHEL 7, qcow2 files get shrunk on successfull trim/discard, there should be punched holes to preallocated files as well. I'm not sure about block device behaviour but use of RHEL guest backed by thin LV should show if trim/discard works for block.
David,
Please provide the version numbers of the software that is installed on the host:
* libvirt*
* qemu-kvm*
* kernel
This is almost certainly a qemu-kvm-rhev issue, so I am reassigning.