CA-338830: Pool join checks should not allow slave with enabled clustering to join.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2020-05-10 00:45:36 +01:00 committed by Mihaela Stoica
parent 8a478011d9
commit fc9d617f27
3 changed files with 20 additions and 5 deletions

View File

@ -25411,6 +25411,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Clustering is enabled on this server..
/// </summary>
public static string NEW_POOL_CLUSTERING_ENABLED {
get {
return ResourceManager.GetString("NEW_POOL_CLUSTERING_ENABLED", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You are attempting to add the server &apos;{0}&apos; to a pool with a master that is using an older CPU.
///

View File

@ -8793,6 +8793,9 @@ You should only proceed if you have verified that these settings are correct.</v
<data name="NEWNETWORK_VNAME" xml:space="preserve">
<value>New Private Network</value>
</data>
<data name="NEW_POOL_CLUSTERING_ENABLED" xml:space="preserve">
<value>Clustering is enabled on this server.</value>
</data>
<data name="NEWPOOL_DIFFERENT_HOMOGENEOUS_UPDATES_FROM_MASTER" xml:space="preserve">
<value>This server has different updates from the master</value>
</data>

View File

@ -71,6 +71,7 @@ namespace XenAdmin.Core
NonCompatibleManagementInterface,
WrongRoleOnMaster,
WrongRoleOnSlave,
HasClusteringEnabled,
WrongNumberOfIpsCluster,
WrongNumberOfIpsBond,
NotConnected,
@ -168,11 +169,11 @@ namespace XenAdmin.Core
if (!Helpers.FeatureForbidden(slaveConnection, Host.RestrictManagementOnVLAN) && !HasCompatibleManagementInterface(slaveConnection))
return Reason.NonCompatibleManagementInterface;
bool clusterHostInBond;
if (!HasIpForClusterNetwork(masterConnection, slaveHost, out clusterHostInBond))
{
return clusterHostInBond ? Reason.WrongNumberOfIpsBond : Reason.WrongNumberOfIpsCluster;
}
if (slaveHost?.Connection?.Cache.Clusters.FirstOrDefault() != null)
return Reason.HasClusteringEnabled;
if (!HasIpForClusterNetwork(masterConnection, slaveHost, out var clusterHostInBond))
return clusterHostInBond ? Reason.WrongNumberOfIpsBond : Reason.WrongNumberOfIpsCluster;
return Reason.Allowed;
}
@ -235,6 +236,8 @@ namespace XenAdmin.Core
return Messages.NEWPOOL_MASTER_ROLE;
case Reason.WrongRoleOnSlave:
return Messages.NEWPOOL_SLAVE_ROLE;
case Reason.HasClusteringEnabled:
return Messages.NEW_POOL_CLUSTERING_ENABLED;
case Reason.WrongNumberOfIpsCluster:
return Messages.NEWPOOL_IP_COUNT_CLUSTER;
case Reason.WrongNumberOfIpsBond: