Line 74... |
Line 74... |
74 |
|
74 |
|
75 |
|
75 |
|
76 |
# global variables
|
76 |
# global variables
|
77 |
my $scriptDir = $FindBin::RealBin;
|
77 |
my $scriptDir = $FindBin::RealBin;
|
78 |
my $scriptName = $FindBin::Script;
|
78 |
my $scriptName = $FindBin::Script;
|
79 |
my $confDir = "$scriptDir/conf";
|
- |
|
80 |
my $dbDir = "$scriptDir/var";
|
79 |
my $dbDir = "$scriptDir/var";
|
- |
|
80 |
our $confDir = "$scriptDir/conf";
|
81 |
our $nodeDBName = "$dbDir/node.yaml";
|
81 |
our $nodeDBName = "$dbDir/node.yaml";
|
82 |
our $domainDBName = "$dbDir/domains.yaml";
|
82 |
our $domainDBName = "$dbDir/domains.yaml";
|
83 |
our $nodePopulationDBName = "$dbDir/node_population.yaml";
|
83 |
our $nodePopulationDBName = "$dbDir/node_population.yaml";
|
84 |
|
84 |
|
85 |
# these contain the values from the databases
|
85 |
# these contain the values from the databases
|
Line 97... |
Line 97... |
97 |
my $version = 0;
|
97 |
my $version = 0;
|
98 |
|
98 |
|
99 |
sub help {
|
99 |
sub help {
|
100 |
print "$0 command [argument]\n";
|
100 |
print "$0 command [argument]\n";
|
101 |
print "where command is one of\n";
|
101 |
print "where command is one of\n";
|
102 |
print "\tnode update [-t NODE] # update a given node (defaults to all)\n";
|
- |
|
103 |
print "\tnode list # display tab delimited list of node specs\n";
|
102 |
print "\tnode update|list|scan # work with a node\n";
|
104 |
print "\tnode scan [-t NODE] # update list of domains on node (defaults to all)\n ";
|
- |
|
105 |
print "\tdomain update ALL|RUNNING|[domain] [domain]... # update domains\n";
|
103 |
print "\tdomain update|list # work with individual domains\n";
|
106 |
print "\tdomain list ALL|RUNNING|[domain] [domain]... # display tab delimited list of domain specs\n";
|
- |
|
107 |
print "\tcluster status # report of memory and vcpu status on all nodes\n";
|
104 |
print "\tcluster status # report of memory and vcpu status on all nodes\n";
|
- |
|
105 |
print "For additional help, run command help\n";
|
- |
|
106 |
print "\tnode help # or domain, or cluster\n";
|
108 |
print "Some flags can be used where appropriate\n";
|
107 |
print "Some flags can be used where appropriate\n";
|
109 |
print "\t--help|-h # show this screen\n";
|
108 |
print "\t--help|-h # show this screen\n";
|
110 |
print "\t--version|-v # show version of program\n";
|
109 |
print "\t--version|-v # show version of program\n";
|
111 |
print "\t--format|-f screen|tsv # output of list commands is either padded for screen or Tab Delim\n";
|
110 |
print "\t--format|-f screen|tsv # output of list commands is either padded for screen or Tab Delim\n";
|
112 |
print "\t--target|-t NODE # the action use NODE for the target of actions\n";
|
111 |
print "\t--target|-t NODE # the action use NODE for the target of actions\n";
|
113 |
print "\t--dryrun|-n # does not perform the actions, simply shows what commands would be executed\n";
|
112 |
print "\t--dryrun|-n # does not perform the actions, simply shows what commands would be executed\n";
|
114 |
print "\t--debug|d # increases verbosity, does not actually perform actions (--dry-run assumed)\n";
|
113 |
print "\t--debug|d # increases verbosity, with -ddd, totally outragious\n";
|
115 |
}
|
114 |
}
|
116 |
|
115 |
|
117 |
sub loadVirtDB {
|
116 |
sub loadVirtDB {
|
118 |
return if $virtDB;
|
117 |
return if $virtDB;
|
119 |
$virtDB = &readDB( $domainDBName );
|
118 |
$virtDB = &readDB( $domainDBName );
|