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 1658224 - Unable to create VDO volume on partitioned device
Summary: Unable to create VDO volume on partitioned device
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: vdo
Version: 8.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Andy Walsh
QA Contact: Jakub Krysl
URL:
Whiteboard:
Depends On: 1653413
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-11 14:31 UTC by Andy Walsh
Modified: 2021-09-06 15:33 UTC (History)
3 users (show)

Fixed In Version: 6.2.0.293-10
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-14 01:01:35 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-19874 0 None None None 2021-09-06 15:33:19 UTC

Description Andy Walsh 2018-12-11 14:31:07 UTC
Description of problem:
Because of a change in behavior in the blkid utility, a partitioned device now causes blkid to exit with a status of 0, when the VDO Manager utility requires an exit status of 2 to continue without a --force option specified during the 'vdo create' operation.

Version-Release number of selected component (if applicable):
vdo-6.2.0.273-9.el8
util-linux-2.32.1-6.el8

How reproducible:
100%

Steps to Reproduce:
1. Partition a block device
2. Run 'vdo create' against it

Actual results:
vdo: ERROR - device is a physical volume; use --force to override

Expected results:
VDO instance 0 volume is ready at /dev/mapper/vdo0

Additional info:
The blkid utility was recently modified to allow an additional flag to be specified to restore the original behavior (--no-part-details).  The fix for this bug will require an updated dependency to require at least the new version of blkid (util-linux-2.32.1-7.el8).

I will paste the output in follow-up comments.

Comment 1 Andy Walsh 2018-12-11 14:33:51 UTC
Here is the output of a failure condition.

# No partition, blkid exits with 2 status.
[vagrant@rhel-8-nightly ~]$ lsblk
NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda    253:0    0  10G  0 disk
├─vda1 253:1    0   1G  0 part /boot
├─vda2 253:2    0   1G  0 part [SWAP]
└─vda3 253:3    0   8G  0 part /
vdb    253:16   0  20G  0 disk
[vagrant@rhel-8-nightly ~]$ sudo blkid -p /dev/vdb
[vagrant@rhel-8-nightly ~]$ echo $?
2

# Create a partition on the device, now blkid exits with a 0 status.
[vagrant@rhel-8-nightly ~]$ sudo parted
GNU Parted 3.2
Using /dev/vdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel msdos
(parted) mkpart pri "" 1M -1M
(parted)
Information: You may need to update /etc/fstab.

[vagrant@rhel-8-nightly ~]$ lsblk
NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda    253:0    0  10G  0 disk
├─vda1 253:1    0   1G  0 part /boot
├─vda2 253:2    0   1G  0 part [SWAP]
└─vda3 253:3    0   8G  0 part /
vdb    253:16   0  20G  0 disk
└─vdb1 253:17   0  20G  0 part
[vagrant@rhel-8-nightly ~]$ sudo blkid -p /dev/vdb
/dev/vdb: PTUUID="83516ab6" PTTYPE="dos"
[vagrant@rhel-8-nightly ~]$ echo $?
0
[vagrant@rhel-8-nightly ~]$ sudo blkid -p /dev/vdb1
/dev/vdb1: PART_ENTRY_SCHEME="dos" PART_ENTRY_UUID="83516ab6-01" PART_ENTRY_TYPE="0x83" PART_ENTRY_NUMBER="1" PART_ENTRY_OFFSET="2048" PART_ENTRY_SIZE="41938944" PART_ENTRY_DISK="253:16"
[vagrant@rhel-8-nightly ~]$ echo $?
0

# Now VDO fails to create.
[vagrant@rhel-8-nightly ~]$ sudo vdo create --name vdo0 --device /dev/vdb1 --verbose
    mkdir -p /run/lock/vdo
    touch /run/lock/vdo/_etc_vdoconf.yml.lock
    chmod 644 /run/lock/vdo/_etc_vdoconf.yml.lock
    touch /run/lock/vdo-config-singletons
Creating VDO vdo0
    grep MemAvailable /proc/meminfo
    pvcreate -qq --test /dev/vdb1
    blkid -p /dev/vdb1
vdo: ERROR - device is a physical volume; use --force to override

Comment 2 Andy Walsh 2018-12-11 14:34:27 UTC
The affected code in VDO Manager:

/usr/lib/python3.6/site-packages/vdo/vdomgmnt/VDOService.py
   1371     # If this is a physical volume that's not in use by any logical
   1372     # volumes the above check won't trigger an error. So do a second
   1373     # check that catches that.
   1374     try:
   1375       runCommand(['blkid', '-p', self.device])
   1376     except CommandError as e:
   1377       if e.getExitCode() == 2:
   1378         return
   1379     raise VDOServiceError('device is a physical volume;'
   1380                           + ' use --force to override',
   1381                           exitStatus = StateExitStatus)

Comment 3 Andy Walsh 2018-12-11 14:43:31 UTC
By installing the updated util-linux package (2.32.1-7.el8) and updating the VDOService.py to include the '--no-part-details', I am now able to create a VDO volume on top of a partition once again.

[vagrant@rhel-8-nightly util-linux]$ rpm -qa util-linux
util-linux-2.32.1-7.el8.x86_64

# Updated the blkid call to use --no-part-details:
   1371     # If this is a physical volume that's not in use by any logical
   1372     # volumes the above check won't trigger an error. So do a second
   1373     # check that catches that.
   1374     try:
   1375       runCommand(['blkid', '-p', '--no-part-details', self.device])
   1376     except CommandError as e:
   1377       if e.getExitCode() == 2:
   1378         return
   1379     raise VDOServiceError('device is a physical volume;'
   1380                           + ' use --force to override',
   1381                           exitStatus = StateExitStatus)


[vagrant@rhel-8-nightly util-linux]$ sudo blkid -p /dev/vdb
/dev/vdb: PTUUID="15a53d51" PTTYPE="dos"
[vagrant@rhel-8-nightly util-linux]$ echo $?
0
[vagrant@rhel-8-nightly util-linux]$ sudo blkid -p --no-part-details /dev/vdb
/dev/vdb: PTUUID="15a53d51" PTTYPE="dos"
[vagrant@rhel-8-nightly util-linux]$ echo $?
0
[vagrant@rhel-8-nightly util-linux]$ sudo blkid -p /dev/vdb1
/dev/vdb1: PART_ENTRY_SCHEME="dos" PART_ENTRY_UUID="15a53d51-01" PART_ENTRY_TYPE="0x83" PART_ENTRY_NUMBER="1" PART_ENTRY_OFFSET="2048" PART_ENTRY_SIZE="41938944" PART_ENTRY_DISK="253:16"
[vagrant@rhel-8-nightly util-linux]$ echo $?
0
[vagrant@rhel-8-nightly util-linux]$ sudo blkid -p --no-part-details /dev/vdb1
[vagrant@rhel-8-nightly util-linux]$ echo $?
2
[vagrant@rhel-8-nightly util-linux]$ sudo vdo create --name vdo0 --device /dev/vdb1 --verbose
Creating VDO vdo0
    grep MemAvailable /proc/meminfo
    pvcreate -qq --test /dev/vdb1
    blkid -p --no-part-details /dev/vdb1
    modprobe kvdo
    vdoformat --uds-checkpoint-frequency=0 --uds-memory-size=0.25 /dev/vdb1
    vdodumpconfig /dev/vdb1
Starting VDO vdo0
    dmsetup status vdo0
    grep MemAvailable /proc/meminfo
    modprobe kvdo
    vdodumpconfig /dev/vdb1
    vdodumpconfig /dev/vdb1
    dmsetup create vdo0 --uuid VDO-6bc4c504-d463-49cd-9e97-5d6e51da8128 --table '0 33489040 vdo V2 /dev/vdb1 5242368 4096 32768 16380 on auto vdo0 maxDiscard 1 ack 1 bio 4 bioRotationInterval 64 cpu 2 hash 1 logical 1 physical 1'
    dmsetup status vdo0
Starting compression on VDO vdo0
    dmsetup message vdo0 0 compression on
    vdodmeventd -r vdo0
    dmsetup status vdo0
VDO instance 1 volume is ready at /dev/mapper/vdo0

Comment 4 Andy Walsh 2018-12-11 14:58:04 UTC
> Steps to Reproduce:
> 1. Partition a block device
> 2. Run 'vdo create' against it

This is a bit too vague.

1. Partition a block device (i.e. /dev/vdb)
2. Run 'vdo create' against the new partition (i.e. /dev/vdb1)

Comment 5 Jakub Krysl 2018-12-11 15:11:56 UTC
This is reproducible on loopdev and virtual disk, probably only on those. Tested on real SATA drive and could not hit it, blkid of new partition does not return anything there and exits with 2. On loopdev it returns UUID and exits with 0.

Comment 7 Jakub Krysl 2018-12-17 15:03:23 UTC
kmod-kvdo-6.2.0.293-38.el8.x86_64
vdo-6.2.0.293-10.el8.x86_64

blkid now treats loopdevs the same way as real devices, so vdo can be created there without issues:
# blkid /dev/sda
# echo $?
2
# blkid /dev/loop1
# echo $?
2
# vdo create --name vdo --device /dev/loop1
Creating VDO vdo
Starting VDO vdo
Starting compression on VDO vdo
VDO instance 15 volume is ready at /dev/mapper/vdo


Note You need to log in before you can comment on or make changes to this bug.