-Fix bug where cluster support could mistakenly wipe out a cluster completely mentioned in previous checkin

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4281 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2009-10-01 20:54:11 +00:00
parent 7743862e8b
commit 0f6d150ea0

View File

@ -1340,7 +1340,13 @@ sub validate_vcenter_prereqs { #Communicate with vCenter and ensure this host is
$depfun->($depargs);
return 1;
} else {
my $task = $hyphash{$hyp}->{vcenter}->{conn}->get_view(mo_ref=>$_->parent)->Destroy_Task(); #THIS DESTROYS THE CLUSTER, FIX
my $ref_to_delete;
if ($_->parent->type eq 'ClusterComputeResource') { #We are allowed to specifically kill a host in a cluster
$ref_to_delete = $_->{mo_ref};
} elsif ($_->parent->type eq 'ComputeResource') { #For some reason, we must delete the container instead
$ref_to_delete = $_->{parent};
}
my $task = $hyphash{$hyp}->{vcenter}->{conn}->get_view(mo_ref=>$ref_to_delete)->Destroy_Task();
$running_tasks{$task}->{task} = $task;
$running_tasks{$task}->{callback} = \&addhosttovcenter;
$running_tasks{$task}->{conn} = $hyphash{$hyp}->{vcenter}->{conn};
@ -1391,7 +1397,6 @@ sub addhosttovcenter {
$hypready{$hyp}=-1; #Declare impossiblility to be ready
return;
}
sendmsg("Why yes, I was able to find ".$tablecfg{hypervisor}->{$hyp}->[0]->{cluster});
$task = $cluster->AddHost_Task(spec=>$connspec,asConnected=>1);
$running_tasks{$task}->{task} = $task;
$running_tasks{$task}->{callback} = \&connecthost_callback;