mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	bug 6365: xenserver and xcp need different guest os mapper
status 6365: resolved fixed
This commit is contained in:
		
							parent
							
								
									82a5a43f4d
								
							
						
					
					
						commit
						23e0b2ce29
					
				| @ -29,74 +29,145 @@ import org.apache.log4j.Logger; | ||||
|  */ | ||||
| public class CitrixHelper { | ||||
| 	 private static final Logger s_logger = Logger.getLogger(CitrixHelper.class); | ||||
| 	private static final HashMap<String, String> _guestOsMap = new HashMap<String, String>(70); | ||||
| 	 private static final HashMap<String, String> _xcpGuestOsMap = new HashMap<String, String>(70); | ||||
| 	 private static final HashMap<String, String> _xenServerGuestOsMap = new HashMap<String, String>(70); | ||||
| 	 private static final ArrayList<String> _guestOsList = new ArrayList<String>(70); | ||||
| 
 | ||||
| 
 | ||||
|     static { | ||||
|         _guestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5"); | ||||
|         _guestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6"); | ||||
|         _guestOsMap.put("CentOS 4.7 (32-bit)", "CentOS 4.7"); | ||||
|         _guestOsMap.put("CentOS 4.8 (32-bit)", "CentOS 4.8"); | ||||
|         _guestOsMap.put("CentOS 5.0 (32-bit)", "CentOS 5.0"); | ||||
|         _guestOsMap.put("CentOS 5.0 (64-bit)", "CentOS 5.0 x64"); | ||||
|         _guestOsMap.put("CentOS 5.1 (32-bit)", "CentOS 5.1"); | ||||
|         _guestOsMap.put("CentOS 5.1 (64-bit)", "CentOS 5.1 x64"); | ||||
|         _guestOsMap.put("CentOS 5.2 (32-bit)", "CentOS 5.2"); | ||||
|         _guestOsMap.put("CentOS 5.2 (64-bit)", "CentOS 5.2 x64"); | ||||
|         _guestOsMap.put("CentOS 5.3 (32-bit)", "CentOS 5.3"); | ||||
|         _guestOsMap.put("CentOS 5.3 (64-bit)", "CentOS 5.3 x64"); | ||||
|         _guestOsMap.put("CentOS 5.4 (32-bit)", "CentOS 5.4"); | ||||
|         _guestOsMap.put("CentOS 5.4 (64-bit)", "CentOS 5.4 x64"); | ||||
|         _guestOsMap.put("Debian GNU/Linux 5.0 (32-bit)", "Debian Lenny 5.0 (32-bit)"); | ||||
|         _guestOsMap.put("Oracle Enterprise Linux 5.0 (32-bit)", "Oracle Enterprise Linux 5.0"); | ||||
|         _guestOsMap.put("Oracle Enterprise Linux 5.0 (64-bit)", "Oracle Enterprise Linux 5.0 x64"); | ||||
|         _guestOsMap.put("Oracle Enterprise Linux 5.1 (32-bit)", "Oracle Enterprise Linux 5.1"); | ||||
|         _guestOsMap.put("Oracle Enterprise Linux 5.1 (64-bit)", "Oracle Enterprise Linux 5.1 x64"); | ||||
|         _guestOsMap.put("Oracle Enterprise Linux 5.2 (32-bit)", "Oracle Enterprise Linux 5.2"); | ||||
|         _guestOsMap.put("Oracle Enterprise Linux 5.2 (64-bit)", "Oracle Enterprise Linux 5.2 x64"); | ||||
|         _guestOsMap.put("Oracle Enterprise Linux 5.3 (32-bit)", "Oracle Enterprise Linux 5.3"); | ||||
|         _guestOsMap.put("Oracle Enterprise Linux 5.3 (64-bit)", "Oracle Enterprise Linux 5.3 x64"); | ||||
|         _guestOsMap.put("Oracle Enterprise Linux 5.4 (32-bit)", "Oracle Enterprise Linux 5.4"); | ||||
|         _guestOsMap.put("Oracle Enterprise Linux 5.4 (64-bit)", "Oracle Enterprise Linux 5.4 x64"); | ||||
|         _guestOsMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", "Red Hat Enterprise Linux 4.5"); | ||||
|         _guestOsMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", "Red Hat Enterprise Linux 4.6"); | ||||
|         _guestOsMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", "Red Hat Enterprise Linux 4.7"); | ||||
|         _guestOsMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", "Red Hat Enterprise Linux 4.8"); | ||||
|         _guestOsMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", "Red Hat Enterprise Linux 5.0"); | ||||
|         _guestOsMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", "Red Hat Enterprise Linux 5.0 x64"); | ||||
|         _guestOsMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", "Red Hat Enterprise Linux 5.1"); | ||||
|         _guestOsMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", "Red Hat Enterprise Linux 5.1 x64"); | ||||
|         _guestOsMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", "Red Hat Enterprise Linux 5.2"); | ||||
|         _guestOsMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", "Red Hat Enterprise Linux 5.2 x64"); | ||||
|         _guestOsMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", "Red Hat Enterprise Linux 5.3"); | ||||
|         _guestOsMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", "Red Hat Enterprise Linux 5.3 x64"); | ||||
|         _guestOsMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", "Red Hat Enterprise Linux 5.4"); | ||||
|         _guestOsMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", "Red Hat Enterprise Linux 5.4 x64"); | ||||
|         _guestOsMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", "SUSE Linux Enterprise Server 9 SP4"); | ||||
|         _guestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", "SUSE Linux Enterprise Server 10 SP1"); | ||||
|         _guestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", "SUSE Linux Enterprise Server 10 SP1 x64"); | ||||
|         _guestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", "SUSE Linux Enterprise Server 10 SP2"); | ||||
|         _guestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", "SUSE Linux Enterprise Server 10 SP2 x64"); | ||||
|         _guestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", "Other install media"); | ||||
|         _guestOsMap.put("SUSE Linux Enterprise Server 11 (32-bit)", "SUSE Linux Enterprise Server 11"); | ||||
|         _guestOsMap.put("SUSE Linux Enterprise Server 11 (64-bit)", "SUSE Linux Enterprise Server 11 x64"); | ||||
|         _guestOsMap.put("Windows 7 (32-bit)", "Windows 7"); | ||||
|         _guestOsMap.put("Windows 7 (64-bit)", "Windows 7 x64"); | ||||
|         _guestOsMap.put("Windows Server 2003 (32-bit)", "Windows Server 2003"); | ||||
|         _guestOsMap.put("Windows Server 2003 (64-bit)", "Windows Server 2003 x64"); | ||||
|         _guestOsMap.put("Windows Server 2008 (32-bit)", "Windows Server 2008"); | ||||
|         _guestOsMap.put("Windows Server 2008 (64-bit)", "Windows Server 2008 x64"); | ||||
|         _guestOsMap.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008 R2 x64"); | ||||
|         _guestOsMap.put("Windows 2000 SP4 (32-bit)", "Windows 2000 SP4"); | ||||
|         _guestOsMap.put("Windows Vista (32-bit)", "Windows Vista"); | ||||
|         _guestOsMap.put("Windows XP SP2 (32-bit)", "Windows XP SP2"); | ||||
|         _guestOsMap.put("Windows XP SP3 (32-bit)", "Windows XP SP3"); | ||||
|         _guestOsMap.put("Other install media", "Other install media"); | ||||
|     	_xcpGuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5"); | ||||
|     	_xcpGuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6"); | ||||
|     	_xcpGuestOsMap.put("CentOS 4.7 (32-bit)", "CentOS 4.7"); | ||||
|     	_xcpGuestOsMap.put("CentOS 4.8 (32-bit)", "CentOS 4.8"); | ||||
|     	_xcpGuestOsMap.put("CentOS 5.0 (32-bit)", "CentOS 5.0"); | ||||
|     	_xcpGuestOsMap.put("CentOS 5.0 (64-bit)", "CentOS 5.0 x64"); | ||||
|     	_xcpGuestOsMap.put("CentOS 5.1 (32-bit)", "CentOS 5.1"); | ||||
|     	_xcpGuestOsMap.put("CentOS 5.1 (64-bit)", "CentOS 5.1 x64"); | ||||
|     	_xcpGuestOsMap.put("CentOS 5.2 (32-bit)", "CentOS 5.2"); | ||||
|     	_xcpGuestOsMap.put("CentOS 5.2 (64-bit)", "CentOS 5.2 x64"); | ||||
|     	_xcpGuestOsMap.put("CentOS 5.3 (32-bit)", "CentOS 5.3"); | ||||
|     	_xcpGuestOsMap.put("CentOS 5.3 (64-bit)", "CentOS 5.3 x64"); | ||||
|     	_xcpGuestOsMap.put("CentOS 5.4 (32-bit)", "CentOS 5.4"); | ||||
|     	_xcpGuestOsMap.put("CentOS 5.4 (64-bit)", "CentOS 5.4 x64"); | ||||
|     	_xcpGuestOsMap.put("Debian GNU/Linux 5.0 (32-bit)", "Debian Lenny 5.0 (32-bit)"); | ||||
|     	_xcpGuestOsMap.put("Oracle Enterprise Linux 5.0 (32-bit)", "Oracle Enterprise Linux 5.0"); | ||||
|     	_xcpGuestOsMap.put("Oracle Enterprise Linux 5.0 (64-bit)", "Oracle Enterprise Linux 5.0 x64"); | ||||
|     	_xcpGuestOsMap.put("Oracle Enterprise Linux 5.1 (32-bit)", "Oracle Enterprise Linux 5.1"); | ||||
|     	_xcpGuestOsMap.put("Oracle Enterprise Linux 5.1 (64-bit)", "Oracle Enterprise Linux 5.1 x64"); | ||||
|     	_xcpGuestOsMap.put("Oracle Enterprise Linux 5.2 (32-bit)", "Oracle Enterprise Linux 5.2"); | ||||
|     	_xcpGuestOsMap.put("Oracle Enterprise Linux 5.2 (64-bit)", "Oracle Enterprise Linux 5.2 x64"); | ||||
|     	_xcpGuestOsMap.put("Oracle Enterprise Linux 5.3 (32-bit)", "Oracle Enterprise Linux 5.3"); | ||||
|     	_xcpGuestOsMap.put("Oracle Enterprise Linux 5.3 (64-bit)", "Oracle Enterprise Linux 5.3 x64"); | ||||
|     	_xcpGuestOsMap.put("Oracle Enterprise Linux 5.4 (32-bit)", "Oracle Enterprise Linux 5.4"); | ||||
|     	_xcpGuestOsMap.put("Oracle Enterprise Linux 5.4 (64-bit)", "Oracle Enterprise Linux 5.4 x64"); | ||||
|     	_xcpGuestOsMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", "Red Hat Enterprise Linux 4.5"); | ||||
|     	_xcpGuestOsMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", "Red Hat Enterprise Linux 4.6"); | ||||
|     	_xcpGuestOsMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", "Red Hat Enterprise Linux 4.7"); | ||||
|     	_xcpGuestOsMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", "Red Hat Enterprise Linux 4.8"); | ||||
|     	_xcpGuestOsMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", "Red Hat Enterprise Linux 5.0"); | ||||
|     	_xcpGuestOsMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", "Red Hat Enterprise Linux 5.0 x64"); | ||||
|     	_xcpGuestOsMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", "Red Hat Enterprise Linux 5.1"); | ||||
|     	_xcpGuestOsMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", "Red Hat Enterprise Linux 5.1 x64"); | ||||
|     	_xcpGuestOsMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", "Red Hat Enterprise Linux 5.2"); | ||||
|     	_xcpGuestOsMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", "Red Hat Enterprise Linux 5.2 x64"); | ||||
|     	_xcpGuestOsMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", "Red Hat Enterprise Linux 5.3"); | ||||
|     	_xcpGuestOsMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", "Red Hat Enterprise Linux 5.3 x64"); | ||||
|     	_xcpGuestOsMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", "Red Hat Enterprise Linux 5.4"); | ||||
|     	_xcpGuestOsMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", "Red Hat Enterprise Linux 5.4 x64"); | ||||
|     	_xcpGuestOsMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", "SUSE Linux Enterprise Server 9 SP4"); | ||||
|     	_xcpGuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", "SUSE Linux Enterprise Server 10 SP1"); | ||||
|     	_xcpGuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", "SUSE Linux Enterprise Server 10 SP1 x64"); | ||||
|     	_xcpGuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", "SUSE Linux Enterprise Server 10 SP2"); | ||||
|     	_xcpGuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", "SUSE Linux Enterprise Server 10 SP2 x64"); | ||||
|     	_xcpGuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", "Other install media"); | ||||
|     	_xcpGuestOsMap.put("SUSE Linux Enterprise Server 11 (32-bit)", "SUSE Linux Enterprise Server 11"); | ||||
|     	_xcpGuestOsMap.put("SUSE Linux Enterprise Server 11 (64-bit)", "SUSE Linux Enterprise Server 11 x64"); | ||||
|     	_xcpGuestOsMap.put("Windows 7 (32-bit)", "Windows 7"); | ||||
|     	_xcpGuestOsMap.put("Windows 7 (64-bit)", "Windows 7 x64"); | ||||
|     	_xcpGuestOsMap.put("Windows Server 2003 (32-bit)", "Windows Server 2003"); | ||||
|     	_xcpGuestOsMap.put("Windows Server 2003 (64-bit)", "Windows Server 2003 x64"); | ||||
|     	_xcpGuestOsMap.put("Windows Server 2008 (32-bit)", "Windows Server 2008"); | ||||
|     	_xcpGuestOsMap.put("Windows Server 2008 (64-bit)", "Windows Server 2008 x64"); | ||||
|     	_xcpGuestOsMap.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008 R2 x64"); | ||||
|     	_xcpGuestOsMap.put("Windows 2000 SP4 (32-bit)", "Windows 2000 SP4"); | ||||
|     	_xcpGuestOsMap.put("Windows Vista (32-bit)", "Windows Vista"); | ||||
|     	_xcpGuestOsMap.put("Windows XP SP2 (32-bit)", "Windows XP SP2"); | ||||
|     	_xcpGuestOsMap.put("Windows XP SP3 (32-bit)", "Windows XP SP3"); | ||||
|     	_xcpGuestOsMap.put("Other install media", "Other install media"); | ||||
|     } | ||||
|      | ||||
|     public static String getGuestOsType(String stdType) { | ||||
|         String guestOS =  _guestOsMap.get(stdType); | ||||
|     static { | ||||
|     	_xenServerGuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("CentOS 4.7 (32-bit)", "CentOS 4.7 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("CentOS 4.8 (32-bit)", "CentOS 4.8 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("CentOS 5.0 (32-bit)", "CentOS 5.0 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("CentOS 5.0 (64-bit)", "CentOS 5.0 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("CentOS 5.1 (32-bit)", "CentOS 5.1 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("CentOS 5.1 (64-bit)", "CentOS 5.1 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("CentOS 5.2 (32-bit)", "CentOS 5.2 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("CentOS 5.2 (64-bit)", "CentOS 5.2 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("CentOS 5.3 (32-bit)", "CentOS 5.3 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("CentOS 5.3 (64-bit)", "CentOS 5.3 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("CentOS 5.4 (32-bit)", "CentOS 5.4 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("CentOS 5.4 (64-bit)", "CentOS 5.4 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Debian GNU/Linux 5.0 (32-bit)", "Debian Lenny 5.0 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Oracle Enterprise Linux 5.0 (32-bit)", "Oracle Enterprise Linux 5.0 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Oracle Enterprise Linux 5.0 (64-bit)", "Oracle Enterprise Linux 5.0 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Oracle Enterprise Linux 5.1 (32-bit)", "Oracle Enterprise Linux 5.1 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Oracle Enterprise Linux 5.1 (64-bit)", "Oracle Enterprise Linux 5.1 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Oracle Enterprise Linux 5.2 (32-bit)", "Oracle Enterprise Linux 5.2 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Oracle Enterprise Linux 5.2 (64-bit)", "Oracle Enterprise Linux 5.2 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Oracle Enterprise Linux 5.3 (32-bit)", "Oracle Enterprise Linux 5.3 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Oracle Enterprise Linux 5.3 (64-bit)", "Oracle Enterprise Linux 5.3 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Oracle Enterprise Linux 5.4 (32-bit)", "Oracle Enterprise Linux 5.4 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Oracle Enterprise Linux 5.4 (64-bit)", "Oracle Enterprise Linux 5.4 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", "Red Hat Enterprise Linux 4.5 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", "Red Hat Enterprise Linux 4.6 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", "Red Hat Enterprise Linux 4.7 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", "Red Hat Enterprise Linux 4.8 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", "Red Hat Enterprise Linux 5.0 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", "Red Hat Enterprise Linux 5.0 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", "Red Hat Enterprise Linux 5.1 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", "Red Hat Enterprise Linux 5.1 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", "Red Hat Enterprise Linux 5.2 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", "Red Hat Enterprise Linux 5.2 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", "Red Hat Enterprise Linux 5.3 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", "Red Hat Enterprise Linux 5.3 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", "Red Hat Enterprise Linux 5.4 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", "Red Hat Enterprise Linux 5.4 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", "SUSE Linux Enterprise Server 9 SP4 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", "SUSE Linux Enterprise Server 10 SP1 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", "SUSE Linux Enterprise Server 10 SP1 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", "SUSE Linux Enterprise Server 10 SP2"); | ||||
|     	_xenServerGuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", "SUSE Linux Enterprise Server 10 SP2 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", "SUSE Linux Enterprise Server 10 SP3 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("SUSE Linux Enterprise Server 11 (32-bit)", "SUSE Linux Enterprise Server 11 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("SUSE Linux Enterprise Server 11 (64-bit)", "SUSE Linux Enterprise Server 11 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Windows 7 (32-bit)", "Windows 7 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Windows 7 (64-bit)", "Windows 7 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Windows Server 2003 (32-bit)", "Windows Server 2003 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Windows Server 2003 (64-bit)", "Windows Server 2003 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Windows Server 2008 (32-bit)", "Windows Server 2008 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Windows Server 2008 (64-bit)", "Windows Server 2008 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008 R2 (64-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Windows 2000 SP4 (32-bit)", "Windows 2000 SP4 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Windows Vista (32-bit)", "Windows Vista (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Windows XP SP2 (32-bit)", "Windows XP SP2 (32-bit)"); | ||||
|     	_xenServerGuestOsMap.put("Windows XP SP3 (32-bit)", "Windows XP SP3 (32-bit)"); | ||||
|     } | ||||
|      | ||||
|     public static String getXcpGuestOsType(String stdType) { | ||||
|         String guestOS =  _xcpGuestOsMap.get(stdType); | ||||
|         if (guestOS == null) { | ||||
|         	s_logger.debug("Can't find the guest os: " + stdType + " mapping into xenserver's guestOS type, start it as HVM guest"); | ||||
|         	guestOS = "Other install media"; | ||||
|         } | ||||
|         return guestOS; | ||||
|     } | ||||
|      | ||||
|     public static String getXenServerGuestOsType(String stdType) { | ||||
|         String guestOS =  _xenServerGuestOsMap.get(stdType); | ||||
|         if (guestOS == null) { | ||||
|         	s_logger.debug("Can't find the guest os: " + stdType + " mapping into xenserver's guestOS type, start it as HVM guest"); | ||||
|         	guestOS = "Other install media"; | ||||
|  | ||||
| @ -6229,7 +6229,8 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR | ||||
|         public String pool; | ||||
|     } | ||||
| 
 | ||||
|     /*Override by subclass*/ | ||||
| 	protected String getGuestOsType(String stdType) { | ||||
| 		return CitrixHelper.getGuestOsType(stdType); | ||||
| 		return stdType; | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @ -26,4 +26,9 @@ public class XcpServerResource extends CitrixResourceBase { | ||||
|     public XcpServerResource() { | ||||
|         super(); | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     protected String getGuestOsType(String stdType) { | ||||
|     	return CitrixHelper.getXcpGuestOsType(stdType); | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -39,7 +39,7 @@ public class XenServerResource extends CitrixResourceBase { | ||||
|      | ||||
|     @Override | ||||
|     protected String getGuestOsType(String stdType) { | ||||
|         return stdType; | ||||
|     	return CitrixHelper.getXenServerGuestOsType(stdType); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user