From 2a66b0a43f958d627a963065c7de73581235c373 Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Wed, 3 Jul 2013 13:05:37 +0100 Subject: [PATCH] [CA-11044] & [CA-109243] Added new pool-join reasons and associated messages. These will cover the following two cases, for XenServer v6.2.0 and later: 1) a licensed host cannot be added to an unlicensed pool; 2) an unlicensed host cannot be added to a licensed pool. Signed-off-by: Mihaela Stoica --- XenModel/Messages.Designer.cs | 18 ++++++++++++++++++ XenModel/Messages.resx | 6 ++++++ XenModel/PoolJoinRules.cs | 14 ++++++++++++-- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index baacf9352..21bb5bf16 100644 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -20805,6 +20805,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to You cannot add a licensed server to an unlicensed pool. + /// + public static string NEWPOOL_LICENSED_HOST_UNLICENSED_MASTER { + get { + return ResourceManager.GetString("NEWPOOL_LICENSED_HOST_UNLICENSED_MASTER", resourceCulture); + } + } + /// /// Looks up a localized string similar to This server does not have the same XenServer license edition as the pool master. /// @@ -20877,6 +20886,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to You cannot add an unlicensed server to a licensed pool. + /// + public static string NEWPOOL_UNLICENSED_HOST_LICENSED_MASTER { + get { + return ResourceManager.GetString("NEWPOOL_UNLICENSED_HOST_LICENSED_MASTER", resourceCulture); + } + } + /// /// Looks up a localized string similar to NFS SR [{0}]. /// diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index da359450f..5dd965f06 100644 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -7121,6 +7121,9 @@ You should only proceed if you have verified that these settings are correct. This server is master of an existing pool + + You cannot add a licensed server to an unlicensed pool + This server does not have the same XenServer license edition as the pool master @@ -7145,6 +7148,9 @@ You should only proceed if you have verified that these settings are correct. Your current role on the slave is not authorized to add the slave to a pool + + You cannot add an unlicensed server to a licensed pool + NFS SR [{0}] diff --git a/XenModel/PoolJoinRules.cs b/XenModel/PoolJoinRules.cs index d3075b0e7..adbafc1f0 100644 --- a/XenModel/PoolJoinRules.cs +++ b/XenModel/PoolJoinRules.cs @@ -58,6 +58,8 @@ namespace XenAdmin.Core NotSameLinuxPack, PaidHostFreeMaster, FreeHostPaidMaster, + LicensedHostUnlicensedMaster, + UnlicensedHostLicensedMaster, LicenseMismatch, DifferentServerVersion, DifferentCPUs, @@ -116,10 +118,14 @@ namespace XenAdmin.Core return Reason.DifferentServerVersion; if (FreeHostPaidMaster(slaveHost, masterHost, allowLicenseUpgrade)) - return Reason.FreeHostPaidMaster; + return Helpers.ClearwaterOrGreater(masterHost) ? + Reason.UnlicensedHostLicensedMaster : + Reason.FreeHostPaidMaster; if (PaidHostFreeMaster(slaveHost, masterHost)) - return Reason.PaidHostFreeMaster; + return Helpers.ClearwaterOrGreater(masterHost) ? + Reason.LicensedHostUnlicensedMaster : + Reason.PaidHostFreeMaster; if (LicenseMismatch(slaveHost, masterHost)) return Reason.LicenseMismatch; @@ -178,6 +184,10 @@ namespace XenAdmin.Core return Messages.NEWPOOL_PAID_HOST_FREE_MASTER; case Reason.FreeHostPaidMaster: return Messages.NEWPOOL_FREE_HOST_PAID_MASTER; + case Reason.LicensedHostUnlicensedMaster: + return Messages.NEWPOOL_LICENSED_HOST_UNLICENSED_MASTER; + case Reason.UnlicensedHostLicensedMaster: + return Messages.NEWPOOL_UNLICENSED_HOST_LICENSED_MASTER; case Reason.LicenseMismatch: return Messages.NEWPOOL_LICENSEMISMATCH; case Reason.DifferentServerVersion: