From f7b1d1b1eac9082c7ee04a1cca5582cf7fc93e6d Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 17 Nov 2009 18:41:42 +0000 Subject: [PATCH] -have 'virtualization' as an 'app' in appstatus git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4591 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/kvm.pm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 166303d55..ff456e333 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -949,7 +949,6 @@ sub process_request { my $forcemode = 0; my %orphans=(); if ($command eq 'vmstatenotify') { - print "I see the command $command ".$exargs[0]." ".$exargs[1]."\n"; unless ($vmtab) { $vmtab = new xCAT::Table('vm',-create=>1); } my $state = $exargs[0]; if ($state eq 'vmoff') { @@ -961,15 +960,31 @@ sub process_request { $vmtab->setNodeAttribs($exargs[1],{powerstate=>'on'}); return; } elsif ($state eq 'hypshutdown') { #turn this into an evacuate + my $nodelisttab = xCAT::Table->new('nodelist'); + my $appstatus = $nodelisttab->getNodeAttribs($noderange->[0],['appstatus']); + my @apps =split /,/,$appstatus->{'appstatus'}; + my @newapps; + foreach (@apps) { + if ($_ eq 'virtualization') { next; } + push @newapps,$_; + } + $nodelisttab->setNodeAttribs($noderange->[0],{appstatus=>join(',',@newapps)}); + print "oh eah\n"; $command="revacuate"; @exargs=(); } elsif ($state eq 'hypstartup') { #if starting up, check for nodes on this hypervisor and start them up + my $nodelisttab = xCAT::Table->new('nodelist'); + my $appstatus = $nodelisttab->getNodeAttribs($noderange->[0],['appstatus']); + my @apps =split /,/,$appstatus->{appstatus}; + unless (grep {$_ eq 'virtualization'} @apps) { + push @apps,'virtualization'; + $nodelisttab->setNodeAttribs($noderange->[0],{appstatus=>join(',',@apps)}); + } my @tents = $vmtab->getAttribs({host=>$noderange->[0],power=>'on'},['node']); $noderange=[]; foreach (@tents) { push @$noderange,noderange($_->{node}); } - print "I'm thinking about ".$noderange->[0]."\n"; $command="rpower"; @exargs=("on"); }