Fix win2012 deployment issues with productkey and such
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14808 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -1,6 +1,7 @@ | ||||
| #!/usr/bin/perl | ||||
| use xCAT::TZUtils; | ||||
| # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html | ||||
| use xCAT::TZUtils; | ||||
| use xCAT::WinUtils; | ||||
|  | ||||
| package xCAT::Template; | ||||
| use strict; | ||||
| @@ -186,7 +187,8 @@ sub subvars { | ||||
|   $inc =~ s/#INCLUDE_PTRNLIST:([^#^\n]+)#/includefile($1,0,2)/eg; | ||||
|   $inc =~ s/#INCLUDE_RMPKGLIST:([^#^\n]+)#/includefile($1,0,3)/eg; | ||||
|   $inc =~ s/#INCLUDE:([^#^\n]+)#/includefile($1, 0, 0)/eg; | ||||
|   $inc =~ s/#WINTIMEZONE#/xCAT::TZUtils::get_wintimezone()/e; | ||||
|   $inc =~ s/#WINTIMEZONE#/xCAT::TZUtils::get_wintimezone()/eg; | ||||
|   $inc =~ s/#WINPRODKEY:([^#]+)#/get_win_prodkey($1)/eg; | ||||
|   $inc =~ s/#HOSTNAME#/$node/g; | ||||
|  | ||||
|   my $nrtab = xCAT::Table->new("noderes"); | ||||
| @@ -256,6 +258,18 @@ sub subvars { | ||||
|   close($outh); | ||||
|   return 0; | ||||
| } | ||||
| sub get_win_prodkey { | ||||
| 	my $osvariant = shift; | ||||
| 	my $keytab = xCAT::Table->new("prodkey",-create=>0); | ||||
| 	my $keyent = $keytab->getAttribs({product=>$osvariant},"key"); | ||||
| 	if ($keyent) {  | ||||
| 		return "<ProductKey><WillShowUI>OnError</WillShowUI><Key>".$keyent->{key}."</Key></ProductKey>"; | ||||
| 	} | ||||
| 	if ($xCAT::WinUtils::kmskeymap{$osvariant}) { | ||||
| 		return "<ProductKey><WillShowUI>OnError</WillShowUI><Key>".$xCAT::WinUtils::kmskeymap{$osvariant}."</Key></ProductKey>"; | ||||
| 	} | ||||
| 	return ""; #in the event that we have no specified key and no KMS key, then try with no key, user may have used some other mechanism  | ||||
| }  | ||||
|  | ||||
| sub esxipv6setup { | ||||
|  if ($::XCATSITEVALS{managedaddressmode} ne "autoula") { return ""; } # blank unless autoula | ||||
|   | ||||
| @@ -8,20 +8,20 @@ use strict; | ||||
| #ms uniquely identifies the version and 'flavor', processor architecture does not factor in | ||||
| #reference: http://technet.microsoft.com/en-us/library/jj612867.aspx | ||||
| #fyi, hyper-v 2012 has no license key, it's a free product | ||||
| my %kmskeymap = ( | ||||
| 	"win8-professional" => "NG4HW-VH26C-733KW-K6F98-J8CK4", | ||||
| 	"win8-professional_n" => "XCVCF-2NXM9-723PB-MHCB7-2RYQQ", | ||||
| 	"win8-enterprise" => "32JNW-9KQ84-P47T8-D8GGY-CWCK7", | ||||
| 	"win8-enterprise_n" => "JMNMF-RHW7P-DMY6X-RF3DR-X2BQT", | ||||
| 	"win2012-standard" => "XC9B7-NBPP2-83J2H-RHMBY-92BT4", #note that core and non-core share KMS key | ||||
| 	"win2012-datacenter" => "48HP8-DN98B-MYWDG-T2DCC-8W83P", | ||||
| 	"win7-professional" => "FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4", | ||||
| 	"win7-professional_n" => "MRPKT-YTG23-K7D7T-X2JMM-QY7MG", | ||||
| 	"win7-professional_e" => "W82YF-2Q76Y-63HXB-FGJG9-GF7QX", | ||||
| 	"win7-enterprise" => "33PXH-7Y6KF-2VJC9-XBBR8-HVTHH", | ||||
| 	"win7-enterprise_n" => "YDRBP-3D83W-TY26F-D46B2-XCKRJ", | ||||
| 	"win7-enterprise_e" => "C29WB-22CC8-VJ326-GHFJW-H9DH4", | ||||
| 	"win2k8r2-standard" => "YC6KT-GKW9T-YTKYR-T4X34-R7VHC", | ||||
| 	"win2k8r2-enterprise" => "489J6-VHDMP-X63PK-3K798-CPX3Y", | ||||
| 	"win2k8r2-datacenter" => "74YFP-3QFB3-KQT8W-PMXWJ-7M648", #note, itanium had a different key, but we won't support that... | ||||
| our %kmskeymap = ( | ||||
| 	"win8.professional" => "NG4HW-VH26C-733KW-K6F98-J8CK4", | ||||
| 	"win8.professional_n" => "XCVCF-2NXM9-723PB-MHCB7-2RYQQ", | ||||
| 	"win8.enterprise" => "32JNW-9KQ84-P47T8-D8GGY-CWCK7", | ||||
| 	"win8.enterprise_n" => "JMNMF-RHW7P-DMY6X-RF3DR-X2BQT", | ||||
| 	"win2012.standard" => "XC9B7-NBPP2-83J2H-RHMBY-92BT4", #note that core and non-core share KMS key | ||||
| 	"win2012.datacenter" => "48HP8-DN98B-MYWDG-T2DCC-8W83P", | ||||
| 	"win7.professional" => "FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4", | ||||
| 	"win7.professional_n" => "MRPKT-YTG23-K7D7T-X2JMM-QY7MG", | ||||
| 	"win7.professional_e" => "W82YF-2Q76Y-63HXB-FGJG9-GF7QX", | ||||
| 	"win7.enterprise" => "33PXH-7Y6KF-2VJC9-XBBR8-HVTHH", | ||||
| 	"win7.enterprise_n" => "YDRBP-3D83W-TY26F-D46B2-XCKRJ", | ||||
| 	"win7.enterprise_e" => "C29WB-22CC8-VJ326-GHFJW-H9DH4", | ||||
| 	"win2k8r2.standard" => "YC6KT-GKW9T-YTKYR-T4X34-R7VHC", | ||||
| 	"win2k8r2.enterprise" => "489J6-VHDMP-X63PK-3K798-CPX3Y", | ||||
| 	"win2k8r2.datacenter" => "74YFP-3QFB3-KQT8W-PMXWJ-7M648", #note, itanium had a different key, but we won't support that... | ||||
| ); | ||||
|   | ||||
| @@ -57,6 +57,7 @@ | ||||
|                 <AcceptEula>true</AcceptEula> | ||||
|                 <FullName>xCAT USER</FullName> | ||||
|                 <Organization>xCAT</Organization> | ||||
|             	#WINPRODKEY:win2012.datacenter# | ||||
|             </UserData> | ||||
|         </component> | ||||
|     </settings> | ||||
|   | ||||
| @@ -57,6 +57,7 @@ | ||||
|                 <AcceptEula>true</AcceptEula> | ||||
|                 <FullName>xCAT USER</FullName> | ||||
|                 <Organization>xCAT</Organization> | ||||
|             	#WINPRODKEY:win2012.datacenter# | ||||
|             </UserData> | ||||
|         </component> | ||||
|     </settings> | ||||
|   | ||||
| @@ -47,6 +47,7 @@ | ||||
|                 <AcceptEula>true</AcceptEula> | ||||
|                 <FullName>xCAT USER</FullName> | ||||
|                 <Organization>xCAT</Organization> | ||||
|             	#WINPRODKEY:win2012.standard# | ||||
|             </UserData> | ||||
|         </component> | ||||
|     </settings> | ||||
|   | ||||
| @@ -57,6 +57,7 @@ | ||||
|                 <AcceptEula>true</AcceptEula> | ||||
|                 <FullName>xCAT USER</FullName> | ||||
|                 <Organization>xCAT</Organization> | ||||
|             	#WINPRODKEY:win2012.standard# | ||||
|             </UserData> | ||||
|         </component> | ||||
|     </settings> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user