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.

Bug 2122782

Summary: how to interface with discard options for vdo pool volumes?
Product: Red Hat Enterprise Linux 9 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: VDO QA Contact: cluster-qe <cluster-qe>
Status: CLOSED MIGRATED Docs Contact:
Severity: low    
Priority: unspecified CC: agk, awalsh, heinzm, jbrassow, prajnoha, zkabelac
Version: 9.1Keywords: MigratedToJIRA
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-23 18:26:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Corey Marthaler 2022-08-30 19:01:10 UTC
Description of problem:

lvmvdo(7) mentions the usage of discarding with with vdo pool lvs, however it doesn't mention any lvm commands or options to make it happen. I noticed the flag '--discards' doesn't work with lvconvert or lvchange when dealing with VDO volumes. Is the only way to interface with these volumes to mounted an fs on top and using fstrim? 

[root@hayes-01 ~]# lvconvert --yes --type vdo-pool -n vdo_lv -V100G --discards nopassdown vdo_sanity/vdo_pool
  Command does not accept option: --discards nopassdown.

[root@hayes-01 ~]# lvchange --discards nopassdown vdo_sanity/vdo_pool
  Command on LV vdo_sanity/vdo_pool uses options that require LV types thinpool .
  Command not permitted on LV vdo_sanity/vdo_pool.


Version-Release number of selected component (if applicable):
lvm2-2.03.14-6.el8    BUILT: Fri Jul 29 05:40:53 CDT 2022
lvm2-libs-2.03.14-6.el8    BUILT: Fri Jul 29 05:40:53 CDT 2022

Comment 1 Zdenek Kabelac 2023-01-17 22:15:40 UTC
lvmvdo man page refers usage of Discard/TRIM  in chapter '5. Usage of Discard/TRIM with a VDOLV'.

Currently there is no support for similar logic of internal pool discard usage as it is in thin-pool.
So it could be said there is something closely matching 'nopassdown' - we can't pass discard through vdo-pool to vdo pool origin volume - this is currently not handled by kernel target.

I'd likele close this BZ - we may add this --discard option in future to those lvm commands once the vdo kernel target will gain this feature.

But if it would help with clarification, we may put in some explicit paragraph describing this difference - although we do not propagate anywhere usage of this option with vdo-pools ?

Comment 2 Corey Marthaler 2023-02-22 20:42:22 UTC
The section you describe says it can be done, but doesn't say how. If it's supported, then shouldn't an fstrim work on the vdo lv?

[root@virt-008 ~]# lvs -a -o +devices
  LV               VG            Attr       LSize   Pool     Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices          
  root             rhel_virt-008 -wi-ao----  <6.20g                                                         /dev/vda2(205)   
  swap             rhel_virt-008 -wi-ao---- 820.00m                                                         /dev/vda2(0)     
  snap             vdo_sanity    swi-a-s---   6.00g          vdo_lv 0.03                                    /dev/sda(12800)  
  vdo_lv           vdo_sanity    owi-a-s--- 101.95g vdo_pool                                                vdo_pool(0)      
  vdo_pool         vdo_sanity    dwi-------  50.00g                 10.00                                   vdo_pool_vdata(0)
  [vdo_pool_vdata] vdo_sanity    Dwi-ao----  50.00g                                                         /dev/sda(0)
      
[root@virt-008 ~]# mount -o discard /dev/vdo_sanity/vdo_lv /mnt/vdo_lv

[root@virt-008 ~]# fstrim -v /mnt/vdo_lv
fstrim: /mnt/vdo_lv: the discard operation is not supported

Comment 4 RHEL Program Management 2023-09-23 18:23:37 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 5 RHEL Program Management 2023-09-23 18:26:19 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.