|
28 | 28 | public class CitrixHelper { |
29 | 29 | private static final Logger s_logger = Logger.getLogger(CitrixHelper.class); |
30 | 30 | private static final HashMap<String, String> _xcp100GuestOsMap = new HashMap<String, String>(70); |
| 31 | + private static final HashMap<String, String> _xcp160GuestOsMap = new HashMap<String, String>(70); |
31 | 32 | private static final HashMap<String, String> _xenServerGuestOsMap = new HashMap<String, String>(70); |
32 | 33 | private static final HashMap<String, String> _xenServer56FP1GuestOsMap = new HashMap<String, String>(70); |
33 | 34 | private static final HashMap<String, String> _xenServer56FP2GuestOsMap = new HashMap<String, String>(70); |
@@ -114,6 +115,83 @@ public class CitrixHelper { |
114 | 115 | _xcp100GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)"); |
115 | 116 | } |
116 | 117 |
|
| 118 | + static { |
| 119 | + _xcp160GuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)"); |
| 120 | + _xcp160GuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6 (32-bit)"); |
| 121 | + _xcp160GuestOsMap.put("CentOS 4.7 (32-bit)", "CentOS 4.7 (32-bit)"); |
| 122 | + _xcp160GuestOsMap.put("CentOS 4.8 (32-bit)", "CentOS 4.8 (32-bit)"); |
| 123 | + _xcp160GuestOsMap.put("CentOS 5.0 (32-bit)", "CentOS 5 (32-bit)"); |
| 124 | + _xcp160GuestOsMap.put("CentOS 5.0 (64-bit)", "CentOS 5 (64-bit)"); |
| 125 | + _xcp160GuestOsMap.put("CentOS 5.1 (32-bit)", "CentOS 5 (32-bit)"); |
| 126 | + _xcp160GuestOsMap.put("CentOS 5.1 (64-bit)", "CentOS 5 (64-bit)"); |
| 127 | + _xcp160GuestOsMap.put("CentOS 5.2 (32-bit)", "CentOS 5 (32-bit)"); |
| 128 | + _xcp160GuestOsMap.put("CentOS 5.2 (64-bit)", "CentOS 5 (64-bit)"); |
| 129 | + _xcp160GuestOsMap.put("CentOS 5.3 (32-bit)", "CentOS 5 (32-bit)"); |
| 130 | + _xcp160GuestOsMap.put("CentOS 5.3 (64-bit)", "CentOS 5 (64-bit)"); |
| 131 | + _xcp160GuestOsMap.put("CentOS 5.4 (32-bit)", "CentOS 5 (32-bit)"); |
| 132 | + _xcp160GuestOsMap.put("CentOS 5.4 (64-bit)", "CentOS 5 (64-bit)"); |
| 133 | + _xcp160GuestOsMap.put("CentOS 5.5 (32-bit)", "CentOS 5 (32-bit)"); |
| 134 | + _xcp160GuestOsMap.put("CentOS 5.5 (64-bit)", "CentOS 5 (64-bit)"); |
| 135 | + _xcp160GuestOsMap.put("Debian GNU/Linux 5.0 (32-bit)", "Debian Lenny 5.0 (32-bit)"); |
| 136 | + _xcp160GuestOsMap.put("Debian GNU/Linux 6(32-bit)", "Debian Squeeze 6.0 (32-bit)"); |
| 137 | + _xcp160GuestOsMap.put("Debian GNU/Linux 6(64-bit)", "Debian Squeeze 6.0 (64-bit)"); |
| 138 | + _xcp160GuestOsMap.put("Oracle Enterprise Linux 5.0 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)"); |
| 139 | + _xcp160GuestOsMap.put("Oracle Enterprise Linux 5.0 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)"); |
| 140 | + _xcp160GuestOsMap.put("Oracle Enterprise Linux 5.1 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)"); |
| 141 | + _xcp160GuestOsMap.put("Oracle Enterprise Linux 5.1 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)"); |
| 142 | + _xcp160GuestOsMap.put("Oracle Enterprise Linux 5.2 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)"); |
| 143 | + _xcp160GuestOsMap.put("Oracle Enterprise Linux 5.2 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)"); |
| 144 | + _xcp160GuestOsMap.put("Oracle Enterprise Linux 5.3 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)"); |
| 145 | + _xcp160GuestOsMap.put("Oracle Enterprise Linux 5.3 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)"); |
| 146 | + _xcp160GuestOsMap.put("Oracle Enterprise Linux 5.4 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)"); |
| 147 | + _xcp160GuestOsMap.put("Oracle Enterprise Linux 5.4 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)"); |
| 148 | + _xcp160GuestOsMap.put("Oracle Enterprise Linux 5.5 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)"); |
| 149 | + _xcp160GuestOsMap.put("Oracle Enterprise Linux 5.5 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)"); |
| 150 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", "Red Hat Enterprise Linux 4.5 (32-bit)"); |
| 151 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", "Red Hat Enterprise Linux 4.6 (32-bit)"); |
| 152 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", "Red Hat Enterprise Linux 4.7 (32-bit)"); |
| 153 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", "Red Hat Enterprise Linux 4.8 (32-bit)"); |
| 154 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)"); |
| 155 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)"); |
| 156 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)"); |
| 157 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)"); |
| 158 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)"); |
| 159 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)"); |
| 160 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)"); |
| 161 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)"); |
| 162 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)"); |
| 163 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)"); |
| 164 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)"); |
| 165 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)"); |
| 166 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)"); |
| 167 | + _xcp160GuestOsMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)"); |
| 168 | + _xcp160GuestOsMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", "SUSE Linux Enterprise Server 9 SP4"); |
| 169 | + _xcp160GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", "SUSE Linux Enterprise Server 10 SP1"); |
| 170 | + _xcp160GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", "SUSE Linux Enterprise Server 10 SP1 x64"); |
| 171 | + _xcp160GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", "SUSE Linux Enterprise Server 10 SP2"); |
| 172 | + _xcp160GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", "SUSE Linux Enterprise Server 10 SP2 x64"); |
| 173 | + _xcp160GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", "Other install media"); |
| 174 | + _xcp160GuestOsMap.put("SUSE Linux Enterprise Server 11 (32-bit)", "SUSE Linux Enterprise Server 11"); |
| 175 | + _xcp160GuestOsMap.put("SUSE Linux Enterprise Server 11 (64-bit)", "SUSE Linux Enterprise Server 11 x64"); |
| 176 | + _xcp160GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", "SUSE Linux Enterprise Server 11 SP1 (32-bit)"); |
| 177 | + _xcp160GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", "SUSE Linux Enterprise Server 11 SP1 (64-bit)"); |
| 178 | + _xcp160GuestOsMap.put("Windows 7 (32-bit)", "Windows 7 (32-bit)"); |
| 179 | + _xcp160GuestOsMap.put("Windows 7 (64-bit)", "Windows 7 (64-bit)"); |
| 180 | + _xcp160GuestOsMap.put("Windows Server 2003 (32-bit)", "Windows Server 2003 (32-bit)"); |
| 181 | + _xcp160GuestOsMap.put("Windows Server 2003 (64-bit)", "Windows Server 2003 (64-bit)"); |
| 182 | + _xcp160GuestOsMap.put("Windows Server 2008 (32-bit)", "Windows Server 2008 (32-bit)"); |
| 183 | + _xcp160GuestOsMap.put("Windows Server 2008 (64-bit)", "Windows Server 2008 (64-bit)"); |
| 184 | + _xcp160GuestOsMap.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008 R2 (64-bit)"); |
| 185 | + _xcp160GuestOsMap.put("Windows XP SP3 (32-bit)", "Windows XP SP3 (32-bit)"); |
| 186 | + _xcp160GuestOsMap.put("Windows Vista (32-bit)", "Windows Vista (32-bit)"); |
| 187 | + _xcp160GuestOsMap.put("Ubuntu 10.04 (32-bit)", "Ubuntu Lucid Lynx 10.04 (32-bit) (experimental)"); |
| 188 | + _xcp160GuestOsMap.put("Ubuntu 10.04 (64-bit)", "Ubuntu Lucid Lynx 10.04 (64-bit) (experimental)"); |
| 189 | + _xcp160GuestOsMap.put("Other Linux (32-bit)", "Other install media"); |
| 190 | + _xcp160GuestOsMap.put("Other Linux (64-bit)", "Other install media"); |
| 191 | + _xcp160GuestOsMap.put("Other PV (32-bit)", "CentOS 5 (32-bit)"); |
| 192 | + _xcp160GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)"); |
| 193 | + } |
| 194 | + |
117 | 195 |
|
118 | 196 | static { |
119 | 197 | _xenServerGuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)"); |
@@ -693,6 +771,15 @@ public static String getXcpGuestOsType(String stdType) { |
693 | 771 | return guestOS; |
694 | 772 | } |
695 | 773 |
|
| 774 | + public static String getXcp160GuestOsType(String stdType) { |
| 775 | + String guestOS = _xcp160GuestOsMap.get(stdType); |
| 776 | + if (guestOS == null) { |
| 777 | + s_logger.debug("Can't find the guest os: " + stdType + " mapping into XCP's guestOS type, start it as HVM guest"); |
| 778 | + guestOS = "Other install media"; |
| 779 | + } |
| 780 | + return guestOS; |
| 781 | + } |
| 782 | + |
696 | 783 |
|
697 | 784 | public static String getXenServerGuestOsType(String stdType, boolean bootFromCD) { |
698 | 785 | String guestOS = _xenServerGuestOsMap.get(stdType); |
|
0 commit comments