From 7809a9291109d9fc0dafd788a0acc342562fc8df Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 29 Jul 2014 07:13:42 +0200 Subject: [PATCH] ha migrate: return non-critical error if migrate failed by VM is still running --- bin/ocf/pvevm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/ocf/pvevm b/bin/ocf/pvevm index ab108cae..57529327 100755 --- a/bin/ocf/pvevm +++ b/bin/ocf/pvevm @@ -359,7 +359,17 @@ if ($cmd eq 'start') { upid_wait($upid); # something went wrong if old config file is still there - exit((-f $oldconfig) ? OCF_ERR_GENERIC : OCF_SUCCESS); + if (-f $oldconfig) { + # check if VM is really dead. If still running, return non-critical error + # We use OCF error code 150 (same as vm.sh agent) + check_running($status); + + exit(150) if $status->{running}; + + exit(OCF_ERR_GENERIC); + } + + exit(OCF_SUCCESS); } elsif($cmd eq 'stop') { my $status = validate_all();