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 2216286

Summary: lvcreate no longer recognizes --snapshot
Product: Red Hat Enterprise Linux 9 Reporter: Demi Marie Obenour <demiobenour>
Component: lvm2Assignee: David Teigland <teigland>
lvm2 sub component: Snapshots QA Contact: cluster-qe <cluster-qe>
Status: CLOSED MIGRATED Docs Contact:
Severity: high    
Priority: high CC: agk, heinzm, jbrassow, msnitzer, prajnoha, teigland, zkabelac
Version: 9.2Keywords: MigratedToJIRA, Triaged
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 9.3   
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 19:15:10 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 Demi Marie Obenour 2023-06-20 18:18:57 UTC
Description of problem:
`lvcreate` stopped accepting `--snapshot` when creating a thin snapshot, breaking scripts..

Version-Release number of selected component (if applicable):
`lvm2-2.03.18-2.fc38.x86_64`

How reproducible:
100%

Steps to Reproduce:
1. Run the command `lvcreate --setactivationskip=n --activate=y --snapshot --type=thin --name=SOMEVG/SOMENEWLV -- SOMEOLDLV` (replace SOMENEWLV, SOMEOLDLV, and SOMEVG with the correct values).


Actual results:
The command fails:

> Command does not accept option: --snapshot

Expected results:
Command succeeds

Additional info:
This contradicts the man page, which states that the above is the correct syntax for creating a thin snapshot of an existing thin LV.

Comment 1 David Teigland 2023-06-20 18:45:07 UTC
It looks like it was probably caused by this change:
https://sourceware.org/git/?p=lvm2.git;a=commit;h=d651b340e68d97ada25e558eb50aa40062bba936

Comment 2 David Teigland 2023-06-20 20:50:40 UTC
fix in main:
https://sourceware.org/git/?p=lvm2.git;a=commit;h=ea6b5b694bf0886052b048b2e04b941ec65d90f9

commit d651b340e68d97ada25e558eb50aa40062bba936 removed the optional "--type thin" from the command definition "lvcreate --snapshot LV_thin", and added --type thin as AUTOTYPE.  This was correct and should not have changed anything, if all the command defs were correct.  However, the failing command in the description was relying on it.  It reveals a problem in a different command definintion:  "lvcreate --type thin LV_thin" that was missing --snapshot in its OO list.


$ lvs aa
  LV    VG Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  thin1 aa Vwi-a-tz--   1.00g tp          0.00                                   
  tp    aa twi-aotz-- 512.00m             0.00   10.94       

Create snapshots of thin1 using different syntaxes (six different commands that do the same thing):

$ lvcreate --type thin aa/thin1
  Logical volume "lvol2" created.
$ lvcreate --thin aa/thin1
  Logical volume "lvol3" created.
$ lvcreate --snapshot aa/thin1
  Logical volume "lvol4" created.
$ lvcreate --type thin --snapshot aa/thin1
  Logical volume "lvol5" created.
$ lvcreate --type thin --thin aa/thin1
  Logical volume "lvol6" created.
$ lvcreate --type thin --thin --snapshot aa/thin1
  Logical volume "lvol7" created.

$ lvs aa
  LV    VG Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lvol2 aa Vwi---tz-k   1.00g tp   thin1                                         
  lvol3 aa Vwi---tz-k   1.00g tp   thin1                                         
  lvol4 aa Vwi---tz-k   1.00g tp   thin1                                         
  lvol5 aa Vwi---tz-k   1.00g tp   thin1                                         
  lvol6 aa Vwi---tz-k   1.00g tp   thin1                                         
  lvol7 aa Vwi---tz-k   1.00g tp   thin1                                         
  thin1 aa Vwi-a-tz--   1.00g tp          0.00                                   
  tp    aa twi-aotz-- 512.00m             0.00   10.94                           


Given the combinations above, the following syntax should also work.  It's allowed by the command definintions, but rejected by the internal lvcreate option checking.  It's uncertain why, but perhaps the lvcreate implementation won't do the right thing (it should probably be allowed.)

$ lvcreate --thin --snapshot aa/thin1
  Option --thin is unsupported with snapshots.
  Run `lvcreate --help' for more information.

Comment 5 RHEL Program Management 2023-09-23 19:12:35 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 6 RHEL Program Management 2023-09-23 19:15:10 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.