Bug 1557464

Summary: vdo creation device check incomplete
Product: Red Hat Enterprise Linux 7 Reporter: Joe Shimkus <jshimkus>
Component: vdoAssignee: Joe Shimkus <jshimkus>
Status: CLOSED ERRATA QA Contact: Jakub Krysl <jkrysl>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: awalsh, jkrysl, jshimkus
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 6.1.1.109 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1600247 (view as bug list) Environment:
Last Closed: 2018-10-30 09:39:22 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:    
Bug Blocks: 1600247    

Description Joe Shimkus 2018-03-16 15:40:14 UTC
Description of problem:
During creation part of the process is to check that the specified storage device is clean (no filesystem, etc.).  The check presumes that output returned from performing 'pvcreate --test', in the case of an unclean device, begins with a single line indicating a test followed by a second line that indicates the origin of the uncleanliness.  This is incorrect.

The actual output is dependent on the version of the system.
On systems running kernel version 3.10.0-693.2.2.el7.x86_64 the output is as described above.  On systems running kernel version 3.10.0-693.11.1.el7.x86_64 the output is (for example):
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  WARNING: Device for PV 8fGOdV-d4kL-2CUQ-SgMr-Lc0p-p4jW-Hwp4LX not found or rejected by a filter.
  WARNING: Device for PV 8fGOdV-d4kL-2CUQ-SgMr-Lc0p-p4jW-Hwp4LX not found or rejected by a filter.
  WARNING: btrfs signature detected on /dev/dm-0 at offset 65600. Wipe it? [y/n]: [n]

The "not found or rejected" warnings result in the code not recognizing the specific case of uncleanliness.

The creation is still appropriately rejected but the displayed result of the create will not be indicative of the uncleanliness and will not indicate that it can be overridden through the use of --force.

How reproducible:
Dependent on system version.  100% on systems with kernel 3.10.0-693.11.1.el7.x86_64.

Comment 3 Jakub Krysl 2018-07-09 09:40:33 UTC
Tested on:
RHEL-7.6-20180626.0
kernel-3.10.0-915.el7
kmod-vdo-6.1.1.99-1.el7
vdo-6.1.1.99-2.el7

I tested by creating LVM vg + lv on iscsi disk and removing the disk without removing the vg:

# iscsiadm -m node -u
Logging out of session [sid: 1, target: iqn.2001-05.com.equallogic:0-af1ff6-6db5d9bd9-f7c9f42596f59bfb-vdo-general, portal: *****]
Logout of [sid: 1, target: iqn.2001-05.com.equallogic:0-af1ff6-6db5d9bd9-f7c9f42596f59bfb-vdo-general, portal: *****] successful.

# vgremove vg -ff
  WARNING: Device for PV VHzUeB-CClE-Zmc2-e2Ps-8HqE-wshv-juDtXu not found or rejected by a filter.
  Couldn't find device with uuid VHzUeB-CClE-Zmc2-e2Ps-8HqE-wshv-juDtXu.
  Aborting vg_write: No metadata areas to write to!

# pvs
  WARNING: Device for PV VHzUeB-CClE-Zmc2-e2Ps-8HqE-wshv-juDtXu not found or rejected by a filter.
  WARNING: Device for PV VHzUeB-CClE-Zmc2-e2Ps-8HqE-wshv-juDtXu not found or rejected by a filter.
  WARNING: Device for PV VHzUeB-CClE-Zmc2-e2Ps-8HqE-wshv-juDtXu not found or rejected by a filter.
  Couldn't find device with uuid VHzUeB-CClE-Zmc2-e2Ps-8HqE-wshv-juDtXu.
  PV         VG                Fmt  Attr PSize    PFree
  /dev/sda2  rhel_storageqe-74 lvm2 a--  <464.76g 4.00m
  [unknown]  vg                lvm2 a-m     2.00t    0

# vdo create --name vdo --device /dev/sdb
Creating VDO vdo
vdo: ERROR -   WARNING: Device for PV VHzUeB-CClE-Zmc2-e2Ps-8HqE-wshv-juDtXu not found or rejected by a filter.

# pvs
  WARNING: Device for PV VHzUeB-CClE-Zmc2-e2Ps-8HqE-wshv-juDtXu not found or rejected by a filter.
  WARNING: Device for PV VHzUeB-CClE-Zmc2-e2Ps-8HqE-wshv-juDtXu not found or rejected by a filter.
  WARNING: Device for PV VHzUeB-CClE-Zmc2-e2Ps-8HqE-wshv-juDtXu not found or rejected by a filter.
  Couldn't find device with uuid VHzUeB-CClE-Zmc2-e2Ps-8HqE-wshv-juDtXu.
  PV         VG                Fmt  Attr PSize    PFree
  /dev/sda2  rhel_storageqe-74 lvm2 a--  <464.76g 4.00m
  [unknown]  vg                lvm2 a-m     2.00t    0

