cluster: RHEL55 - resource-agents: Fix vm.sh migration failure handling
Lon Hohberger
lon at fedoraproject.org
Mon Dec 14 22:24:16 UTC 2009
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=3bcd3e1017cf489c9baa6d6fb7d16a43862f22df
Commit: 3bcd3e1017cf489c9baa6d6fb7d16a43862f22df
Parent: 94ce529d73ea7113f31fb9a369d7780e44fb7f5a
Author: Lon Hohberger <lhh at redhat.com>
AuthorDate: Mon Nov 30 17:29:02 2009 -0500
Committer: Lon Hohberger <lhh at redhat.com>
CommitterDate: Mon Dec 14 17:19:11 2009 -0500
resource-agents: Fix vm.sh migration failure handling
If a VM fails to migrate, there is a good chance that
the VM is still running locally. Return a non-fatal
error so that the resource does not enter the failed
state.
Resolves: rhbz#499835
Part 2 of 2
Signed-off-by: Lon Hohberger <lhh at redhat.com>
---
rgmanager/src/resources/vm.sh | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
index 08c4d28..14978fc 100755
--- a/rgmanager/src/resources/vm.sh
+++ b/rgmanager/src/resources/vm.sh
@@ -928,7 +928,23 @@ case $1 in
migrate)
validate_all || exit $OCF_ERR_ARGS
migrate $2 # Send VM to this node
- exit $?
+ rv=$?
+ if [ $rv -eq $OCF_ERR_GENERIC ]; then
+ # Catch-all: If migration failed with
+ # an unhandled error, do a status check
+ # to see if the VM is really dead.
+ #
+ # If the VM is still in good health, return
+ # a value to rgmanager to indicate the
+ # non-critical error
+ #
+ # XXX Is OCF_ERR_CONFIGURED the right value?
+ do_status > /dev/null
+ if [ $? -eq 0 ]; then
+ rv=$OCF_ERR_CONFIGURED
+ fi
+ fi
+ exit $rv
;;
reload)
exit 0
More information about the cluster-commits
mailing list