Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CA-393194: Fix pvremove failure #694

Conversation

stephenchengCloud
Copy link
Contributor

@stephenchengCloud stephenchengCloud commented Jul 1, 2024

In lvmohba test, the test failed at
SR.destroy(sr_ref) -> removeVG -> pvremove with the lvm error message "No devices to process".
The root cause is that the PV which was to be removed
was not really used as PV when it comes to multipathed devices.
The LVM official document says:
"Since each LUN has multiple device nodes in /dev  that point to the same underlying data,
they all contain the same LVM metadata
and thus LVM commands will find the same metadata
multiple times and report them as duplicates.
These duplicate messages are only warnings
and do not mean the LVM operation has failed.
Rather, they are alerting the user that only one of the devices has been used as a physical volume and the others are being ignored." 
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

This fix is to find the real PV in a VG before removing the VG.

Test passed: 4038532

drivers/lvutil.py Outdated Show resolved Hide resolved
Copy link
Contributor

@MarkSymsCtx MarkSymsCtx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MarkSymsCtx
Copy link
Contributor

@rdn32 we probably want to backport this to 8.2 as I suspect it will resolve your partner issue.

@MarkSymsCtx MarkSymsCtx force-pushed the private/stephenche/CA-393194 branch from 331ee84 to 9132e8f Compare July 1, 2024 09:30
@MarkSymsCtx MarkSymsCtx changed the title CA-393194: Fix pvremove failaure CA-393194: Fix pvremove failure Jul 1, 2024
MarkSymsCtx
MarkSymsCtx previously approved these changes Jul 1, 2024
TimSmithCtx
TimSmithCtx previously approved these changes Jul 1, 2024
@MarkSymsCtx
Copy link
Contributor

MarkSymsCtx commented Jul 1, 2024

Whilst this change is in itself fine we will need to add unit tests for the code modified in order to be able to release it. Either in this PR or in a follow-up.

test_lvutil.py has separate classes for the various operations and currently does not have anything for VG/PV management

@stephenchengCloud
Copy link
Contributor Author

Whilst this change is in itself fine we will need to add unit tests for the code modified in order to be able to release it. Either in this PR or in a follow-up.

test_lvutil.py has separate classes for the various operations and currently does not have anything for VG/PV management

Sure. I will add unit tests in this PR.

In lvmohba test, the test failed at
`SR.destroy(sr_ref) -> removeVG -> pvremove ` with the
lvm error message "No devices to process".
The root cause is that the PV which was to be removed
was not really used as PV when it comes to multipathed devices.
The LVM official document says:
"Since each LUN has multiple device nodes in /dev 
that point to the same underlying data,
they all contain the same LVM metadata
and thus LVM commands will find the same metadata
multiple times and report them as duplicates.
These duplicate messages are only warnings
and do not mean the LVM operation has failed.
Rather, they are alerting the user that only one of the devices
has been used as a physical volume and the others are being ignored." 
Please refer to https://docs.redhat.com/en/documentation/
red_hat_enterprise_linux/6/html/logical_volume_manager_administration
/duplicate_pv_multipath#duplicate_pv_multipath

This fix is to find the real PV in a VG before removing the VG.

Signed-off-by: Stephen Cheng <stephen.cheng@cloud.com>
@stephenchengCloud stephenchengCloud dismissed stale reviews from TimSmithCtx and MarkSymsCtx via e0ecb42 July 2, 2024 04:29
@stephenchengCloud stephenchengCloud force-pushed the private/stephenche/CA-393194 branch from 9132e8f to e0ecb42 Compare July 2, 2024 04:29
@stephenchengCloud
Copy link
Contributor Author

Added unit tests.
Passed:
drivers/lvutil.py 511 260 134 9 47%

@MarkSymsCtx MarkSymsCtx requested a review from TimSmithCtx July 3, 2024 09:03
@MarkSymsCtx MarkSymsCtx merged commit eb29245 into xapi-project:master Jul 4, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants