Bug 863703

Summary: Inconsistencies with flags of thin snapshots and origins
Product: Red Hat Enterprise Linux 6 Reporter: benscott
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
Status: CLOSED NOTABUG QA Contact: Cluster QE <mspqa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.5CC: agk, dwysocha, heinzm, jbrassow, msnitzer, prajnoha, prockai, thornber, zkabelac
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-25 18:16:26 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 benscott 2012-10-06 18:33:07 UTC
I have noticed inconsistencies in the flags with regard to
thin volumes. The first column of the flags is 'o' when a 
normal snapshot is taken of a thin volume but is 'V' when 
a thin snap is used. I haven't checked to see if 'O' is 
used for merging with thin snapshots.

The other issue I have run into is that a thin snapshot doesn't
put an 's' into column 1 or column 7. This makes parsing more
difficult since a thin volume and thin snap look the same in the
flags. It seems that one of the columns could be changed to
an 's' without losing any information. The first column also is
used for merging 'S' so that would probably be the best one.

~# lvs
  LV        VG      Attr      LSize   Pool     Origin    Data%  
  Pool_One  MyGroup twi-a-tz-   1.00g                      9.96
  fat_snap1 MyGroup swi-a-s-- 112.00m          thin_vol2   0.00
  thin_vol2 MyGroup owi-a-tz-   2.00g Pool_One             4.98


~# lvs
  LV         VG      Attr      LSize Pool     Origin    Data%   
  Pool_One   MyGroup twi-a-tz- 1.00g                      9.96
  thin_snap1 MyGroup Vwi-a-tz- 2.00g Pool_One thin_vol2   4.98
  thin_vol2  MyGroup Vwi-a-tz- 2.00g Pool_One             4.98



  LVM version:     2.02.98(2)-git (2012-08-24)
  Library version: 1.02.77-git (2012-08-24)
  Driver version:  4.22.0

Comment 2 Zdenek Kabelac 2012-10-08 12:19:00 UTC
It's worth to note here user should not be mistaking  old-style COW snapshots with new 'thin' snapshots - they are not the same in terms of reported data and behave differently in many areas.

Thus letter 's' should probably remain dedicated for old-style snaps. You cannot merge thin-snaps and you cannot get the 'real' size it takes.

The fact that thin volume is snapshot of some other volume is rather 'syntax sugar' here - since such volume is fully autonomous thin volume - you can  have it online/offline as you need (unlike with old snaps).

Comment 6 Zdenek Kabelac 2014-11-25 18:16:26 UTC
We are likely not going to change the behavior here.

Column 7 is target type - and target type really is (t)thin.
(s)napshot target segtype is dedicated to old-style snaps.
(lvcreate --type snapshot |  lvcreate --type thin)

Old-snaps and thin-snaps cannot be treated equally and also the lvm2 requires different treatment for those types.

If you need to check if 'thin' volume is still a snapshot - check presence of "Orig" field.

Comment 7 Peter Rajnoha 2014-11-26 07:34:29 UTC
Also, we've added separate fields for each lv_attr field recently in lvm2 v2.02.108 as well as additional fields that help with identification of the LV type in v2.02.110 (lv_layout and lv_role fields). These are much more readable than the lv_attr bits that provide condensed view only.