Subversion Repositories havirt

Rev

Rev 38 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 38 Rev 39
Line 71... Line 71...
71
   push @return, "domain migrate domainname targetnode";
71
   push @return, "domain migrate domainname targetnode";
72
   push @return, "\tMigates a domain from its current location to targetnode";
72
   push @return, "\tMigates a domain from its current location to targetnode";
73
   push @return, "domain maintenance domainname [on|off]";
73
   push @return, "domain maintenance domainname [on|off]";
74
   push @return, "\tSet/Unset/display maintenance flag on domain";
74
   push @return, "\tSet/Unset/display maintenance flag on domain";
75
   push @return, "\tIf maintenance flag is set, no havirt will refuse any actions";
75
   push @return, "\tIf maintenance flag is set, no havirt will refuse any actions";
-
 
76
   push @return, "domain pin domainname node [node]";
-
 
77
   push @return, "\tPin a domain to one or more nodes. Restricts a node to only run on specific node(s)";
76
   return join( "\n", @return ) . "\n";
78
   return join( "\n", @return ) . "\n";
77
}
79
}
78
 
80
 
79
 
81
 
80
# dipslay a list of domains, which node they are on and some information on them
82
# dipslay a list of domains, which node they are on and some information on them
Line 188... Line 190...
188
# running domain, perform an xml dump of it, save it to conf/, then 
190
# running domain, perform an xml dump of it, save it to conf/, then 
189
# return it.
191
# return it.
190
sub getVirtConfig {
192
sub getVirtConfig {
191
   my ($virt,$filename) = @_;
193
   my ($virt,$filename) = @_;
192
   my $return;
194
   my $return;
193
   print "In getVirtConfig looking for $virt with file $filename, force is $main::config->{'flags'}->{'yes'}\n" if $main::config->{'flags'}->{'debug'};
195
   print "In getVirtConfig looking for $virt with file $filename, force is $main::config->{'flags'}->{'force'}\n" if $main::config->{'flags'}->{'debug'};
194
   if ( -f $filename && ! $main::config->{'flags'}->{'force'}) {
196
   if ( -f $filename && ! $main::config->{'flags'}->{'force'}) {
195
      open XML, "<$filename" or die "Could not read from $filename: $!\n";
197
      open XML, "<$filename" or die "Could not read from $filename: $!\n";
196
      $return = join( '', <XML> );
198
      $return = join( '', <XML> );
197
      close XML;
199
      close XML;
198
   } else {
200
   } else {
Line 357... Line 359...
357
   }
359
   }
358
   &main::writeDB();
360
   &main::writeDB();
359
   return "Maintenance set to " . ( $main::statusDB->{'virt'}->{$domain}->{'maintenance'} ? 'On' : 'Off' ) . "\n";
361
   return "Maintenance set to " . ( $main::statusDB->{'virt'}->{$domain}->{'maintenance'} ? 'On' : 'Off' ) . "\n";
360
}
362
}
361
 
363
 
-
 
364
 
-
 
365
sub pin {
-
 
366
   my $domain = shift;
-
 
367
   &main::readDB(1);
-
 
368
   while ( my $node = shift ) {
-
 
369
      $main::statusDB->{'virt'}->{$domain}->{'pin'}->{$node} = 1;
-
 
370
   }
-
 
371
   &main::writeDB();
-
 
372
   return "domain pin functionality not yet implemented\n";
-
 
373
}
362
 
374