From 2c47c2613c9f1c18b5945cd78816e2e3d7c30bbd Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 1 Jun 2012 02:22:14 +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/trunk@12978 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 37b5f5e43..aec898019 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -2294,10 +2294,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->{$_}; } @@ -2331,7 +2334,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}; @@ -2349,6 +2352,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 @@ -2379,6 +2383,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=( @@ -2390,6 +2404,7 @@ sub make_customization_spec { my $identity = CustomizationSysprep->new( %runonce, + %lfpd, guiUnattended => CustomizationGuiUnattended->new( autoLogon=>0, autoLogonCount=>1,