File bug-1050908_cluster-glue-stonith-external-vcenter-RESETPOWERON=0.patch of Package cluster-glue.8576
commit 0fabedc2249ff084e5c3af8775f980284e07cba2
Author: Gao,Yan <ygao@suse.com>
Date: Tue Aug 1 18:22:43 2017 +0200
Fix: stonith: external/vcenter: Reset returns success with RESETPOWERON=0 if vm is already off
diff --git a/lib/plugins/stonith/external/vcenter b/lib/plugins/stonith/external/vcenter
index c6b8091a..38ba36e3 100755
--- a/lib/plugins/stonith/external/vcenter
+++ b/lib/plugins/stonith/external/vcenter
@@ -209,6 +209,8 @@ elsif (grep /^\Q$command\E$/, @netCommands) {
if ($powerState eq "poweredOff" && (! exists $ENV{'RESETPOWERON'} || $ENV{'RESETPOWERON'} ne 0)) {
$vm->PowerOnVM();
system("ha_log.sh", "info", "Machine $esx:$vm->{'name'} has been powered on");
+ } elsif ($powerState eq "poweredOff") {
+ system("ha_log.sh", "info", "Machine $esx:$vm->{'name'} won't be powered on with configured parameter RESETPOWERON=0");
} else {
dielog("Could not complete $esx:$vm->{'name'} power cycle");
}