-Implement rpower suspend for vmware.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5589 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2010-03-26 12:46:05 +00:00
parent 812e96221d
commit f32f9dbc2b

View File

@ -947,7 +947,7 @@ sub power {
}
}
if ($subcmd =~ /on/) {
if ($currstat eq 'off') {
if ($currstat eq 'off' or $currstat eq 'suspend') {
if (not $args{vmview}) { #We are asking to turn on a system the hypervisor
#doesn't know, attempt to register it first
register_vm($hyp,$node,undef,\&power,\%args);
@ -965,7 +965,7 @@ sub power {
$running_tasks{$task}->{hyp} = $args{hyp}; #$hyp_conns->{$hyp};
$running_tasks{$task}->{data} = { node => $node, successtext => $intent.'on', forceon=>$forceon };
} else {
sendmsg("on",$node);
sendmsg($currstat,$node);
}
} elsif ($subcmd =~ /off/) {
if ($currstat eq 'on') {
@ -974,6 +974,16 @@ sub power {
$running_tasks{$task}->{callback} = \&generic_task_callback;
$running_tasks{$task}->{hyp} = $args{hyp};
$running_tasks{$task}->{data} = { node => $node, successtext => 'off' };
} else {
sendmsg($currstat,$node);
}
} elsif ($subcmd =~ /suspend/) {
if ($currstat eq 'on') {
$task = $args{vmview}->SuspendVM_Task();
$running_tasks{$task}->{task} = $task;
$running_tasks{$task}->{callback} = \&generic_task_callback;
$running_tasks{$task}->{hyp} = $args{hyp};
$running_tasks{$task}->{data} = { node => $node, successtext => 'suspend' };
} else {
sendmsg("off",$node);
}