From 5579e698ee622a07b4aad910ade3d9e04ffd68ef Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 6 Jun 2012 13:40:42 +0000 Subject: [PATCH] Provide a default value for win2k3 cloning use with clonevm specialize git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@13013 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index a9bf45756..e5e5919ef 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -2286,10 +2286,13 @@ sub clone_vms_from_master { } my $masterview=$masterviews->[0]; my $masterent=$args{masterent}; + my $ostype; foreach $node (@nodes) { my $destination=$tablecfg{vm}->{$node}->[0]->{storage}; my $nodetypeent; my $vment; + + $ostype=$masterent->{'os'}; foreach (qw/os arch profile/) { $nodetypeent->{$_}=$masterent->{$_}; } @@ -2323,7 +2326,7 @@ sub clone_vms_from_master { $clonespecargs{snapshot}=$masterview->snapshot->currentSnapshot; } if ($specialize) { - $clonespecargs{customization} = make_customization_spec($node); + $clonespecargs{customization} = make_customization_spec($node,ostype=>$ostype); } my $clonespec = VirtualMachineCloneSpec->new(%clonespecargs); my $vmfolder = $vmhash{$node}->{vmfolder}; @@ -2341,6 +2344,7 @@ sub clone_vms_from_master { sub make_customization_spec { my $node = shift; + my %args = @_; my $password="Passw0rd"; my $wintimezone; #map of number to strings can be found at @@ -2371,6 +2375,16 @@ sub make_customization_spec { die "need passwd table entry for system account Administrator"; } $password=$passent->{password}; + my %lfpd; + if ($args{ostype} and $args{ostype} =~ /win2k3/) { + %lfpd = ( + licenseFilePrintData=>CustomizationLicenseFilePrintData->new( + autoMode=>CustomizationLicenseDataMode->new( + val => 'perSeat', + ) + ) + ); + } my %runonce; if (scalar @runonce) { #skip section if no postscripts or postbootscripts %runonce=( @@ -2382,6 +2396,7 @@ sub make_customization_spec { my $identity = CustomizationSysprep->new( %runonce, + %lfpd, guiUnattended => CustomizationGuiUnattended->new( autoLogon=>0, autoLogonCount=>1,