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
This commit is contained in:
		| @@ -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, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user