Description of problem: The host is having the custom configuration "issue_discards = 1" in the lvm.conf on hypervisor. So if we execute any lvremove command, it will ask for confirmation as below. lvremove rhvh/rhvh-4.1-0.20180314.0+1;echo $? Do you really want to remove and DISCARD logical volume rhvh/rhvh-4.1-0.20180314.0+1? [y/n]: y While removing the old layers, the lvremove is executed without "force" option. So the lvremove command will give an exit status of 5 because of the above confirmation and it will fail with the error below. === 2018-09-18 15:08:16,196 [DEBUG] (MainThread) Calling: (['lvremove', u'rhvh/rhvh-4.1-0.20180314.0+1'],) {'close_fds': True, 'stderr': <open file '/dev/null', mode 'w' at 0x7f757fe94030>} 2018-09-18 15:08:16,308 [DEBUG] (MainThread) Exception! 2018-09-18 15:08:16,308 [ERROR] (MainThread) Update failed, resetting registered LVs Traceback (most recent call last): File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/tmp/tmp.33vZVUL00H/usr/lib/python2.7/site-packages/imgbased/__main__.py", line 53, in <module> CliApplication() File "/tmp/tmp.33vZVUL00H/usr/lib/python2.7/site-packages/imgbased/__init__.py", line 82, in CliApplication app.hooks.emit("post-arg-parse", args) File "/tmp/tmp.33vZVUL00H/usr/lib/python2.7/site-packages/imgbased/hooks.py", line 120, in emit cb(self.context, *args) File "/tmp/tmp.33vZVUL00H/usr/lib/python2.7/site-packages/imgbased/plugins/update.py", line 68, in post_argparse six.reraise(*exc_info) File "/tmp/tmp.33vZVUL00H/usr/lib/python2.7/site-packages/imgbased/plugins/update.py", line 63, in post_argparse GarbageCollector(app.imgbase).run(base, keep) File "/tmp/tmp.33vZVUL00H/usr/lib/python2.7/site-packages/imgbased/plugins/update.py", line 199, in run self.imgbase.remove_base(base.nvr) File "/tmp/tmp.33vZVUL00H/usr/lib/python2.7/site-packages/imgbased/imgbase.py", line 332, in remove_base self.remove_layer(layer.nvr) File "/tmp/tmp.33vZVUL00H/usr/lib/python2.7/site-packages/imgbased/imgbase.py", line 351, in remove_layer lv.remove() File "/tmp/tmp.33vZVUL00H/usr/lib/python2.7/site-packages/imgbased/lvm.py", line 261, in remove LVM._lvremove(cmd) File "/tmp/tmp.33vZVUL00H/usr/lib/python2.7/site-packages/imgbased/utils.py", line 393, in lvremove return self.call(["lvremove"] + args, **kwargs) File "/tmp/tmp.33vZVUL00H/usr/lib/python2.7/site-packages/imgbased/utils.py", line 469, in call return super(LvmBinary, self).call(*args, stderr=DEVNULL, **kwargs) File "/tmp/tmp.33vZVUL00H/usr/lib/python2.7/site-packages/imgbased/utils.py", line 378, in call stdout = call(*args, **kwargs) File "/tmp/tmp.33vZVUL00H/usr/lib/python2.7/site-packages/imgbased/utils.py", line 153, in call return subprocess.check_output(*args, **kwargs).strip() File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output raise CalledProcessError(retcode, cmd, output=output) subprocess.CalledProcessError: Command '['lvremove', u'rhvh/rhvh-4.1-0.20180314.0+1']' returned non-zero exit status 5 === Version-Release number of selected component (if applicable): imgbased-1.0.24 How reproducible: 100 % Steps to Reproduce: 1. Change issue_discards = 1 in lvm.conf 2. Update the host which is having 3 or more layers. While deleting the old layer LV, it will fail with the mentioned error. Actual results: The upgrade is failing because lvremove asks for confirmation before removing the LV. Expected results: The upgrade should work. Maybe we can use --force option in lvremove? Additional info:
QE did not reproduce this issue with normal upgrades, please refer to: https://bugzilla.redhat.com/show_bug.cgi?id=1632058#c13
QE reproduced this issue, please refer to: https://bugzilla.redhat.com/show_bug.cgi?id=1632058#c18
This bug is fixed in redhat-virtualization-host-4.2-20181017.2. Please refer to: https://bugzilla.redhat.com/show_bug.cgi?id=1632058#c21 So change the status to VERIFIED.
Please review the doc text: During the upgrade process, when lvremove runs garbage collection, it prompts for user confirmation, causing the upgrade process to fail. Now the process uses "lvremove --force" when trying to remove logical volumes and does not fail even if garbage collection fails, and as a result, the upgrade process finishes successfully.
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/RHSA-2018:3470
sync2jira