Bug 1684249

Summary: vdo internal 'pvcreate --test' needs to set scan_lv to 1 due to lvm behavior change bug 1676598 when run on LV
Product: Red Hat Enterprise Linux 8 Reporter: Corey Marthaler <cmarthal>
Component: vdoAssignee: bjohnsto
Status: CLOSED ERRATA QA Contact: vdo-qe
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.0CC: awalsh, bgurney, bjohnsto, coughlan, mcsontos, mmcgrath, mvollmer, pmyers, toneata
Target Milestone: rcKeywords: Regression, ZStream
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 6.2.1.11 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1687797 1690970 (view as bug list) Environment:
Last Closed: 2019-11-05 22:12:27 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:
Bug Depends On: 1682564    
Bug Blocks: 1652753, 1687797, 1690970    

Description Corey Marthaler 2019-02-28 19:58:57 UTC
Description of problem:
If vdo internally runs a 'pvcreate --test', then it now needs to run 'pvcreate --config devices/scan_lvs=1 --test'


# with the new scan_lvs = 0 filter from behavior change bug 1676598

## lvm.conf

        # Configuration option devices/scan_lvs.
        # Scan LVM LVs for layered PVs.
        scan_lvs = 0

# This LV clearly exists
[root@hayes-02 ~]# lvs -a -o +devices
  LV              VG            Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices      
  POOL            snapper_thinp twi-aotz-- 20.00g             0.00   11.82                            POOL_tdata(0)
  [POOL_tdata]    snapper_thinp Twi-ao---- 20.00g                                                     /dev/sdo1(1) 
  [POOL_tmeta]    snapper_thinp ewi-ao----  4.00m                                                     /dev/sdp1(0) 
  [lvol0_pmspare] snapper_thinp ewi-------  4.00m                                                     /dev/sdo1(0) 
  origin          snapper_thinp Vwi-a-tz-- 10.00g POOL        0.00                                                 
  other1          snapper_thinp Vwi-a-tz-- 10.00g POOL        0.00                                                 
  other2          snapper_thinp Vwi-a-tz-- 10.00g POOL        0.00                                                 
  other3          snapper_thinp Vwi-a-tz-- 10.00g POOL        0.00                                                 
  other4          snapper_thinp Vwi-a-tz-- 10.00g POOL        0.00                                                 
  other5          snapper_thinp Vwi-a-tz-- 10.00g POOL        0.00                                                 

[root@hayes-02 ~]# lvs /dev/snapper_thinp/origin
  LV     VG            Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  origin snapper_thinp Vwi-a-tz-- 10.00g POOL        0.00                                   

[root@hayes-02 ~]# vdo create --name origin --vdoLogicalSize 4G --device /dev/snapper_thinp/origin
Creating VDO origin
vdo: ERROR - Device /dev/snapper_thinp/origin excluded by a filter.

[root@hayes-02 ~]# dmsetup ls
snapper_thinp-origin    (253:4)
snapper_thinp-POOL      (253:3)
snapper_thinp-other5    (253:9)
snapper_thinp-other4    (253:8)
snapper_thinp-other3    (253:7)
snapper_thinp-POOL-tpool        (253:2)
snapper_thinp-POOL_tdata        (253:1)
snapper_thinp-other2    (253:6)
snapper_thinp-POOL_tmeta        (253:0)
snapper_thinp-other1    (253:5)

[root@hayes-02 ~]# ls /dev/snapper_thinp/origin 
/dev/snapper_thinp/origin

[root@hayes-02 ~]# vdo --config devices/scan_lvs=1 create --name origin --vdoLogicalSize 4G --device /dev/snapper_thinp/origin
usage: vdo [-h] command ...
vdo: error: argument command: invalid choice: 'devices/scan_lvs=1' (choose from 'activate', 'changeWritePolicy', 'create', 'deactivate', 'disableCompression', 'disableDeduplication', 'enableCompression', 'enableDeduplication', 'growLogical', 'growPhysical', 'list', 'modify', 'printConfigFile', 'remove', 'start', 'status', 'stop')


