|
22 | 22 | * |
23 | 23 | */ |
24 | 24 | public class CitrixHelper { |
25 | | - private static final Logger s_logger = Logger.getLogger(CitrixHelper.class); |
26 | | - private static final HashMap<String, String> _xcp100GuestOsMap = new HashMap<String, String>(70); |
27 | | - private static final HashMap<String, String> _xenServerGuestOsMap = new HashMap<String, String>(70); |
28 | | - private static final HashMap<String, String> _xenServer56FP1GuestOsMap = new HashMap<String, String>(70); |
29 | | - private static final HashMap<String, String> _xenServer56FP2GuestOsMap = new HashMap<String, String>(70); |
30 | | - private static final HashMap<String, String> _xenServer600GuestOsMap = new HashMap<String, String>(70); |
31 | | - private static final ArrayList<String> _guestOsList = new ArrayList<String>(70); |
| 25 | + private static final Logger s_logger = Logger.getLogger(CitrixHelper.class); |
| 26 | + private static final HashMap<String, String> _xcp100GuestOsMap = new HashMap<String, String>(70); |
| 27 | + private static final HashMap<String, String> _xenServerGuestOsMap = new HashMap<String, String>(70); |
| 28 | + private static final HashMap<String, String> _xenServer56FP1GuestOsMap = new HashMap<String, String>(70); |
| 29 | + private static final HashMap<String, String> _xenServer56FP2GuestOsMap = new HashMap<String, String>(70); |
| 30 | + private static final HashMap<String, String> _xenServer600GuestOsMap = new HashMap<String, String>(70); |
| 31 | + private static final HashMap<String, String> _xenServer602GuestOsMap = new HashMap<String, String>(70); |
| 32 | + private static final ArrayList<String> _guestOsList = new ArrayList<String>(70); |
32 | 33 |
|
33 | 34 |
|
34 | 35 | static { |
@@ -433,6 +434,122 @@ public class CitrixHelper { |
433 | 434 | } |
434 | 435 |
|
435 | 436 |
|
| 437 | + static { |
| 438 | + _xenServer602GuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)"); |
| 439 | + _xenServer602GuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6 (32-bit)"); |
| 440 | + _xenServer602GuestOsMap.put("CentOS 4.7 (32-bit)", "CentOS 4.7 (32-bit)"); |
| 441 | + _xenServer602GuestOsMap.put("CentOS 4.8 (32-bit)", "CentOS 4.8 (32-bit)"); |
| 442 | + _xenServer602GuestOsMap.put("CentOS 5.0 (32-bit)", "CentOS 5 (32-bit)"); |
| 443 | + _xenServer602GuestOsMap.put("CentOS 5.0 (64-bit)", "CentOS 5 (64-bit)"); |
| 444 | + _xenServer602GuestOsMap.put("CentOS 5.1 (32-bit)", "CentOS 5 (32-bit)"); |
| 445 | + _xenServer602GuestOsMap.put("CentOS 5.1 (64-bit)", "CentOS 5 (64-bit)"); |
| 446 | + _xenServer602GuestOsMap.put("CentOS 5.2 (32-bit)", "CentOS 5 (32-bit)"); |
| 447 | + _xenServer602GuestOsMap.put("CentOS 5.2 (64-bit)", "CentOS 5 (64-bit)"); |
| 448 | + _xenServer602GuestOsMap.put("CentOS 5.3 (32-bit)", "CentOS 5 (32-bit)"); |
| 449 | + _xenServer602GuestOsMap.put("CentOS 5.3 (64-bit)", "CentOS 5 (64-bit)"); |
| 450 | + _xenServer602GuestOsMap.put("CentOS 5.4 (32-bit)", "CentOS 5 (32-bit)"); |
| 451 | + _xenServer602GuestOsMap.put("CentOS 5.4 (64-bit)", "CentOS 5 (64-bit)"); |
| 452 | + _xenServer602GuestOsMap.put("CentOS 5.5 (32-bit)", "CentOS 5 (32-bit)"); |
| 453 | + _xenServer602GuestOsMap.put("CentOS 5.5 (64-bit)", "CentOS 5 (64-bit)"); |
| 454 | + _xenServer602GuestOsMap.put("CentOS 5.6 (32-bit)", "CentOS 5 (32-bit)"); |
| 455 | + _xenServer602GuestOsMap.put("CentOS 5.6 (64-bit)", "CentOS 5 (64-bit)"); |
| 456 | + _xenServer602GuestOsMap.put("CentOS 5.7 (32-bit)", "CentOS 5 (32-bit)"); |
| 457 | + _xenServer602GuestOsMap.put("CentOS 5.7 (64-bit)", "CentOS 5 (64-bit)"); |
| 458 | + _xenServer602GuestOsMap.put("CentOS 6.0 (32-bit)", "CentOS 6.0 (32-bit)"); |
| 459 | + _xenServer602GuestOsMap.put("CentOS 6.0 (64-bit)", "CentOS 6.0 (64-bit)"); |
| 460 | + _xenServer602GuestOsMap.put("Debian GNU/Linux 5.0 (32-bit)", "Debian Lenny 5.0 (32-bit)"); |
| 461 | + _xenServer602GuestOsMap.put("Debian GNU/Linux 6(32-bit)", "Debian Squeeze 6.0 (32-bit)"); |
| 462 | + _xenServer602GuestOsMap.put("Debian GNU/Linux 6(64-bit)", "Debian Squeeze 6.0 (64-bit)"); |
| 463 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 5.0 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)"); |
| 464 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 5.0 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)"); |
| 465 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 5.1 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)"); |
| 466 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 5.1 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)"); |
| 467 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 5.2 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)"); |
| 468 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 5.2 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)"); |
| 469 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 5.3 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)"); |
| 470 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 5.3 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)"); |
| 471 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 5.4 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)"); |
| 472 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 5.4 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)"); |
| 473 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 5.5 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)"); |
| 474 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 5.5 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)"); |
| 475 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 5.6 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)"); |
| 476 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 5.6 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)"); |
| 477 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 5.7 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)"); |
| 478 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 5.7 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)"); |
| 479 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 6.0 (32-bit)", "Oracle Enterprise Linux 6.0 (32-bit)"); |
| 480 | + _xenServer602GuestOsMap.put("Oracle Enterprise Linux 6.0 (64-bit)", "Oracle Enterprise Linux 6.0 (64-bit)"); |
| 481 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", "Red Hat Enterprise Linux 4.5 (32-bit)"); |
| 482 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", "Red Hat Enterprise Linux 4.6 (32-bit)"); |
| 483 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", "Red Hat Enterprise Linux 4.7 (32-bit)"); |
| 484 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", "Red Hat Enterprise Linux 4.8 (32-bit)"); |
| 485 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)"); |
| 486 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)"); |
| 487 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)"); |
| 488 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)"); |
| 489 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)"); |
| 490 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)"); |
| 491 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)"); |
| 492 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)"); |
| 493 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)"); |
| 494 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)"); |
| 495 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)"); |
| 496 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)"); |
| 497 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)"); |
| 498 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)"); |
| 499 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)"); |
| 500 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)"); |
| 501 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", "Red Hat Enterprise Linux 6.0 (32-bit)"); |
| 502 | + _xenServer602GuestOsMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", "Red Hat Enterprise Linux 6.0 (64-bit)"); |
| 503 | + _xenServer602GuestOsMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", "SUSE Linux Enterprise Server 10 SP1 (32-bit)"); |
| 504 | + _xenServer602GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", "SUSE Linux Enterprise Server 10 SP1 (32-bit)"); |
| 505 | + _xenServer602GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", "SUSE Linux Enterprise Server 10 SP1 (64-bit)"); |
| 506 | + _xenServer602GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", "SUSE Linux Enterprise Server 10 SP2 (32-bit)"); |
| 507 | + _xenServer602GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", "SUSE Linux Enterprise Server 10 SP2 (64-bit)"); |
| 508 | + _xenServer602GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", "SUSE Linux Enterprise Server 10 SP3 (32-bit)"); |
| 509 | + _xenServer602GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", "SUSE Linux Enterprise Server 10 SP3 (64-bit)"); |
| 510 | + _xenServer602GuestOsMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", "SUSE Linux Enterprise Server 10 SP4 (32-bit)"); |
| 511 | + _xenServer602GuestOsMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", "SUSE Linux Enterprise Server 10 SP4 (64-bit)"); |
| 512 | + _xenServer602GuestOsMap.put("SUSE Linux Enterprise Server 11 (32-bit)", "SUSE Linux Enterprise Server 11 (32-bit)"); |
| 513 | + _xenServer602GuestOsMap.put("SUSE Linux Enterprise Server 11 (64-bit)", "SUSE Linux Enterprise Server 11 (64-bit)"); |
| 514 | + _xenServer602GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", "SUSE Linux Enterprise Server 11 SP1 (32-bit)"); |
| 515 | + _xenServer602GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", "SUSE Linux Enterprise Server 11 SP1 (64-bit)"); |
| 516 | + _xenServer602GuestOsMap.put("Windows 7 (32-bit)", "Windows 7 (32-bit)"); |
| 517 | + _xenServer602GuestOsMap.put("Windows 7 (64-bit)", "Windows 7 (64-bit)"); |
| 518 | + _xenServer602GuestOsMap.put("Windows 8 (32-bit)", "Windows 8 (32-bit) (experimental)"); |
| 519 | + _xenServer602GuestOsMap.put("Windows 8 (64-bit)", "Windows 7 (64-bit) (experimental)"); |
| 520 | + _xenServer602GuestOsMap.put("Windows Server 2003 (32-bit)", "Windows Server 2003 (32-bit)"); |
| 521 | + _xenServer602GuestOsMap.put("Windows Server 2003 (64-bit)", "Windows Server 2003 (64-bit)"); |
| 522 | + _xenServer602GuestOsMap.put("Windows Server 2003 PAE (32-bit)", "Windows Server 2003 PAE (32-bit)"); |
| 523 | + _xenServer602GuestOsMap.put("Windows Server 2003 Enterprise Edition(32-bit)", "Windows Server 2003 (32-bit)"); |
| 524 | + _xenServer602GuestOsMap.put("Windows Server 2003 Enterprise Edition(64-bit)", "Windows Server 2003 (64-bit)"); |
| 525 | + _xenServer602GuestOsMap.put("Windows Server 2003 DataCenter Edition(32-bit)", "Windows Server 2003 (32-bit)"); |
| 526 | + _xenServer602GuestOsMap.put("Windows Server 2003 DataCenter Edition(64-bit)", "Windows Server 2003 (64-bit)"); |
| 527 | + _xenServer602GuestOsMap.put("Windows Server 2003 Standard Edition(32-bit)", "Windows Server 2003 (32-bit)"); |
| 528 | + _xenServer602GuestOsMap.put("Windows Server 2003 Standard Edition(64-bit)", "Windows Server 2003 (64-bit)"); |
| 529 | + _xenServer602GuestOsMap.put("Windows Server 2008 (32-bit)", "Windows Server 2008 (32-bit)"); |
| 530 | + _xenServer602GuestOsMap.put("Windows Server 2008 (64-bit)", "Windows Server 2008 (64-bit)"); |
| 531 | + _xenServer602GuestOsMap.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008 R2 (64-bit)"); |
| 532 | + _xenServer602GuestOsMap.put("Windows Server 8 (64-bit)", "Windows Server 8 (64-bit) (experimental)"); |
| 533 | + _xenServer602GuestOsMap.put("Windows Vista (32-bit)", "Windows Vista (32-bit)"); |
| 534 | + _xenServer602GuestOsMap.put("Windows XP SP3 (32-bit)", "Windows XP SP3 (32-bit)"); |
| 535 | + _xenServer602GuestOsMap.put("Ubuntu 10.04 (32-bit)", "Ubuntu Lucid Lynx 10.04 (32-bit)"); |
| 536 | + _xenServer602GuestOsMap.put("Ubuntu 10.04 (64-bit)", "Ubuntu Lucid Lynx 10.04 (64-bit)"); |
| 537 | + _xenServer602GuestOsMap.put("Ubuntu 10.10 (32-bit)", "Ubuntu Maverick Meerkat 10.10 (32-bit) (experimental)"); |
| 538 | + _xenServer602GuestOsMap.put("Ubuntu 10.10 (64-bit)", "Ubuntu Maverick Meerkat 10.10 (64-bit) (experimental)"); |
| 539 | + _xenServer602GuestOsMap.put("Other Linux (32-bit)", "Other install media"); |
| 540 | + _xenServer602GuestOsMap.put("Other Linux (64-bit)", "Other install media"); |
| 541 | + _xenServer602GuestOsMap.put("Other (32-bit)", "Other install media"); |
| 542 | + _xenServer602GuestOsMap.put("Other (64-bit)", "Other install media"); |
| 543 | + _xenServer602GuestOsMap.put("Other CentOS (32-bit)", "Other install media"); |
| 544 | + _xenServer602GuestOsMap.put("Other CentOS (64-bit)", "Other install media"); |
| 545 | + _xenServer602GuestOsMap.put("Other Ubuntu (32-bit)", "Other install media"); |
| 546 | + _xenServer602GuestOsMap.put("Other Ubuntu (64-bit)", "Other install media"); |
| 547 | + _xenServer602GuestOsMap.put("Other SUSE Linux(32-bit)", "Other install media"); |
| 548 | + _xenServer602GuestOsMap.put("Other SUSE Linux(64-bit)", "Other install media"); |
| 549 | + _xenServer602GuestOsMap.put("Other PV (32-bit)", "CentOS 5 (32-bit)"); |
| 550 | + _xenServer602GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)"); |
| 551 | + } |
| 552 | + |
436 | 553 | public static String getXcpGuestOsType(String stdType) { |
437 | 554 | String guestOS = _xcp100GuestOsMap.get(stdType); |
438 | 555 | if (guestOS == null) { |
@@ -500,4 +617,19 @@ public static String getXenServer600GuestOsType(String stdType, boolean bootFrom |
500 | 617 | } |
501 | 618 | return guestOS; |
502 | 619 | } |
| 620 | + |
| 621 | + public static String getXenServer602GuestOsType(String stdType, boolean bootFromCD) { |
| 622 | + String guestOS = _xenServer602GuestOsMap.get(stdType); |
| 623 | + if (guestOS == null) { |
| 624 | + if (!bootFromCD) { |
| 625 | + s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 6.0.2 guestOS type, start it as HVM guest"); |
| 626 | + guestOS = "Other install media"; |
| 627 | + } else { |
| 628 | + String msg = "XenServer 6.0.2 DOES NOT support Guest OS type " + stdType; |
| 629 | + s_logger.warn(msg); |
| 630 | + } |
| 631 | + |
| 632 | + } |
| 633 | + return guestOS; |
| 634 | + } |
503 | 635 | } |
0 commit comments