# pvcreate --test /dev/sdb
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  WARNING: Device for PV VHzUeB-CClE-Zmc2-e2Ps-8HqE-wshv-juDtXu not found or rejected by a filter.
  WARNING: Device for PV VHzUeB-CClE-Zmc2-e2Ps-8HqE-wshv-juDtXu not found or rejected by a filter.
  WARNING: Device for PV VHzUeB-CClE-Zmc2-e2Ps-8HqE-wshv-juDtXu not found or rejected by a filter.
  Couldn't find device with uuid VHzUeB-CClE-Zmc2-e2Ps-8HqE-wshv-juDtXu.
  Device /dev/sdb not found.


# iscsiadm -m node -l
Logging in to [iface: default, target: iqn.2001-05.com.equallogic:0-af1ff6-6db5d9bd9-f7c9f42596f59bfb-vdo-general, portal: *****] (multiple)
Login to [iface: default, target: iqn.2001-05.com.equallogic:0-af1ff6-6db5d9bd9-f7c9f42596f59bfb-vdo-general, portal: *****] successful.
# pvcreate --test /dev/sdb
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  WARNING: Not using lvmetad because duplicate PVs were found.
  WARNING: Use multipath or vgimportclone to resolve duplicate PVs?
  WARNING: After duplicates are resolved, run "pvscan --cache" to enable lvmetad.
  Device /dev/sdb excluded by a filter.

# vdo create --name vdo --device /dev/sdb
Creating VDO vdo
vdo: ERROR -   WARNING: Not using lvmetad because duplicate PVs were found.


So without the iscsi disk the correct line is 'Device /dev/sdb not found.', with the disk it is 'Device /dev/sdb excluded by a filter.'. Yet VDO returns the 1st line every time.

It looks like this works with XFS signature on the disk:
# mkfs.xfs /dev/sdb -f
meta-data=/dev/sdb               isize=512    agcount=4, agsize=134218560 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=536874240, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=262145, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
# pvcreate --test /dev/sdb
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  WARNING: Not using lvmetad because duplicate PVs were found.
  WARNING: Use multipath or vgimportclone to resolve duplicate PVs?
  WARNING: After duplicates are resolved, run "pvscan --cache" to enable lvmetad.
WARNING: xfs signature detected on /dev/sdb at offset 0. Wipe it? [y/n]: n
  Aborted wiping of xfs.
  1 existing signature left on the device.
# vdo create --name vdo --device /dev/sdb
Creating VDO vdo
vdo: ERROR - xfs signature detected on /dev/sdb at offset 0; use --force to override


# pvcreate --test /dev/sdb
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  WARNING: Device for PV 8hkZbv-Os7s-XwQl-MS3k-DS09-nYNl-pAksdW not found or rejected by a filter.
  WARNING: Device for PV 8hkZbv-Os7s-XwQl-MS3k-DS09-nYNl-pAksdW not found or rejected by a filter.
WARNING: xfs signature detected on /dev/sdb at offset 0. Wipe it? [y/n]: n
  Aborted wiping of xfs.
  1 existing signature left on the device.
# vdo create --name vdo --device /dev/sdb
Creating VDO vdo
vdo: ERROR - xfs signature detected on /dev/sdb at offset 0; use --force to override


So the fix itself looks incomplete as it works only if there is FS metadata and fails with device missing or 'device excluded by filter'. Should I give it back?

Comment 4 Joe Shimkus 2018-07-09 14:33:01 UTC
What we have is the vdo manager assumption that the first non-expected line in the output represents the critical information; this is clearly incorrect.  Based on the output you've provided it seems that the salient info is actually in the *last* line of the output, provided vdo manager does not find any specific message for which it is looking (e.g., ... <fsType> signature detected ...).

I'd say give the bug back.

Comment 5 Jakub Krysl 2018-07-25 14:07:50 UTC
# pvcreate --test /dev/sdf
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  WARNING: Not using lvmetad because duplicate PVs were found.
  WARNING: Use multipath or vgimportclone to resolve duplicate PVs?
  WARNING: After duplicates are resolved, run "pvscan --cache" to enable lvmetad.
  Device /dev/sdf not found.


kmod-kvdo-6.1.1.99-1.el7:
# vdo create --name vdo --device /dev/sdf
Creating VDO vdo
vdo: ERROR -   WARNING: Not using lvmetad because duplicate PVs were found.

kmod-kvdo-6.1.1.111-3.el7:
# vdo create --name vdo --device /dev/sdf
Creating VDO vdo
vdo: ERROR - Device /dev/sdf not found.


# pvcreate --test /dev/sdf
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  WARNING: Not using lvmetad because duplicate PVs were found.
  WARNING: Use multipath or vgimportclone to resolve duplicate PVs?
  WARNING: After duplicates are resolved, run "pvscan --cache" to enable lvmetad.
WARNING: xfs signature detected on /dev/sdf at offset 0. Wipe it? [y/n]: N
  Aborted wiping of xfs.
  1 existing signature left on the device.
# vdo create --name vdo --device /dev/sdf
Creating VDO vdo
vdo: ERROR - xfs signature detected on /dev/sdf at offset 0; use --force to override

VDO now picks the correct message from pvcreate --test and passes it to user.

Comment 7 errata-xmlrpc 2018-10-30 09:39:22 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-2018:3094