From fbcd0b66455cb4d8432e69bbd79128ca772e8de7 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 9 Feb 2010 16:26:40 +0000 Subject: [PATCH] -Fix vm.host corruption when hostnames != nodenames git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5202 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index 7085b8414..5efed50c9 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -321,7 +321,7 @@ sub process_request { }; if ($@) { $vcenterhash{$vcenter}->{conn} = undef; - sendmsg([1,"Unable to reach $vcenter vCenter server to manage $hyp"]); + sendmsg([1,"Unable to reach $vcenter vCenter server to manage $hyp: $@"]); next; } } @@ -966,6 +966,9 @@ sub generic_vm_operation { #The general form of firing per-vm requests to ESX hy my $host = $hyphash{$hyp}->{conn}->get_view(mo_ref=>$_->{'runtime.host'}); $host = $host->summary->config->name; if ( $tablecfg{vm}->{$node}->[0]->{host} eq "$host" ) { next; } + my $newnhost = inet_aton($host); + my $oldnhost = inet_aton($tablecfg{vm}->{$node}->[0]->{host}); + if ($newnhost = $oldnhost) { next; } #it resolved fine my $shost = $host; $shost =~ s/\..*//; if ( $tablecfg{vm}->{$node}->[0]->{host} eq "$shost" ) { next; } @@ -978,9 +981,9 @@ sub generic_vm_operation { #The general form of firing per-vm requests to ESX hy if ($nodes[0]) { print $node. " and ".$nodes[0]; $vmtab->setNodeAttribs($node,{host=>$nodes[0]}); - } else { - $vmtab->setNodeAttribs($node,{host=>$host}); - } + } #else { + # $vmtab->setNodeAttribs($node,{host=>$host}); + #} } }