From 51ec31d4d9b239935c1965d7ca4ab35fb5f8b124 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 24 Jun 2011 18:36:49 +0000 Subject: [PATCH] Backport fix for rmigrate -f error reporting git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.6@9936 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index f765afc06..d5bcd3e23 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -487,11 +487,14 @@ sub process_request { if (grep { $_ == -1 } values %hypready) { foreach (keys %hypready) { if ($hypready{$_} == -1) { + unless ($hyphash{$_}->{offline}) { push @badhypes,$_; + } my @relevant_nodes = sort (keys %{$hyphash{$_}->{nodes}}); foreach (@relevant_nodes) { + if ($command eq "rmigrate" and grep /-f/,@exargs) { $limbonodes{$_}=1; } else { xCAT::SvrUtils::sendmsg([1,": hypervisor unreachable"], $output_handler,$_); - if ($command eq "rmigrate" and grep /-f/,@exargs) { $limbonodes{$_}=1; } + } } delete $hyphash{$_}; } @@ -3190,14 +3193,22 @@ sub validate_vcenter_prereqs { #Communicate with vCenter and ensure this host is # $running_tasks{$task}->{data} = { depfun => $depfun, depargs => $depargs, conn=> $hyphash{$hyp}->{vcenter}->{conn}, connspec=>$connspec,hostview=>$hview,hypname=>$hyp,vcenter=>$vcenter }; #ADDHOST } else { + if ($hyphash{$hyp}->{offline}) { + xCAT::SvrUtils::sendmsg(": Failed to communicate with $hyp, vCenter reports it as in inventory but not connected and xCAT is set to not autojoin", $output_handler); + } else { xCAT::SvrUtils::sendmsg([1,": Failed to communicate with $hyp, vCenter reports it as in inventory but not connected and xCAT is set to not autojoin"], $output_handler); + } $hyphash{$hyp}->{conn} = undef; return "failed"; } } } unless ($vcenterautojoin) { - xCAT::SvrUtils::sendmsg([1,": Failed to communicate with $hyp, vCenter does not have it in inventory and xCAT is set to not autojoin"], $output_handler); + if ($hyphash{$hyp}->{offline}) { + xCAT::SvrUtils::sendmsg(": Failed to communicate with $hyp, vCenter does not have it in inventory and xCAT is set to not autojoin", $output_handler); + } else { + xCAT::SvrUtils::sendmsg([1,": Failed to communicate with $hyp, vCenter does not have it in inventory and xCAT is set to not autojoin"], $output_handler); + } $hyphash{$hyp}->{conn} = undef; return "failed"; }