# setting the new scan_lvs = 1 allows pvcreate --test to see LVs again
## lvm.conf
        # Configuration option devices/scan_lvs.
        # Scan LVM LVs for layered PVs.
        scan_lvs = 1


[root@hayes-02 ~]# vdo create --name origin --vdoLogicalSize 4G --device /dev/snapper_thinp/origin
Creating VDO origin
Starting VDO origin
Starting compression on VDO origin
VDO instance 2 volume is ready at /dev/mapper/origin


Version-Release number of selected component (if applicable):
kernel-4.18.0-71.el8    BUILT: Fri Feb 22 17:00:18 CST 2019
lvm2-2.03.02-6.el8    BUILT: Fri Feb 22 04:47:54 CST 2019
lvm2-libs-2.03.02-6.el8    BUILT: Fri Feb 22 04:47:54 CST 2019
lvm2-dbusd-2.03.02-6.el8    BUILT: Fri Feb 22 04:50:28 CST 2019
lvm2-lockd-2.03.02-6.el8    BUILT: Fri Feb 22 04:47:54 CST 2019
boom-boot-0.9-7.el8    BUILT: Mon Jan 14 14:00:54 CST 2019
cmirror-2.03.02-6.el8    BUILT: Fri Feb 22 04:47:54 CST 2019
device-mapper-1.02.155-6.el8    BUILT: Fri Feb 22 04:47:54 CST 2019
device-mapper-libs-1.02.155-6.el8    BUILT: Fri Feb 22 04:47:54 CST 2019
device-mapper-event-1.02.155-6.el8    BUILT: Fri Feb 22 04:47:54 CST 2019
device-mapper-event-libs-1.02.155-6.el8    BUILT: Fri Feb 22 04:47:54 CST 2019
device-mapper-persistent-data-0.7.6-1.el8    BUILT: Sun Aug 12 04:21:55 CDT 2018
sanlock-3.6.0-5.el8    BUILT: Thu Dec  6 13:31:26 CST 2018
sanlock-lib-3.6.0-5.el8    BUILT: Thu Dec  6 13:31:26 CST 2018
vdo-6.2.0.293-10.el8    BUILT: Fri Dec 14 18:18:47 CST 2018
kmod-kvdo-6.2.0.293-49.el8    BUILT: Fri Feb 15 11:02:59 CST 2019


How reproducible:
Everytime

Comment 7 Marian Csontos 2019-03-01 14:39:59 UTC
I thought it is

    <device> -> <PV_VG_LV> -> <VDO> -> whatever.

Is it in fact:

    <device> -> <PV_VG_LV> -> <PV_VG_LV> -> <VDO> -> whatever

?

Why is "vdo create" creating another layer when used on LV?

Or is `pvcreate --test` the only thing vdo does, and is used to check block device properties/availability?

Comment 8 Andy Walsh 2019-03-01 14:45:16 UTC
(In reply to Marian Csontos from comment #7)
> I thought it is
> 
>     <device> -> <PV_VG_LV> -> <VDO> -> whatever.
> 
> Is it in fact:
> 
>     <device> -> <PV_VG_LV> -> <PV_VG_LV> -> <VDO> -> whatever
> 

We are using the former.  "<device> -> <PV_VG_LV> -> <VDO> -> whatever"

> Why is "vdo create" creating another layer when used on LV?
> 
> Or is `pvcreate --test` the only thing vdo does, and is used to check block
> device properties/availability?

Yes, it is only used to check the block device for validation that it is not in use by something (like a filesystem, for example).

Comment 10 Martin Pitt 2019-03-11 12:42:42 UTC
*** Bug 1687391 has been marked as a duplicate of this bug. ***

Comment 18 Jakub Krysl 2019-05-29 10:47:20 UTC
# vdo create --name vdo --device /dev/loop0 --verbose
[snip]
    pvcreate --config devices/scan_lvs=1 -qq --test /dev/loop0
[snip]
VDO instance 0 volume is ready at /dev/mapper/vdo

# rpm -qa vdo
vdo-6.2.1.48-10.el8.x86_64

Comment 21 errata-xmlrpc 2019-11-05 22:12:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:3548