Editing
2 Node Cluster: Dual Primary DRBD + CLVM + KVM + Live Migrations
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===== patch ===== <source> --- /usr/lib/ocf/resource.d/heartbeat/LVM.orig 2013-04-18 10:08:57.333596804 -0700 +++ /usr/lib/ocf/resource.d/heartbeat/LVM 2013-04-18 10:36:39.741388039 -0700 @@ -229,24 +229,34 @@ # Disable the LVM volume # LVM_stop() { + local first_try=true + rc=$OCF_ERR_GENERIC vgdisplay "$1" 2>&1 | grep 'Volume group .* not found' >/dev/null && { ocf_log info "Volume group $1 not found" return 0 } - ocf_log info "Deactivating volume group $1" - ocf_run vgchange -a ln $1 || return 1 - if - LVM_status $1 - then - ocf_log err "LVM: $1 did not stop correctly" - return $OCF_ERR_GENERIC - fi + # try to deactivate first time + ocf_log info "Deactivating volume group $1" + ocf_run vgchange -a ln $1 - # TODO: This MUST run vgexport as well + # Keep trying to bring down the resource; + # wait for the CRM to time us out if this fails + while :; do + if LVM_status $1; then + ocf_log warn "$1 still Active, Deactivating volume group $1." + ocf_log info "Deactivating volume group $1" + ocf_run vgchange -a ln $1 + else + rc=$OCF_SUCCESS + break; + fi + $first_try || sleep 1 + first_try=false + done - return $OCF_SUCCESS + return $rc } </source>
Summary:
Please note that all contributions to RARForge may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
RARForge:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Home
All Pages
All Files
View Categories
Recent changes
Random page
Edit this menu
Tools
What links here
Related changes
Special pages
Page information