From 23e0b2ce29b6700897af7f0544f25cd464ac40e0 Mon Sep 17 00:00:00 2001 From: edison Date: Thu, 30 Sep 2010 18:08:15 -0700 Subject: [PATCH] bug 6365: xenserver and xcp need different guest os mapper status 6365: resolved fixed --- .../hypervisor/xen/resource/CitrixHelper.java | 197 ++++++++++++------ .../xen/resource/CitrixResourceBase.java | 3 +- .../xen/resource/XcpServerResource.java | 5 + .../xen/resource/XenServerResource.java | 2 +- 4 files changed, 142 insertions(+), 65 deletions(-) diff --git a/core/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java b/core/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java index 9d1c0facbba..e1f0ca9baa1 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java +++ b/core/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java @@ -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 _guestOsMap = new HashMap(70); - private static final ArrayList _guestOsList = new ArrayList(70); + private static final HashMap _xcpGuestOsMap = new HashMap(70); + private static final HashMap _xenServerGuestOsMap = new HashMap(70); + private static final ArrayList _guestOsList = new ArrayList(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"; diff --git a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index 11159052615..a821b386c14 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -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; } } diff --git a/core/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java b/core/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java index 090ad36fc78..2d4da33ee23 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java +++ b/core/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java @@ -26,4 +26,9 @@ public class XcpServerResource extends CitrixResourceBase { public XcpServerResource() { super(); } + + @Override + protected String getGuestOsType(String stdType) { + return CitrixHelper.getXcpGuestOsType(stdType); + } } diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServerResource.java b/core/src/com/cloud/hypervisor/xen/resource/XenServerResource.java index 713b3e6c3ae..a0668f1a00c 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/XenServerResource.java +++ b/core/src/com/cloud/hypervisor/xen/resource/XenServerResource.java @@ -39,7 +39,7 @@ public class XenServerResource extends CitrixResourceBase { @Override protected String getGuestOsType(String stdType) { - return stdType; + return CitrixHelper.getXenServerGuestOsType(stdType); } @Override