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

Fix VG activity bug in heartbeat/LVM script #829

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cbf123
Copy link

@cbf123 cbf123 commented Jun 21, 2016

There is currently an issue in the lvm2 package where if you create an LVM thin
pool, then create a thin volume in the pool, then the udev rule doesn't think
there should be a /dev// symlink for the thin
pool, but "vgmknodes" and "vgscan --mknodes" both think that there should be
such a symlink. This is a bug, but it's in the field in CentOS 7 at least
and likely elsewhere.

The end result of this is that on such a system running either "vgscan
--mknodes" or "vgmknodes" and then running "vgchange -an " will
leave the /dev/ directory with a dangling symlink in it.

This breaks the LVM_status() function in this OCF script, since the
/dev/<volume_group> directory exists and is not empty even though the volume
group is not active.

This commit changes the code to directly query lvm about the volume group
activity rather than relying on side effects.

There is currently an issue in the lvm2 package where if you create an LVM thin
pool, then create a thin volume in the pool, then the udev rule doesn't think
there should be a /dev/<volume-group>/<logical-volume> symlink for the thin
pool, but "vgmknodes" and "vgscan --mknodes" both think that there should be
such a symlink.  This is a bug, but it's in the field in CentOS 7 at least
and likely elsewhere.

The end result of this is that on such a system running either "vgscan
--mknodes" or "vgmknodes" and then running "vgchange -an <volume-group>" will
leave the /dev/<volume-group> directory with a dangling symlink in it.

This breaks the LVM_status() function in this OCF script, since the
/dev/<volume_group> directory exists and is not empty even though the volume
group is not active.

This commit changes the code to directly query lvm about the volume group
activity rather than relying on side effects.
# Ask lvm whether the volume group is active. This maps to
# the question "Are there any logical volumes that are active in
# the specified volume group?".
lvs --noheadings -o selected -S lv_active=active,vg_name=${1}|grep -q 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Due to timing issues on various storage configurations, all lvm commands were banned from the status/monitor path. There were reports about the lvm programs taking unusually long time to run and that could unfortunately also be due to another VG.

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.

2 participants