CP-43102: Removed Dundee code.

The check DundeeOrGreater always returns true since we disallow connection to anything earlier than Havana.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2023-05-10 14:50:52 +01:00 committed by Konstantina Chremmou
parent 26e4731b46
commit 82940850e9
31 changed files with 79 additions and 241 deletions

View File

@ -71,7 +71,7 @@ namespace XenAdmin.Commands
var reasons = new Dictionary<IXenObject, string>();
foreach (Host host in _hosts)
{
PoolJoinRules.Reason reason = PoolJoinRules.CanJoinPool(host.Connection, _pool.Connection, true, true, true, _hosts.Count);
PoolJoinRules.Reason reason = PoolJoinRules.CanJoinPool(host.Connection, _pool.Connection, true, true, _hosts.Count);
if (reason != PoolJoinRules.Reason.Allowed)
reasons[host] = PoolJoinRules.ReasonMessage(reason);
}
@ -135,7 +135,7 @@ namespace XenAdmin.Commands
// If so, we need to show upsell.
Host coordinator = Helpers.GetCoordinator(_pool);
if (null != _hosts.Find(host =>
!PoolJoinRules.CompatibleCPUs(host, coordinator, false) &&
!PoolJoinRules.CompatibleCPUs(host, coordinator) &&
Helpers.FeatureForbidden(host, Host.RestrictCpuMasking) &&
!PoolJoinRules.FreeHostPaidCoordinator(host, coordinator, false))) // in this case we can upgrade the license and then mask the CPU
{
@ -168,7 +168,7 @@ namespace XenAdmin.Commands
}
}
var hosts2 = _hosts.FindAll(host => !PoolJoinRules.CompatibleCPUs(host, coordinator, false));
var hosts2 = _hosts.FindAll(host => !PoolJoinRules.CompatibleCPUs(host, coordinator));
if (hosts2.Count > 0)
{
string msg = string.Format(hosts2.Count == 1
@ -210,7 +210,7 @@ namespace XenAdmin.Commands
foreach (Host host in _hosts)
{
string opaque_ref = host.opaque_ref;
var action = new AddHostToPoolAction(_pool, host, GetAdPrompt, NtolDialog,
var action = new AddHostToPoolAction(_pool, host, GetAdPrompt,
(licenseFailures, exceptionMessage) =>
{
if (licenseFailures.Count > 0)

View File

@ -66,7 +66,7 @@ namespace XenAdmin.Commands
{
foreach (Host draggedHost in draggedHosts)
{
PoolJoinRules.Reason reason = PoolJoinRules.CanJoinPool(draggedHost.Connection, targetPool.Connection, true, true, true, draggedHosts.Count);
PoolJoinRules.Reason reason = PoolJoinRules.CanJoinPool(draggedHost.Connection, targetPool.Connection, true, true, draggedHosts.Count);
if (reason != PoolJoinRules.Reason.Allowed)
{
string reasonString = PoolJoinRules.ReasonMessage(reason);

View File

@ -83,8 +83,6 @@ namespace XenAdmin.Commands
if(vdi.Connection.ResolveAll(vdi.VBDs).Count == 0)
return false;
if (vdi.GetVMs().Any(vm => !vm.IsRunning()) && !Helpers.DundeeOrGreater(vdi.Connection))
return false;
SR sr = vdi.Connection.Resolve(vdi.SR);
if (sr == null || sr.HBALunPerVDI())
@ -111,8 +109,6 @@ namespace XenAdmin.Commands
return Messages.CANNOT_MOVE_CBT_ENABLED_VDI;
if (vdi.IsMetadataForDR())
return Messages.CANNOT_MOVE_DR_VD;
if (vdi.GetVMs().Any(vm => !vm.IsRunning()) && !Helpers.DundeeOrGreater(vdi.Connection))
return Messages.CANNOT_MIGRATE_VDI_NON_RUNNING_VM;
SR sr = vdi.Connection.Resolve(vdi.SR);
if (sr == null)

View File

@ -169,17 +169,6 @@ namespace XenAdmin.Commands
public static bool VmCpuIncompatibleWithHost(Host targetHost, VM vm)
{
// check the CPU compatibility for Dundee and higher hosts
if (!Helpers.DundeeOrGreater(targetHost))
return false;
Host home = vm.Home();
if (home != null && !Helpers.DundeeOrGreater(home))
return false;
if (home == null && !Helpers.DundeeOrGreater(vm.Connection))
return false;
// only for running or suspended VMs
if (vm.power_state != vm_power_state.Running && vm.power_state != vm_power_state.Suspended)
return false;

View File

@ -112,7 +112,7 @@ namespace XenAdmin.Controls
internal void Refresh()
{
reason = PoolJoinRules.CanJoinPool(Connection, coordinatorConnection, true, true, true);
reason = PoolJoinRules.CanJoinPool(Connection, coordinatorConnection, true, true);
this.Description = PoolJoinRules.ReasonMessage(reason);
this.Enabled = (reason == PoolJoinRules.Reason.Allowed);
this.CheckedIfdisabled = (reason == PoolJoinRules.Reason.WillBeCoordinator);

View File

@ -481,7 +481,7 @@ namespace XenAdmin.Core
public static bool GetPermissionForCpuFeatureLevelling(List<Host> hosts, Pool pool)
{
if (hosts == null || pool == null || !Helpers.DundeeOrGreater(pool.Connection))
if (hosts == null || pool == null)
return true;
List<Host> hostsWithFewerFeatures = hosts.Where(host => PoolJoinRules.HostHasFewerFeatures(host, pool)).ToList();

View File

@ -237,7 +237,7 @@ namespace XenAdmin.Diagnostics.Checks
var gm = vm.Connection.Resolve(vm.guest_metrics);
var status = vm.GetVirtualisationStatus(out _);
if (Helpers.DundeeOrGreater(vm.Connection) && vm.IsWindows())
if (vm.IsWindows())
{
if (gm != null && !gm.PV_drivers_detected)
{

View File

@ -77,7 +77,7 @@ namespace XenAdmin.Diagnostics.Checks
{
foreach (var host2 in pool.Connection.Cache.Hosts.Where(h => h.uuid != host1.uuid))
{
if (!PoolJoinRules.CompatibleCPUs(host1, host2, false))
if (!PoolJoinRules.CompatibleCPUs(host1, host2))
return true;
}
}

View File

@ -48,7 +48,7 @@ namespace XenAdmin.Diagnostics.Checks
protected override Problem RunHostCheck()
{
if (_pool != null && _pool.Connection.Cache.Hosts.Any(h => Helpers.DundeeOrGreater(h) && Host.RestrictBatchHotfixApply(h)))
if (_pool != null && _pool.Connection.Cache.Hosts.Any(Host.RestrictBatchHotfixApply))
return new NotLicensedForAutomatedUpdatesWarning(this, _pool);
return null;

View File

@ -163,7 +163,7 @@ namespace XenAdmin.Dialogs
// Are there any hosts which are forbidden from masking their CPUs for licensing reasons?
// If so, we need to show upsell.
if (null != supporters.Find(host =>
!PoolJoinRules.CompatibleCPUs(host, coordinator, false) &&
!PoolJoinRules.CompatibleCPUs(host, coordinator) &&
Helpers.FeatureForbidden(host, Host.RestrictCpuMasking) &&
!PoolJoinRules.FreeHostPaidCoordinator(host, coordinator, false))) // in this case we can upgrade the license and then mask the CPU
{
@ -189,7 +189,7 @@ namespace XenAdmin.Dialogs
}
}
var hosts2 = supporters.FindAll(host => !PoolJoinRules.CompatibleCPUs(host, coordinator, false));
var hosts2 = supporters.FindAll(host => !PoolJoinRules.CompatibleCPUs(host, coordinator));
if (hosts2.Count > 0)
{
string msg = string.Format(hosts2.Count == 1
@ -233,7 +233,6 @@ namespace XenAdmin.Dialogs
);
new CreatePoolAction(coordinator, supporters, poolName, poolDescription, AddHostToPoolCommand.GetAdPrompt,
AddHostToPoolCommand.NtolDialog,
(licenseFailures, exceptionMessage) =>
{
if (licenseFailures.Count > 0)

View File

@ -77,9 +77,8 @@ namespace XenAdmin
bool popupLicenseMgr = HiddenFeatures.LicenseNagVisible;
// If the host is Dundee or greater, then the license alerts are generated by the server, so XenCenter shouldn't create any license alerts
bool createAlert = !Helpers.DundeeOrGreater(connection);
if (!popupLicenseMgr && !createAlert)
if (!popupLicenseMgr)
return false;
DateTime now = DateTime.UtcNow - connection.ServerTimeOffset;
@ -91,7 +90,7 @@ namespace XenAdmin
if (expiryDate < now)
{
// License has expired. Pop up the License Manager.
Program.Invoke(Program.MainWindow, () => showLicenseSummaryExpired(host, now, expiryDate, createAlert, popupLicenseMgr));
Program.Invoke(Program.MainWindow, () => showLicenseSummaryExpired(host, now, expiryDate, false, popupLicenseMgr));
return true;
}
if (timeToExpiry < CONNECTION_WARN_THRESHOLD &&
@ -101,7 +100,7 @@ namespace XenAdmin
// If it's a periodic check, only warn if XC has been open for one day
if (periodicCheck)
lastPeriodicLicenseWarning = DateTime.UtcNow;
Program.Invoke(Program.MainWindow, () => showLicenseSummaryWarning(Helpers.GetName(host), now, expiryDate, createAlert, popupLicenseMgr));
Program.Invoke(Program.MainWindow, () => showLicenseSummaryWarning(Helpers.GetName(host), now, expiryDate, false, popupLicenseMgr));
return true;
}
}

View File

@ -916,7 +916,7 @@ namespace XenAdmin
var supporters = connection.Cache.Hosts.Where(h => h.opaque_ref != coordinator.opaque_ref);
foreach (var supporter in supporters)
{
if (Helpers.DundeeOrGreater(supporter))
if (Helpers.HavanaOrGreater(supporter))
continue;
connection.EndConnect();

View File

@ -81,23 +81,20 @@ namespace XenAdmin.SettingsPanels
private void InitializeControls()
{
_loading = true;
try
{
trackbarCPUPriority.Value = GetSafeTrackbarValue(trackbarCPUPriority, _poolConfiguration.VmCpuUtilizationWeightHigh / TRACKBAR_INTERVAL);
trackbarMemoryPriority.Value = GetSafeTrackbarValue(trackbarMemoryPriority, _poolConfiguration.VmMemoryWeightHigh / TRACKBAR_INTERVAL);
trackbarNetReadPriority.Value = GetSafeTrackbarValue(trackbarNetReadPriority, _poolConfiguration.VmNetworkReadWeightHigh / TRACKBAR_INTERVAL);
trackbarNetWritePriority.Value = GetSafeTrackbarValue(trackbarNetWritePriority, _poolConfiguration.VmNetworkWriteWeightHigh / TRACKBAR_INTERVAL);
trackbarDiskReadPriority.Value = GetSafeTrackbarValue(trackbarDiskReadPriority, _poolConfiguration.VmDiskReadWeightHigh / TRACKBAR_INTERVAL);
trackbarDiskWritePriority.Value = GetSafeTrackbarValue(trackbarDiskWritePriority, _poolConfiguration.VmDiskWriteWeightHigh / TRACKBAR_INTERVAL);
// CA-194940:
// Host disk read/write threshold and weight settings work since Dundee.
// For previous XenServer, hide the host disk read/write settings.
if (!Helpers.DundeeOrGreater(_connection))
{
trackbarDiskReadPriority.Visible = false;
trackbarDiskWritePriority.Visible = false;
label10.Visible = false;
label11.Visible = false;
}
_loading = false; ;
finally
{
_loading = false;
}
}
private void trackbarValueChanged(object sender, EventArgs e)

View File

@ -81,12 +81,15 @@ namespace XenAdmin.SettingsPanels
private void InitializeControls()
{
_loading = true;
try
{
updownCPUCriticalPoint.Value = GetSafeUpDownValue(_poolConfiguration.HostCpuThresholdCritical, updownCPUCriticalPoint);
updownMemoryCriticalPoint.Value = GetSafeUpDownValue(WlbPoolConfiguration.ConvertToMB(_poolConfiguration.HostMemoryThresholdCritical), updownMemoryCriticalPoint);
updownDiskReadCriticalPoint.Value = GetSafeUpDownValue(WlbPoolConfiguration.ConvertToMB(_poolConfiguration.HostDiskReadThresholdCritical), updownDiskReadCriticalPoint);
updownDiskWriteCriticalPoint.Value = GetSafeUpDownValue(WlbPoolConfiguration.ConvertToMB(_poolConfiguration.HostDiskWriteThresholdCritical), updownDiskWriteCriticalPoint);
updownNetworkReadCriticalPoint.Value = GetSafeUpDownValue(WlbPoolConfiguration.ConvertToMB(_poolConfiguration.HostNetworkReadThresholdCritical), updownNetworkReadCriticalPoint);
updownNetworkWriteCriticalPoint.Value = GetSafeUpDownValue(WlbPoolConfiguration.ConvertToMB(_poolConfiguration.HostNetworkWriteThresholdCritical), updownNetworkWriteCriticalPoint);
updownMemoryCriticalPoint.Value = GetSafeUpDownValue(WlbConfigurationBase.ConvertToMB(_poolConfiguration.HostMemoryThresholdCritical), updownMemoryCriticalPoint);
updownDiskReadCriticalPoint.Value = GetSafeUpDownValue(WlbConfigurationBase.ConvertToMB(_poolConfiguration.HostDiskReadThresholdCritical), updownDiskReadCriticalPoint);
updownDiskWriteCriticalPoint.Value = GetSafeUpDownValue(WlbConfigurationBase.ConvertToMB(_poolConfiguration.HostDiskWriteThresholdCritical), updownDiskWriteCriticalPoint);
updownNetworkReadCriticalPoint.Value = GetSafeUpDownValue(WlbConfigurationBase.ConvertToMB(_poolConfiguration.HostNetworkReadThresholdCritical), updownNetworkReadCriticalPoint);
updownNetworkWriteCriticalPoint.Value = GetSafeUpDownValue(WlbConfigurationBase.ConvertToMB(_poolConfiguration.HostNetworkWriteThresholdCritical), updownNetworkWriteCriticalPoint);
labelCPUUnits.Text = string.Format(labelCPUUnits.Text, updownCPUCriticalPoint.Minimum, updownCPUCriticalPoint.Maximum);
labelFreeMemoryUnits.Text = string.Format(labelFreeMemoryUnits.Text, updownMemoryCriticalPoint.Minimum, updownMemoryCriticalPoint.Maximum);
@ -94,20 +97,11 @@ namespace XenAdmin.SettingsPanels
labelDiskWriteUnits.Text = string.Format(labelDiskWriteUnits.Text, updownDiskWriteCriticalPoint.Minimum, updownDiskWriteCriticalPoint.Maximum);
labelNetworkReadUnits.Text = string.Format(labelNetworkReadUnits.Text, updownNetworkReadCriticalPoint.Minimum, updownNetworkReadCriticalPoint.Maximum);
labelNetworkWriteUnits.Text = string.Format(labelNetworkWriteUnits.Text, updownNetworkWriteCriticalPoint.Minimum, updownNetworkWriteCriticalPoint.Maximum);
// CA-194940:
// Host disk read/write threshold and weight settings work since Dundee.
// For previous XenServer, hide the host disk read/write settings.
if (!Helpers.DundeeOrGreater(_connection))
{
updownDiskReadCriticalPoint.Visible = false;
updownDiskWriteCriticalPoint.Visible = false;
labelDiskReadUnits.Visible = false;
labelDiskWriteUnits.Visible = false;
labelDiskRead.Visible = false;
label1DiskWrite.Visible = false;
}
_loading = false; ;
finally
{
_loading = false;
}
}
private decimal GetSafeUpDownValue(decimal value, NumericUpDown thisControl)

View File

@ -170,7 +170,7 @@ namespace XenAdmin.TabPages
}
//show the FCoE column for Dundee or higher hosts only
ColumnFCoECapable.Visible = Helpers.DundeeOrGreater(host);
ColumnFCoECapable.Visible = true;
//show the SR-IOV column for Kolkata or higher hosts only
ColumnSriovCapable.Visible = Helpers.KolkataOrGreater(host);

View File

@ -210,7 +210,7 @@ namespace XenAdmin.Wizards.ImportWizard
private bool CheckDestinationSupportsVendorDevice()
{
var dundeeOrNewerHosts = Helpers.DundeeOrGreater(SelectedTargetPool.Connection) ? SelectedTargetPool.Connection.Cache.Hosts : new Host[] {};
var dundeeOrNewerHosts = SelectedTargetPool.Connection.Cache.Hosts;
foreach (var setting in vendorDeviceSettings)
{

View File

@ -95,7 +95,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages
{
radioButtonCifs.Visible = !Helpers.FeatureForbidden(Connection, Host.RestrictCifs);
radioButtonFcoe.Visible = Helpers.DundeeOrGreater(Connection);
radioButtonFcoe.Visible = true;
foreach (var radioButton in _radioButtons)
{

View File

@ -257,12 +257,6 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
}
}
public override string NextText(bool isLastPage)
{
// for Dundee or greater connections, we have "Storage provisioning settings" page after this page, so the Next button should say "Next", not "Create"
return Helpers.DundeeOrGreater(Connection) ? Messages.WIZARD_BUTTON_NEXT : Messages.NEWSR_LVMOHBA_NEXT_TEXT;
}
public override void SelectDefaultControl()
{
dataGridView.Select();

View File

@ -102,7 +102,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
this.NfsServerPathComboBox.Items.AddRange(add_srs.ToArray());
//Setting up visibility of the NFS Version controls
nfsVersionLabel.Visible = nfsVersionTableLayoutPanel.Visible = Helpers.DundeeOrGreater(Connection);
nfsVersionLabel.Visible = nfsVersionTableLayoutPanel.Visible = true;
}
protected override void PageLoadedCore(PageLoadedDirection direction)

View File

@ -85,7 +85,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
listBoxNfsSRs.SetMustSelectUUID(SrWizardType.UUID);
//Setting visibility of NFS Version controls
nfsVersionLabel.Visible = nfsVersionSelectorTableLayoutPanel.Visible = Helpers.DundeeOrGreater(Connection);
nfsVersionLabel.Visible = nfsVersionSelectorTableLayoutPanel.Visible = true;
}
public override void SelectDefaultControl()
@ -136,21 +136,19 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
{
NfsScanButton.Enabled = false;
// Perform an SR.probe to see if there is already an SR present
Dictionary<String, String> dconf = new Dictionary<String, String>();
string[] fullpath = NfsServerPathTextBox.Text.Trim().Split(new char[] { ':' });
dconf[SERVER] = fullpath[0];
if (fullpath.Length > 1)
{
dconf[SERVERPATH] = fullpath[1];
}
dconf[OPTIONS] = serverOptionsTextBox.Text;
Host coordinator = Helpers.GetCoordinator(Connection);
if (coordinator == null)
return;
if (Helpers.DundeeOrGreater(Connection))
// Perform an SR.probe to see if there is already an SR present
var dconf = new Dictionary<string, string>();
string[] fullpath = NfsServerPathTextBox.Text.Trim().Split(':');
dconf[SERVER] = fullpath[0];
if (fullpath.Length > 1)
dconf[SERVERPATH] = fullpath[1];
dconf[OPTIONS] = serverOptionsTextBox.Text;
dconf[PROBEVERSION] = string.Empty; //this needs to be passed to the API in order to get back the NFS versions supported
// Start probe

View File

@ -198,13 +198,7 @@ namespace XenAdmin.Wizards.PatchingWizard
: Updates.GetMinimalPatches(host.Connection);
if (minimalPatches == null) //version not supported or too new to have automated updates available
{
var versionSupportsAutomatedUpdates = WizardMode == WizardMode.NewVersion
? Helpers.DundeeOrGreater(host)
: Helpers.DundeeOrGreater(host.Connection);
tooltipText = versionSupportsAutomatedUpdates
? Messages.PATCHINGWIZARD_SELECTSERVERPAGE_SERVER_UP_TO_DATE
: string.Format(Messages.PATCHINGWIZARD_SELECTSERVERPAGE_AUTOMATED_UPDATES_NOT_SUPPORTED_HOST_VERSION, BrandManager.ProductBrand);
tooltipText = Messages.PATCHINGWIZARD_SELECTSERVERPAGE_SERVER_UP_TO_DATE;
return false;
}

View File

@ -40,24 +40,22 @@ namespace XenAdmin.Actions
public class AddHostToPoolAction : PoolAbstractAction
{
private readonly List<Host> _hostsToRelicense;
private readonly List<Host> _hostsToCpuMask;
private readonly List<Host> _hostsToAdConfigure;
public AddHostToPoolAction(Pool poolToJoin, Host joiningHost, Func<Host, AdUserAndPassword> getAdCredentials,
Func<HostAbstractAction, Pool, long, long, bool> acceptNTolChanges, Action<List<LicenseFailure>, string> doOnLicensingFailure)
Action<List<LicenseFailure>, string> doOnLicensingFailure)
: base(joiningHost.Connection, string.Format(Messages.ADDING_SERVER_TO_POOL, joiningHost.Name(), poolToJoin.Name()),
getAdCredentials, acceptNTolChanges, doOnLicensingFailure)
getAdCredentials, doOnLicensingFailure)
{
this.Pool = poolToJoin;
this.Host = joiningHost;
Host coordinator = Helpers.GetCoordinator(poolToJoin);
_hostsToRelicense = new List<Host>();
_hostsToCpuMask = new List<Host>();
_hostsToAdConfigure = new List<Host>();
if (PoolJoinRules.FreeHostPaidCoordinator(joiningHost, coordinator, false))
_hostsToRelicense.Add(joiningHost);
if (!PoolJoinRules.CompatibleCPUs(joiningHost, coordinator, false))
_hostsToCpuMask.Add(joiningHost);
if (!PoolJoinRules.CompatibleAdConfig(joiningHost, coordinator, false))
_hostsToAdConfigure.Add(joiningHost);
this.Description = Messages.WAITING;
@ -76,7 +74,6 @@ namespace XenAdmin.Actions
ApiMethodsToRoleCheck.Add("pool.remove_tags");
ApiMethodsToRoleCheck.Add("pool.set_wlb_enabled");
ApiMethodsToRoleCheck.Add("pool.set_wlb_verify_cert");
ApiMethodsToRoleCheck.Add("pool.join");
}
@ -88,9 +85,6 @@ namespace XenAdmin.Actions
{
FixLicensing(Pool, _hostsToRelicense, DoOnLicensingFailure);
FixAd(Pool, _hostsToAdConfigure, GetAdCredentials);
bool fixedCpus = FixCpus(Pool, _hostsToCpuMask, AcceptNTolChanges);
if (fixedCpus)
Session = NewSession(); // We've rebooted the server, so we need to grab the new session
var coordinator = Pool.Connection.TryResolveWithTimeout(Pool.master);
var address = coordinator != null ? coordinator.address : Pool.Connection.Hostname;

View File

@ -40,7 +40,7 @@ namespace XenAdmin.Actions
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private readonly List<Host> _supporters, _hostsToRelicense, _hostsToCpuMask, _hostsToAdConfigure;
private readonly List<Host> _supporters, _hostsToRelicense, _hostsToAdConfigure;
private readonly string _name;
private readonly string _description;
@ -51,20 +51,18 @@ namespace XenAdmin.Actions
/// <param name="supporters"></param>
/// <param name="name"></param>
/// <param name="description"></param>
/// <param name="acceptNTolChanges"></param>
/// <param name="doOnLicensingFailure"></param>
/// <param name="getAdCredentials"></param>
public CreatePoolAction(Host coordinator, List<Host> supporters, string name, string description, Func<Host, AdUserAndPassword> getAdCredentials,
Func<HostAbstractAction, Pool, long, long, bool> acceptNTolChanges, Action<List<LicenseFailure>, string> doOnLicensingFailure)
Action<List<LicenseFailure>, string> doOnLicensingFailure)
: base(coordinator.Connection, string.Format(Messages.CREATING_NAMED_POOL_WITH_COORDINATOR, name, coordinator.Name()),
getAdCredentials, acceptNTolChanges, doOnLicensingFailure)
getAdCredentials, doOnLicensingFailure)
{
System.Diagnostics.Trace.Assert(coordinator != null);
this.Host = coordinator;
this._supporters = supporters;
_hostsToRelicense = supporters.FindAll(h => PoolJoinRules.FreeHostPaidCoordinator(h, coordinator, false));
_hostsToCpuMask = supporters.FindAll(h => !PoolJoinRules.CompatibleCPUs(h, coordinator, false));
_hostsToAdConfigure = supporters.FindAll(h => !PoolJoinRules.CompatibleAdConfig(h, coordinator, false));
this._name = name;
this._description = description;
@ -111,7 +109,6 @@ namespace XenAdmin.Actions
FixLicensing(coordinator_pool, _hostsToRelicense, DoOnLicensingFailure);
FixAd(coordinator_pool, _hostsToAdConfigure, GetAdCredentials);
FixCpus(coordinator_pool, _hostsToCpuMask, AcceptNTolChanges);
XenAPI.Pool.set_name_label(Session, coordinator_pool.opaque_ref, _name);
XenAPI.Pool.set_name_description(Session, coordinator_pool.opaque_ref, _description);

View File

@ -40,22 +40,19 @@ namespace XenAdmin.Actions
public abstract class PoolAbstractAction : AsyncAction
{
protected Func<Host, AdUserAndPassword> GetAdCredentials;
protected Func<HostAbstractAction, Pool, long, long, bool> AcceptNTolChanges;
protected Action<List<LicenseFailure>, string> DoOnLicensingFailure;
protected PoolAbstractAction(IXenConnection connection, string title, Func<Host, AdUserAndPassword> getAdCredentials,
Func<HostAbstractAction, Pool, long, long, bool> acceptNTolChanges, Action<List<LicenseFailure>, string> doOnLicensingFailure)
Action<List<LicenseFailure>, string> doOnLicensingFailure)
: base(connection, title)
{
this.GetAdCredentials = getAdCredentials;
this.AcceptNTolChanges = acceptNTolChanges;
this.DoOnLicensingFailure = doOnLicensingFailure;
GetAdCredentials = getAdCredentials;
DoOnLicensingFailure = doOnLicensingFailure;
}
protected void ClearAllDelegates()
{
GetAdCredentials = null;
AcceptNTolChanges = null;
DoOnLicensingFailure = null;
}
@ -70,51 +67,6 @@ namespace XenAdmin.Actions
action.RunSync(null);
}
/// <summary>
/// Mask the CPUs of any supporters that need masking to join the pool
/// </summary>
/// <returns>Whether any CPUs were masked</returns>
protected static bool FixCpus(Pool pool, List<Host> hostsToCpuMask, Func<HostAbstractAction, Pool, long, long, bool> acceptNTolChanges)
{
if (hostsToCpuMask.Count == 0)
return false;
Host poolCoordinator = Helpers.GetCoordinator(pool);
List<RebootHostAction> rebootActions = new List<RebootHostAction>();
// Mask the CPUs, and reboot the hosts (simultaneously, as they must all be on separate connections)
foreach (Host host in hostsToCpuMask)
{
// No CPU masking is needed for Dundee or greater hosts
if (Helpers.DundeeOrGreater(host))
{
System.Diagnostics.Trace.Assert(false, "No CPU masking should be done for Dundee or greater hosts");
continue;
}
Host.set_cpu_features(host.Connection.Session, host.opaque_ref, poolCoordinator.cpu_info["features"]);
RebootHostAction action = new RebootHostAction(host, acceptNTolChanges);
rebootActions.Add(action);
action.RunAsync();
}
// Wait for all the actions to finish, checking every ten seconds
while (true)
{
bool done = true;
foreach (RebootHostAction action in rebootActions)
{
if (!action.IsCompleted)
done = false;
}
if (done)
break;
System.Threading.Thread.Sleep(10000);
}
return true;
}
/// <summary>
/// If we're joining a pool that has a non-shared default/crash/suspend SR, then clear that
/// pool's default SRs, since a pool with default SRs set to local storage is a confusing

View File

@ -6943,15 +6943,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Cannot move this virtual disk because it is attached to a VM that is not running..
/// </summary>
public static string CANNOT_MIGRATE_VDI_NON_RUNNING_VM {
get {
return ResourceManager.GetString("CANNOT_MIGRATE_VDI_NON_RUNNING_VM", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to This virtual disk has CBT enabled. It cannot be moved to another storage repository..
/// </summary>
@ -29428,15 +29419,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Automated updates are not supported on this {0} version.
/// </summary>
public static string PATCHINGWIZARD_SELECTSERVERPAGE_AUTOMATED_UPDATES_NOT_SUPPORTED_HOST_VERSION {
get {
return ResourceManager.GetString("PATCHINGWIZARD_SELECTSERVERPAGE_AUTOMATED_UPDATES_NOT_SUPPORTED_HOST_VERSION", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Automated updates are not supported on partially upgraded {0} pools.
/// </summary>

View File

@ -2518,9 +2518,6 @@ This will cancel compilation of the status report.</value>
<data name="CANNOT_FIND_SR_WIZARD_TYPE" xml:space="preserve">
<value>You cannot configure an SR of type '{0}' using {1}.</value>
</data>
<data name="CANNOT_MIGRATE_VDI_NON_RUNNING_VM" xml:space="preserve">
<value>Cannot move this virtual disk because it is attached to a VM that is not running.</value>
</data>
<data name="CANNOT_MOVE_CBT_ENABLED_VDI" xml:space="preserve">
<value>This virtual disk has CBT enabled. It cannot be moved to another storage repository.</value>
</data>
@ -10226,9 +10223,6 @@ This will cancel the update process and may leave your system in an unstable sta
<data name="PATCHINGWIZARD_SELECTSERVERPAGE_APPLY_UPDATES_MIXED" xml:space="preserve">
<value>Also apply all released &amp;updates on the new version (only on pools licensed for automated updates)</value>
</data>
<data name="PATCHINGWIZARD_SELECTSERVERPAGE_AUTOMATED_UPDATES_NOT_SUPPORTED_HOST_VERSION" xml:space="preserve">
<value>Automated updates are not supported on this {0} version</value>
</data>
<data name="PATCHINGWIZARD_SELECTSERVERPAGE_AUTOMATED_UPDATES_NOT_SUPPORTED_PARTIALLY_UPGRADED" xml:space="preserve">
<value>Automated updates are not supported on partially upgraded {0} pools</value>
</data>

View File

@ -91,9 +91,8 @@ namespace XenAdmin.Core
/// <param name="supporterConnection">The connection of the server that wants to join the pool</param>
/// <param name="coordinatorConnection">The connection of the existing pool or of the proposed coordinator of a new pool</param>
/// <param name="allowLicenseUpgrade">Whether we can upgrade a free host to a v6 license of the pool it's joining</param>
/// <param name="allowCpuLevelling">Whether we can apply CPU levelling to the supporter before it joins the pool</param>
/// <returns>The reason why the server can't join the pool, or Reason.Allowed if it's OK</returns>
public static Reason CanJoinPool(IXenConnection supporterConnection, IXenConnection coordinatorConnection, bool allowLicenseUpgrade, bool allowCpuLevelling, bool allowSupporterAdConfig, int poolSizeIncrement = 1)
public static Reason CanJoinPool(IXenConnection supporterConnection, IXenConnection coordinatorConnection, bool allowLicenseUpgrade, bool allowSupporterAdConfig, int poolSizeIncrement = 1)
{
if (supporterConnection == null || !supporterConnection.IsConnected)
return Reason.NotConnected;
@ -122,7 +121,7 @@ namespace XenAdmin.Core
if (!RoleOK(coordinatorConnection))
return Reason.WrongRoleOnCoordinator;
if (!CompatibleCPUs(supporterHost, coordinatorHost, allowCpuLevelling))
if (!CompatibleCPUs(supporterHost, coordinatorHost))
return Reason.DifferentCPUs;
if (DifferentServerVersion(supporterHost, coordinatorHost))
@ -310,7 +309,7 @@ namespace XenAdmin.Core
// If CompatibleCPUs(supporter, coordinator, false) is true, the CPUs can be pooled without masking first.
// If CompatibleCPUs(supporter, coordinator, true) is true but CompatibleCPUs(supporter, coordinator, false) is false,
// the CPUs can be pooled but only if they are masked first.
public static bool CompatibleCPUs(Host supporter, Host coordinator, bool allowCpuLevelling)
public static bool CompatibleCPUs(Host supporter, Host coordinator)
{
if (supporter == null || coordinator == null)
return true;
@ -326,23 +325,7 @@ namespace XenAdmin.Core
return false;
// As of Dundee, feature levelling makes all CPUs from the same vendor compatible
if (Helpers.DundeeOrGreater(coordinator) || Helpers.DundeeOrGreater(supporter))
return true;
if (supporter_cpu_info["features"] == coordinator_cpu_info["features"])
return true;
if (allowCpuLevelling)
{
string cpuid_feature_mask = null;
Pool pool = Helpers.GetPoolOfOne(coordinator.Connection);
if (pool != null && pool.other_config.ContainsKey("cpuid_feature_mask"))
cpuid_feature_mask = pool.other_config["cpuid_feature_mask"];
return MaskableTo(supporter_cpu_info["maskable"], supporter_cpu_info["physical_features"], coordinator_cpu_info["features"], cpuid_feature_mask);
}
return false;
}
// Host.cpu_info not supported: use the old method which compares vendor, family, model and flags

View File

@ -167,28 +167,6 @@ namespace XenAdmin.Core
#region Versions
/// <summary>
/// Dundee platform version is 2.0.0
/// </summary>
/// <param name="conn">May be null, in which case true is returned.</param>
public static bool DundeeOrGreater(IXenConnection conn)
{
return conn == null || DundeeOrGreater(GetCoordinator(conn));
}
/// <summary>
/// Dundee platform version is 2.0.0
/// </summary>
/// <param name="host">May be null, in which case true is returned.</param>
public static bool DundeeOrGreater(Host host)
{
if (host == null)
return true;
string platformVersion = HostPlatformVersion(host);
return platformVersion != null && ProductVersionCompare(platformVersion, "2.0.0") >= 0;
}
/// <summary>
/// Ely platform version is 2.1.1
/// </summary>

View File

@ -222,7 +222,7 @@ namespace XenAdmin.Core
public static bool CrossPoolMigrationRestrictedWithWlb(IXenConnection conn)
{
return WlbEnabledAndConfigured(conn) && !DundeeOrGreater(conn);
return false;
}

View File

@ -415,9 +415,7 @@ namespace XenAPI
/// </summary>
public static bool RestrictSslLegacySwitch(Host h)
{
return Helpers.DundeeOrGreater(h)
? BoolKey(h.license_params, "restrict_ssl_legacy_switch")
: BoolKeyPreferTrue(h.license_params, "restrict_ssl_legacy_switch");
return BoolKey(h.license_params, "restrict_ssl_legacy_switch");
}
public static bool RestrictLivePatching(Host h)

View File

@ -729,7 +729,7 @@ namespace XenAPI
/// </summary>
public bool HasNewVirtualisationStates()
{
return IsWindows() && Helpers.DundeeOrGreater(Connection);
return IsWindows();
}
/// <summary>