Browse files

HA LVM should only remove missing PVs on stop when they belong to mir…


This adds --mirrorsonly to the 3 'vgreduce --removemissing' calls in the
LVM agents.

You'll also notice that it adds another self_fence check after we fail to
remove tags.  In my previous comment, I pointed out that in the case of
single-host by_lv, after we vgreduce we then can't deactivate the logical
volume again because it doesn't exist.  This results in us executing
self_fence, which may have just been a happy accident.  But when we avoid
making metadata changes by adding --mirrorsonly, the subsequent deactivation
is still successful, and thus we miss the self_fence logic.  So, I added
another check so we still catch the failure and fence ourselves in this

J.B - Retain the loop in 'vg_stop_clustered' that waits for udev to settle
      when trying to deactivate the volume group.  Failure to do so can
      lead to failure to deactivate the volume group.

Signed-off-by: John Ruemker <>
Signed-off-by: Jonthan Brassow <>
  • Loading branch information...
1 parent a1dc296 commit 43a84885f800b35fedddfcb8d898d9fa09439443 @johnruemker johnruemker committed with May 14, 2013
Showing with 11 additions and 5 deletions.
  1. +10 −4 rgmanager/src/resources/
  2. +1 −1 rgmanager/src/resources/
14 rgmanager/src/resources/
@@ -269,13 +269,19 @@ lv_activate_and_tag()
# be removed from the VG via a separate call before
# the tag can be removed.
ocf_log err "Attempting volume group clean-up and retry"
- vgreduce --removemissing --force $OCF_RESKEY_vg_name
+ vgreduce --removemissing --mirrorsonly --force $OCF_RESKEY_vg_name
# Retry tag deletion
lvchange --deltag $tag $lv_path
if [ $? -ne 0 ]; then
- ocf_log err "Failed to delete tag from $lv_path"
+ if [ "$self_fence" ]; then
+ ocf_log err "Failed to delete tag from $lv_path: REBOOTING"
+ sync
+ reboot -fn
+ else
+ ocf_log err "Failed to delete tag from $lv_path"
+ fi
@@ -355,7 +361,7 @@ lv_activate()
ocf_log notice "Attempting cleanup of $OCF_RESKEY_vg_name"
- if vgreduce --removemissing --force --config \
+ if vgreduce --removemissing --mirrorsonly --force --config \
"activation { volume_list = \"$OCF_RESKEY_vg_name\" }" \
$OCF_RESKEY_vg_name; then
ocf_log notice "$OCF_RESKEY_vg_name now consistent"
2 rgmanager/src/resources/
@@ -229,7 +229,7 @@ function vg_start_clustered
ocf_log err "Failed to activate volume group, $OCF_RESKEY_vg_name"
ocf_log notice "Attempting cleanup of $OCF_RESKEY_vg_name"
- if ! vgreduce --removemissing --force $OCF_RESKEY_vg_name; then
+ if ! vgreduce --removemissing --mirrorsonly --force $OCF_RESKEY_vg_name; then
ocf_log err "Failed to make $OCF_RESKEY_vg_name consistent"

0 comments on commit 43a8488

Please sign in to comment.