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 1527921

Summary: RFE: Provide better reason why VDO cannot be removed when it is in use
Product: Red Hat Enterprise Linux 7 Reporter: Jakub Krysl <jkrysl>
Component: vdoAssignee: vdo-internal <vdo-internal>
Status: CLOSED DUPLICATE QA Contact: Jakub Krysl <jkrysl>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: awalsh, jkrysl
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
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: 2017-12-20 13:57:29 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 Jakub Krysl 2017-12-20 13:31:14 UTC
Description of problem:
When removing vdo that is used by another device (for example LVM LV on top of VDO), vdo tried "dmsetup remove" few times and exits with "vdo: ERROR - cannot stop VDO service vdo_test" instead of providing more helpful message like LVM. Is it possible to check if VDO is in use and provide the message to used instead of trying to remove it right away and fail with general error?

# lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
--snip--
sdc                         8:32   0  5.5T  0 disk
└─md127                     9:127  0 10.9T  0 raid0
  └─vdo_test              253:2    0 10.9T  0 vdo
    └─vg_vdo_test-lv_test 253:3    0 10.9T  0 lvm
sdd                         8:48   0  5.5T  0 disk
└─md127                     9:127  0 10.9T  0 raid0
  └─vdo_test              253:2    0 10.9T  0 vdo
    └─vg_vdo_test-lv_test 253:3    0 10.9T  0 lvm
# vdo remove --all --verbose
Removing VDO vdo_test
Stopping VDO vdo_test
    dmsetup status vdo_test
    mount
    udevadm settle
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup status vdo_test
vdo: ERROR - cannot stop VDO service vdo_test

Version-Release number of selected component (if applicable):
vdo-6.1.0.98-13

How reproducible:
100%

Steps to Reproduce:
1. create vdo
2. create device on top of vdo to block it
3. try to remove vdo

Actual results:
# vdo remove --all --verbose
Removing VDO vdo_test
Stopping VDO vdo_test
    dmsetup status vdo_test
    mount
    udevadm settle
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup remove vdo_test
    dmsetup status vdo_test
vdo: ERROR - cannot stop VDO service vdo_test

Expected results:
# vdo remove --all --verbose
vdo: ERROR - VDO is used by another device, cannot remove

Additional info:
This is what LVM does in this situation:
# lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
--snip--
sdc                         8:32   0  5.5T  0 disk
└─md127                     9:127  0 10.9T  0 raid0
  └─vdo_test              253:2    0 10.9T  0 vdo
    └─vg_vdo_test-lv_test 253:3    0 10.9T  0 lvm
      └─test-test         253:4    0  100G  0 lvm
sdd                         8:48   0  5.5T  0 disk
└─md127                     9:127  0 10.9T  0 raid0
  └─vdo_test              253:2    0 10.9T  0 vdo
    └─vg_vdo_test-lv_test 253:3    0 10.9T  0 lvm
      └─test-test         253:4    0  100G  0 lvm
# vgremove vg_vdo_test
Do you really want to remove volume group "vg_vdo_test" containing 1 logical volumes? [y/n]: y
  Logical volume vg_vdo_test/lv_test is used by another device.
# lvremove vg_vdo_test/lv_test
  Logical volume vg_vdo_test/lv_test is used by another device.

Comment 3 Jakub Krysl 2017-12-20 13:57:29 UTC

*** This bug has been marked as a duplicate of bug 1511106 ***