vSphere autologin configurability

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13292 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2012-07-13 13:42:33 +00:00
parent 0b517b5801
commit 8251123d26
2 changed files with 15 additions and 6 deletions

View File

@ -167,7 +167,7 @@ vmmaster => {
#storagemodel to allow chvm on a clone to be consistent with the master by default
#nics to track the network mapping that may not be preserved by the respective plugin's specific cfg info
#nicmodel same as storagemodel, except omitting for now until chvm actually does nics...
cols => [qw(name os arch profile storage storagemodel nics vintage originator virttype comments disable)],
cols => [qw(name os arch profile storage storagemodel nics vintage originator virttype specializeparameters comments disable)],
keys => [qw(name)],
nodecol => 'name', #well what do you know, I used it...
table_desc => 'Inventory of virtualization images for use with clonevm. Manual intervention in this table is not intended.',
@ -181,6 +181,7 @@ vmmaster => {
'nics' => 'The nic configuration and relationship to vlans/bonds/etc',
'vintage' => "When this image was created",
'originator' => 'The user who created the image',
'specializeparameters' => 'Implementation specific arguments, currently only "autoLogonCount=<number" for ESXi clonevme',
'virttype' => 'The type of virtualization this image pertains to (e.g. vmware, kvm, etc)',
}
},

View File

@ -2198,7 +2198,7 @@ sub clonevms {
my $masterref;
if ($base) { #if base, we need to pull in the target datastores
my $mastertab=xCAT::Table->new('vmmaster');
$masterref=$mastertab->getNodeAttribs( $base,[qw/storage os arch profile storagemodel nics/]);
$masterref=$mastertab->getNodeAttribs( $base,[qw/storage os arch profile storagemodel nics specializeparameters/]);
unless ($masterref) {
foreach my $node (@$nodes) {
xCAT::SvrUtils::sendmsg([1,"Cannot find master $base in vmmaster table"], $output_handler,$node);
@ -2350,7 +2350,9 @@ sub clone_vms_from_master {
$clonespecargs{snapshot}=$masterview->snapshot->currentSnapshot;
}
if ($specialize) {
$clonespecargs{customization} = make_customization_spec($node,ostype=>$ostype);
my %custargs;
if ($masterent->{specializeparameters}) { %custargs = ( parameters=>$masterent->{specializeparameters} ); }
$clonespecargs{customization} = make_customization_spec($node,ostype=>$ostype,%custargs);
}
my $clonespec = VirtualMachineCloneSpec->new(%clonespecargs);
my $vmfolder = $vmhash{$node}->{vmfolder};
@ -2417,13 +2419,19 @@ sub make_customization_spec {
)
);
}
my %autologonargs = ( autoLogon=>0, autoLogonCount=>1, );
if ($args{parameters} and $args{parameters} =~ /autoLogonCount=([^,]*)/i) {
my $count = $1;
if ($count) {
$autologonargs{autoLogon}=1;
$autologonargs{autoLogonCount}=$count;
}
}
my $identity = CustomizationSysprep->new(
%runonce,
%lfpd,
guiUnattended => CustomizationGuiUnattended->new(
autoLogon=>0,
autoLogonCount=>1,
%autologonargs,
password=>CustomizationPassword->new(
plainText=>1,
value=>$password,