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

LVM: status check for missing VG #981

Closed

Conversation

oalbrigt
Copy link
Contributor

Detect if VG is missing (e.g. for multipath where the device is still present when it's unavailable).

output=$(vgscan $vg 2>&1)
else
output=$(vgscan --cache 2>&1)
fi

Choose a reason for hiding this comment

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

I think 'vgscan --cache' is very expensive lvm command, especially if there are a large of LVs on system. LVM_status will be invoked periodically. I don't think it's good idea to ad it in status checking.

fi
if ! echo "$output" | grep -q "Found.*\"$1\""; then
ocf_exit_reason "LVM Volume $1 is not available"
return $OCF_ERR_GENERIC

Choose a reason for hiding this comment

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

It seems to me that 'status action' expects either OCF_SUCESS or OCF_NOT_RUNNING...

@renzhengeek
Copy link

From my perspective, in status action, it's always good to use short/quick code to accurately check the LV/VG activation status directly :)

@dmuhamedagic
Copy link
Contributor

dmuhamedagic commented Oct 16, 2017 via email

@oalbrigt
Copy link
Contributor Author

oalbrigt commented Nov 2, 2017

Thanks for your feedback. I agree, and will close this PR.

@oalbrigt oalbrigt closed this Nov 2, 2017
@oalbrigt oalbrigt deleted the LVM-status-check-for-missing-VG branch November 2, 2017 10:56
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.

None yet

3 participants