-Allow vmware administrators to skip attempts to reconfigure from xCAT tables
-Allow vmware admins to explicitly declare guestid when they do not or cannot rely upon nodetype.os git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8108 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
18b2a0d8aa
commit
5c5a2e8aed
@ -181,7 +181,7 @@ vmmaster => {
|
||||
}
|
||||
},
|
||||
vm => {
|
||||
cols => [qw(node host migrationdest storage storagemodel cfgstore memory cpus nics nicmodel bootorder clockoffset virtflags master vncport textconsole powerstate beacon datacenter comments disable)],
|
||||
cols => [qw(node host migrationdest storage storagemodel cfgstore memory cpus nics nicmodel bootorder clockoffset virtflags master vncport textconsole powerstate beacon datacenter guestostype comments disable)],
|
||||
keys => [qw(node)],
|
||||
table_desc => 'Virtualization parameters',
|
||||
descriptions => {
|
||||
@ -209,6 +209,7 @@ vm => {
|
||||
'vncport' => 'Tracks the current VNC display port (currently not meant to be set',
|
||||
'textconsole' => 'Tracks the Psuedo-TTY that maps to the serial port or console of a VM',
|
||||
'powerstate' => "This flag is used by xCAT to track the last known power state of the VM.",
|
||||
'guestostype' => "This allows administrator to specify an identifier for OS to pass through to virtualization stack. Normally this should be ignored as xCAT will translate from nodetype.os rather than requiring this field be used\n",
|
||||
'beacon' => "This flag is used by xCAT to track the state of the identify LED with respect to the VM.",
|
||||
'datacenter' => "Optionally specify a datacenter for the VM to exist in (only applicable to VMWare)",
|
||||
}
|
||||
@ -797,6 +798,7 @@ site => {
|
||||
" useSSHonAIX: (yes/1 or no/0). If yes, ssh/scp will be setup and used. If no,\n".
|
||||
" rsh/rcp will be setup and used on AIX. Default is yes.\n\n".
|
||||
" vcenterautojoin: When set to no, the VMWare plugin will not attempt to auto remove and add hypervisors while trying to perform operations. If users or tasks outside of xCAT perform the joining this assures xCAT will not interfere.\n\n",
|
||||
" vmwarereconfigonpower: When set to no, the VMWare plugin will make no effort to push vm.cpus/vm.memory updates from xCAT to VMWare\n",
|
||||
" rsh: This is no longer used. path to remote shell command for xdsh.\n\n".
|
||||
" rcp: This is no longer used. path to remote copy command for xdcp.\n\n".
|
||||
" SNsyncfiledir: The directory on the Service Node, where xdcp will copy the files\n".
|
||||
|
@ -26,7 +26,7 @@ sub grab_table_data{ #grab table data relevent to VM guest nodes
|
||||
if ($vpdtab) {
|
||||
$cfghash->{vpd} = $vpdtab->getNodesAttribs($noderange,['uuid']);
|
||||
}
|
||||
$cfghash->{vm} = $vmtab->getNodesAttribs($noderange,['node','host','migrationdest','cfgstore','storage','storagemodel','memory','cpus','nics','nicmodel','bootorder','virtflags','datacenter','master']);
|
||||
$cfghash->{vm} = $vmtab->getNodesAttribs($noderange,['node','host','migrationdest','cfgstore','storage','storagemodel','memory','cpus','nics','nicmodel','bootorder','virtflags','datacenter','guestostype','master']);
|
||||
my $mactab = xCAT::Table->new("mac",-create=>1);
|
||||
my $nrtab= xCAT::Table->new("noderes",-create=>1);
|
||||
$cfghash->{mac} = $mactab->getAllNodeAttribs(['mac'],1);
|
||||
|
@ -44,6 +44,7 @@ my $requester;
|
||||
my $viavcenter;
|
||||
my $viavcenterbyhyp;
|
||||
my $vcenterautojoin=1;
|
||||
my $reconfigreset=1;
|
||||
my $vmwaresdkdetect = eval {
|
||||
require VMware::VIRuntime;
|
||||
VMware::VIRuntime->import();
|
||||
@ -305,6 +306,14 @@ sub process_request {
|
||||
$vcenterautojoin=0;
|
||||
}
|
||||
}
|
||||
($ref) = $sitetab->getAttribs({key => 'vmwarereconfigonpower'},'value');
|
||||
if ($ref and defined $ref->{value}) {
|
||||
$reconfigreset=$ref->{value};
|
||||
if ($reconfigreset =~ /^(n|d)/i) { #if no or disable, skip it
|
||||
$reconfigreset=0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1422,7 +1431,7 @@ sub power {
|
||||
$currstat = $args{vmview}->{'runtime.powerState'}->val;
|
||||
if (grep /$subcmd/,qw/on reset boot/) {
|
||||
my $reconfigspec;
|
||||
if ($reconfigspec = getreconfigspec(node=>$node,view=>$args{vmview})) {
|
||||
if ($reconfigreset and ($reconfigspec = getreconfigspec(node=>$node,view=>$args{vmview}))) {
|
||||
if ($currstat eq 'poweredOff') {
|
||||
#xCAT::SvrUtils::sendmsg("Correcting guestId because $currid and $rightid are not the same...");#DEBUG
|
||||
my $task = $args{vmview}->ReconfigVM_Task(spec=>$reconfigspec);
|
||||
@ -2382,6 +2391,9 @@ sub getUnits {
|
||||
sub getguestid {
|
||||
my $osfound=0;
|
||||
my $node = shift;
|
||||
if ($tablecfg{vm}->{$node}->[0]->{guestostype}) { #if admin wants to skip derivation from nodetype.os value, let em
|
||||
return $tablecfg{vm}->{$node}->[0]->{guestostype};
|
||||
}
|
||||
my $nodeos = $tablecfg{nodetype}->{$node}->[0]->{os};
|
||||
my $nodearch = $tablecfg{nodetype}->{$node}->[0]->{arch};
|
||||
foreach (keys %guestidmap) {
|
||||
|
Loading…
Reference in New Issue
Block a user