CA-407507: Fix pvremove issue for multipathed devices #737
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the previous commit eb29245, we fixed an issue where the pvremove removed a device that didn't represent the PV because of multipath.
We fixed that issue by finding the real PV before removing the VG and PVs.
Now another issue occured for a similar reason: after removing the VG, LVM cache reassign the underlying device represents the PV, then we failed
pvremove dev
using the original device node.The issue can be reproduced repeatly on XenServer 9. It might be caused by the update of lvm or multipath logic.
The solution is:
Before vgremove, save the uuid of the PVs attached to the VG. After vgremove, use the uuid to get the underlying device that represents the PV, then pvremove it.
For PV on multipathed devices, please refer to:
https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/logical_volume_manager_administration/duplicate_pv_multipath#duplicate_pv_multipath