mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
CP-17690: Block RPU for clusters with the hci-forbid-rpu flag (disable the relevant pools/hosts on the select pool page; do not launch the RPU wizard at all if there are no upgradable clusters).
This commit is contained in:
parent
b5199573bc
commit
b575fd3d44
@ -64,10 +64,14 @@ namespace XenAdmin.Commands
|
||||
{
|
||||
foreach (IXenConnection xenConnection in ConnectionsManager.XenConnectionsCopy)
|
||||
{
|
||||
if (xenConnection.IsConnected)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!xenConnection.IsConnected)
|
||||
continue;
|
||||
|
||||
var pool = Helpers.GetPoolOfOne(xenConnection);
|
||||
if (pool != null && pool.IsUpgradeForbidden)
|
||||
continue;
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -189,17 +189,18 @@ namespace XenAdmin.Wizards.RollingUpgradeWizard
|
||||
dataGridView1.Rows.Clear();
|
||||
List<IXenConnection> xenConnections = ConnectionsManager.XenConnectionsCopy;
|
||||
xenConnections.Sort();
|
||||
var currentVersion = Program.VersionThreePart;
|
||||
|
||||
foreach (IXenConnection xenConnection in xenConnections)
|
||||
{
|
||||
Pool pool = Helpers.GetPool(xenConnection);
|
||||
Pool poolOfOne = Helpers.GetPoolOfOne(xenConnection);
|
||||
|
||||
bool hasPool = true;
|
||||
if (pool != null)
|
||||
{
|
||||
int index = dataGridView1.Rows.Add(new UpgradeDataGridViewRow(pool));
|
||||
|
||||
if (IsNotAnUpgradeableVersion(pool.SmallerVersionHost) && !pool.RollingUpgrade)
|
||||
if ((IsNotAnUpgradeableVersion(pool.SmallerVersionHost) && !pool.RollingUpgrade) || pool.IsUpgradeForbidden)
|
||||
((DataGridViewExRow)dataGridView1.Rows[index]).Enabled = false;
|
||||
else if (masters.Contains(pool.Connection.Resolve(pool.master)))
|
||||
dataGridView1.CheckBoxChange(index, 1);
|
||||
@ -208,12 +209,13 @@ namespace XenAdmin.Wizards.RollingUpgradeWizard
|
||||
{
|
||||
hasPool = false;
|
||||
}
|
||||
|
||||
Host[] hosts = xenConnection.Cache.Hosts;
|
||||
Array.Sort(hosts);
|
||||
foreach (Host host in hosts)
|
||||
{
|
||||
int index = dataGridView1.Rows.Add(new UpgradeDataGridViewRow(host, hasPool));
|
||||
if (IsNotAnUpgradeableVersion(host))
|
||||
if (IsNotAnUpgradeableVersion(host) || (poolOfOne != null && poolOfOne.IsUpgradeForbidden))
|
||||
((DataGridViewExRow)dataGridView1.Rows[index]).Enabled = false;
|
||||
else if (!hasPool && masters.Contains(host))
|
||||
dataGridView1.CheckBoxChange(index, 1);
|
||||
|
@ -140,7 +140,8 @@ namespace XenAPI
|
||||
}
|
||||
}
|
||||
|
||||
private const String ROLLING_UPGRADE_IN_PROGRESS = "rolling_upgrade_in_progress";
|
||||
private const string ROLLING_UPGRADE_IN_PROGRESS = "rolling_upgrade_in_progress";
|
||||
private const string FORBID_RPU_FOR_HCI = "hci-forbid-rpu";
|
||||
|
||||
public bool RollingUpgrade
|
||||
{
|
||||
@ -150,6 +151,14 @@ namespace XenAPI
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsUpgradeForbidden
|
||||
{
|
||||
get
|
||||
{
|
||||
return other_config != null && other_config.ContainsKey(FORBID_RPU_FOR_HCI);
|
||||
}
|
||||
}
|
||||
|
||||
public static Dictionary<string, string> retrieve_wlb_default_configuration(Session session)
|
||||
{
|
||||
return Maps.convert_from_proxy_string_string(session.proxy.pool_retrieve_wlb_configuration("default").parse());
|
||||
|
Loading…
Reference in New Issue
Block a user