From 82940850e98c75f6c0ae53e561e41a4a9f7528ba Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Wed, 10 May 2023 14:50:52 +0100 Subject: [PATCH] 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 --- XenAdmin/Commands/AddHostToPoolCommand.cs | 8 +-- .../Commands/DragDropAddHostToPoolCommand.cs | 2 +- .../Commands/MigrateVirtualDiskCommand.cs | 4 -- XenAdmin/Commands/VMOperationHostCommand.cs | 11 ---- .../ConnectionWrapperWithMoreStuff.cs | 2 +- XenAdmin/Core/HelpersGUI.cs | 2 +- .../Checks/AssertCanEvacuateCheck.cs | 2 +- .../Checks/AssertCanEvacuateUpgradeCheck.cs | 2 +- .../Checks/AutomatedUpdatesLicenseCheck.cs | 2 +- XenAdmin/Dialogs/NewPoolDialog.cs | 5 +- XenAdmin/LicenseTimer.cs | 7 ++- XenAdmin/MainWindow.cs | 2 +- .../Wlb/WlbMetricWeightingPage.cs | 27 +++++----- .../SettingsPanels/Wlb/WlbThresholdsPage.cs | 42 +++++++-------- XenAdmin/TabPages/NICPage.cs | 2 +- .../ImportWizard/ImportSelectHostPage.cs | 2 +- .../NewSRWizard_Pages/ChooseSrTypePage.cs | 2 +- .../NewSRWizard_Pages/Frontends/LVMoHBA.cs | 6 --- .../NewSRWizard_Pages/Frontends/NFS_ISO.cs | 2 +- .../NewSRWizard_Pages/Frontends/VHDoNFS.cs | 24 ++++----- .../PatchingWizard_SelectServers.cs | 8 +-- XenModel/Actions/Pool/AddHostToPoolAction.cs | 14 ++--- XenModel/Actions/Pool/CreatePoolAction.cs | 9 ++-- XenModel/Actions/Pool/PoolAction.cs | 54 ++----------------- XenModel/Messages.Designer.cs | 18 ------- XenModel/Messages.resx | 6 --- XenModel/PoolJoinRules.cs | 25 ++------- XenModel/Utils/Helpers.Versions.cs | 22 -------- XenModel/Utils/Helpers.cs | 2 +- XenModel/XenAPI-Extensions/Host.cs | 4 +- XenModel/XenAPI-Extensions/VM.cs | 2 +- 31 files changed, 79 insertions(+), 241 deletions(-) diff --git a/XenAdmin/Commands/AddHostToPoolCommand.cs b/XenAdmin/Commands/AddHostToPoolCommand.cs index 76c6839a1..466e4f18b 100644 --- a/XenAdmin/Commands/AddHostToPoolCommand.cs +++ b/XenAdmin/Commands/AddHostToPoolCommand.cs @@ -71,7 +71,7 @@ namespace XenAdmin.Commands var reasons = new Dictionary(); 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) diff --git a/XenAdmin/Commands/DragDropAddHostToPoolCommand.cs b/XenAdmin/Commands/DragDropAddHostToPoolCommand.cs index 8dd6e2ac8..acae01f15 100644 --- a/XenAdmin/Commands/DragDropAddHostToPoolCommand.cs +++ b/XenAdmin/Commands/DragDropAddHostToPoolCommand.cs @@ -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); diff --git a/XenAdmin/Commands/MigrateVirtualDiskCommand.cs b/XenAdmin/Commands/MigrateVirtualDiskCommand.cs index b71ded3f9..10fdc5c90 100644 --- a/XenAdmin/Commands/MigrateVirtualDiskCommand.cs +++ b/XenAdmin/Commands/MigrateVirtualDiskCommand.cs @@ -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) diff --git a/XenAdmin/Commands/VMOperationHostCommand.cs b/XenAdmin/Commands/VMOperationHostCommand.cs index fbc368c84..dd7a1ba44 100644 --- a/XenAdmin/Commands/VMOperationHostCommand.cs +++ b/XenAdmin/Commands/VMOperationHostCommand.cs @@ -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; diff --git a/XenAdmin/Controls/ConnectionWrapperWithMoreStuff.cs b/XenAdmin/Controls/ConnectionWrapperWithMoreStuff.cs index c21385302..1e7f82645 100644 --- a/XenAdmin/Controls/ConnectionWrapperWithMoreStuff.cs +++ b/XenAdmin/Controls/ConnectionWrapperWithMoreStuff.cs @@ -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); diff --git a/XenAdmin/Core/HelpersGUI.cs b/XenAdmin/Core/HelpersGUI.cs index 951c930a5..923bbb693 100644 --- a/XenAdmin/Core/HelpersGUI.cs +++ b/XenAdmin/Core/HelpersGUI.cs @@ -481,7 +481,7 @@ namespace XenAdmin.Core public static bool GetPermissionForCpuFeatureLevelling(List hosts, Pool pool) { - if (hosts == null || pool == null || !Helpers.DundeeOrGreater(pool.Connection)) + if (hosts == null || pool == null) return true; List hostsWithFewerFeatures = hosts.Where(host => PoolJoinRules.HostHasFewerFeatures(host, pool)).ToList(); diff --git a/XenAdmin/Diagnostics/Checks/AssertCanEvacuateCheck.cs b/XenAdmin/Diagnostics/Checks/AssertCanEvacuateCheck.cs index abdbf6749..d7037f017 100644 --- a/XenAdmin/Diagnostics/Checks/AssertCanEvacuateCheck.cs +++ b/XenAdmin/Diagnostics/Checks/AssertCanEvacuateCheck.cs @@ -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) { diff --git a/XenAdmin/Diagnostics/Checks/AssertCanEvacuateUpgradeCheck.cs b/XenAdmin/Diagnostics/Checks/AssertCanEvacuateUpgradeCheck.cs index 14cfc60ab..955442bbe 100644 --- a/XenAdmin/Diagnostics/Checks/AssertCanEvacuateUpgradeCheck.cs +++ b/XenAdmin/Diagnostics/Checks/AssertCanEvacuateUpgradeCheck.cs @@ -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; } } diff --git a/XenAdmin/Diagnostics/Checks/AutomatedUpdatesLicenseCheck.cs b/XenAdmin/Diagnostics/Checks/AutomatedUpdatesLicenseCheck.cs index cd189cabf..14ca00f71 100644 --- a/XenAdmin/Diagnostics/Checks/AutomatedUpdatesLicenseCheck.cs +++ b/XenAdmin/Diagnostics/Checks/AutomatedUpdatesLicenseCheck.cs @@ -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; diff --git a/XenAdmin/Dialogs/NewPoolDialog.cs b/XenAdmin/Dialogs/NewPoolDialog.cs index 025f7aa90..feca061ed 100644 --- a/XenAdmin/Dialogs/NewPoolDialog.cs +++ b/XenAdmin/Dialogs/NewPoolDialog.cs @@ -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) diff --git a/XenAdmin/LicenseTimer.cs b/XenAdmin/LicenseTimer.cs index 4056a9f66..6474d9a82 100644 --- a/XenAdmin/LicenseTimer.cs +++ b/XenAdmin/LicenseTimer.cs @@ -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; } } diff --git a/XenAdmin/MainWindow.cs b/XenAdmin/MainWindow.cs index 4d4a936ef..641a5bff3 100755 --- a/XenAdmin/MainWindow.cs +++ b/XenAdmin/MainWindow.cs @@ -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(); diff --git a/XenAdmin/SettingsPanels/Wlb/WlbMetricWeightingPage.cs b/XenAdmin/SettingsPanels/Wlb/WlbMetricWeightingPage.cs index bb4dd5c35..7b966ee8d 100644 --- a/XenAdmin/SettingsPanels/Wlb/WlbMetricWeightingPage.cs +++ b/XenAdmin/SettingsPanels/Wlb/WlbMetricWeightingPage.cs @@ -81,23 +81,20 @@ namespace XenAdmin.SettingsPanels private void InitializeControls() { _loading = true; - 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)) + + try { - trackbarDiskReadPriority.Visible = false; - trackbarDiskWritePriority.Visible = false; - label10.Visible = false; - label11.Visible = false; + 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); + } + finally + { + _loading = false; } - _loading = false; ; } private void trackbarValueChanged(object sender, EventArgs e) diff --git a/XenAdmin/SettingsPanels/Wlb/WlbThresholdsPage.cs b/XenAdmin/SettingsPanels/Wlb/WlbThresholdsPage.cs index f5dbb814f..acf0d4be2 100644 --- a/XenAdmin/SettingsPanels/Wlb/WlbThresholdsPage.cs +++ b/XenAdmin/SettingsPanels/Wlb/WlbThresholdsPage.cs @@ -81,33 +81,27 @@ namespace XenAdmin.SettingsPanels private void InitializeControls() { _loading = true; - 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); - labelCPUUnits.Text = string.Format(labelCPUUnits.Text, updownCPUCriticalPoint.Minimum, updownCPUCriticalPoint.Maximum); - labelFreeMemoryUnits.Text = string.Format(labelFreeMemoryUnits.Text, updownMemoryCriticalPoint.Minimum, updownMemoryCriticalPoint.Maximum); - labelDiskReadUnits.Text = string.Format(labelDiskReadUnits.Text, updownDiskReadCriticalPoint.Minimum, updownDiskReadCriticalPoint.Maximum); - 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)) + try { - updownDiskReadCriticalPoint.Visible = false; - updownDiskWriteCriticalPoint.Visible = false; - labelDiskReadUnits.Visible = false; - labelDiskWriteUnits.Visible = false; - labelDiskRead.Visible = false; - label1DiskWrite.Visible = false; + updownCPUCriticalPoint.Value = GetSafeUpDownValue(_poolConfiguration.HostCpuThresholdCritical, updownCPUCriticalPoint); + 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); + labelDiskReadUnits.Text = string.Format(labelDiskReadUnits.Text, updownDiskReadCriticalPoint.Minimum, updownDiskReadCriticalPoint.Maximum); + 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); + } + finally + { + _loading = false; } - _loading = false; ; } private decimal GetSafeUpDownValue(decimal value, NumericUpDown thisControl) diff --git a/XenAdmin/TabPages/NICPage.cs b/XenAdmin/TabPages/NICPage.cs index 8280fa9f1..ffe4d9013 100644 --- a/XenAdmin/TabPages/NICPage.cs +++ b/XenAdmin/TabPages/NICPage.cs @@ -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); diff --git a/XenAdmin/Wizards/ImportWizard/ImportSelectHostPage.cs b/XenAdmin/Wizards/ImportWizard/ImportSelectHostPage.cs index 8240b7557..22509098f 100755 --- a/XenAdmin/Wizards/ImportWizard/ImportSelectHostPage.cs +++ b/XenAdmin/Wizards/ImportWizard/ImportSelectHostPage.cs @@ -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) { diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.cs b/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.cs index 7af590e46..47409617a 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.cs @@ -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) { diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs index 6aa916718..a9f829ddf 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.cs @@ -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(); diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/NFS_ISO.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/NFS_ISO.cs index 85125b1dd..96c27599b 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/NFS_ISO.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/NFS_ISO.cs @@ -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) diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/VHDoNFS.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/VHDoNFS.cs index 9d3066e36..7059b8421 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/VHDoNFS.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/VHDoNFS.cs @@ -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,22 +136,20 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends { NfsScanButton.Enabled = false; - // Perform an SR.probe to see if there is already an SR present - Dictionary dconf = new Dictionary(); - 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)) - dconf[PROBEVERSION] = string.Empty; //this needs to be passed to the API in order to get back the NFS versions supported + // Perform an SR.probe to see if there is already an SR present + var dconf = new Dictionary(); + 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 SrProbeAction action = new SrProbeAction(Connection, coordinator, SR.SRTypes.nfs, dconf); diff --git a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_SelectServers.cs b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_SelectServers.cs index fd75e5076..7e994cc89 100644 --- a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_SelectServers.cs +++ b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_SelectServers.cs @@ -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; } diff --git a/XenModel/Actions/Pool/AddHostToPoolAction.cs b/XenModel/Actions/Pool/AddHostToPoolAction.cs index bcafb5377..ec4b54865 100644 --- a/XenModel/Actions/Pool/AddHostToPoolAction.cs +++ b/XenModel/Actions/Pool/AddHostToPoolAction.cs @@ -40,24 +40,22 @@ namespace XenAdmin.Actions public class AddHostToPoolAction : PoolAbstractAction { private readonly List _hostsToRelicense; - private readonly List _hostsToCpuMask; private readonly List _hostsToAdConfigure; public AddHostToPoolAction(Pool poolToJoin, Host joiningHost, Func getAdCredentials, - Func acceptNTolChanges, Action, string> doOnLicensingFailure) + Action, 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(); - _hostsToCpuMask = new List(); + _hostsToAdConfigure = new List(); 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; diff --git a/XenModel/Actions/Pool/CreatePoolAction.cs b/XenModel/Actions/Pool/CreatePoolAction.cs index b18f81aa1..4cb2bfd5a 100644 --- a/XenModel/Actions/Pool/CreatePoolAction.cs +++ b/XenModel/Actions/Pool/CreatePoolAction.cs @@ -40,7 +40,7 @@ namespace XenAdmin.Actions { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private readonly List _supporters, _hostsToRelicense, _hostsToCpuMask, _hostsToAdConfigure; + private readonly List _supporters, _hostsToRelicense, _hostsToAdConfigure; private readonly string _name; private readonly string _description; @@ -51,20 +51,18 @@ namespace XenAdmin.Actions /// /// /// - /// /// /// public CreatePoolAction(Host coordinator, List supporters, string name, string description, Func getAdCredentials, - Func acceptNTolChanges, Action, string> doOnLicensingFailure) + Action, 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); diff --git a/XenModel/Actions/Pool/PoolAction.cs b/XenModel/Actions/Pool/PoolAction.cs index 21756f4a3..a96f7ad8b 100644 --- a/XenModel/Actions/Pool/PoolAction.cs +++ b/XenModel/Actions/Pool/PoolAction.cs @@ -40,22 +40,19 @@ namespace XenAdmin.Actions public abstract class PoolAbstractAction : AsyncAction { protected Func GetAdCredentials; - protected Func AcceptNTolChanges; protected Action, string> DoOnLicensingFailure; protected PoolAbstractAction(IXenConnection connection, string title, Func getAdCredentials, - Func acceptNTolChanges, Action, string> doOnLicensingFailure) + Action, 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); } - /// - /// Mask the CPUs of any supporters that need masking to join the pool - /// - /// Whether any CPUs were masked - protected static bool FixCpus(Pool pool, List hostsToCpuMask, Func acceptNTolChanges) - { - if (hostsToCpuMask.Count == 0) - return false; - - Host poolCoordinator = Helpers.GetCoordinator(pool); - List rebootActions = new List(); - - // 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; - } - /// /// 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 diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 70d5ea7bd..3a488b76c 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -6943,15 +6943,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Cannot move this virtual disk because it is attached to a VM that is not running.. - /// - public static string CANNOT_MIGRATE_VDI_NON_RUNNING_VM { - get { - return ResourceManager.GetString("CANNOT_MIGRATE_VDI_NON_RUNNING_VM", resourceCulture); - } - } - /// /// Looks up a localized string similar to This virtual disk has CBT enabled. It cannot be moved to another storage repository.. /// @@ -29428,15 +29419,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to Automated updates are not supported on this {0} version. - /// - public static string PATCHINGWIZARD_SELECTSERVERPAGE_AUTOMATED_UPDATES_NOT_SUPPORTED_HOST_VERSION { - get { - return ResourceManager.GetString("PATCHINGWIZARD_SELECTSERVERPAGE_AUTOMATED_UPDATES_NOT_SUPPORTED_HOST_VERSION", resourceCulture); - } - } - /// /// Looks up a localized string similar to Automated updates are not supported on partially upgraded {0} pools. /// diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index c97ee1872..766284fa1 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -2518,9 +2518,6 @@ This will cancel compilation of the status report. You cannot configure an SR of type '{0}' using {1}. - - Cannot move this virtual disk because it is attached to a VM that is not running. - This virtual disk has CBT enabled. It cannot be moved to another storage repository. @@ -10226,9 +10223,6 @@ This will cancel the update process and may leave your system in an unstable sta Also apply all released &updates on the new version (only on pools licensed for automated updates) - - Automated updates are not supported on this {0} version - Automated updates are not supported on partially upgraded {0} pools diff --git a/XenModel/PoolJoinRules.cs b/XenModel/PoolJoinRules.cs index c303c0f22..b512f2736 100644 --- a/XenModel/PoolJoinRules.cs +++ b/XenModel/PoolJoinRules.cs @@ -91,9 +91,8 @@ namespace XenAdmin.Core /// The connection of the server that wants to join the pool /// The connection of the existing pool or of the proposed coordinator of a new pool /// Whether we can upgrade a free host to a v6 license of the pool it's joining - /// Whether we can apply CPU levelling to the supporter before it joins the pool /// The reason why the server can't join the pool, or Reason.Allowed if it's OK - 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; + return true; } // Host.cpu_info not supported: use the old method which compares vendor, family, model and flags diff --git a/XenModel/Utils/Helpers.Versions.cs b/XenModel/Utils/Helpers.Versions.cs index f405454a3..27045c671 100644 --- a/XenModel/Utils/Helpers.Versions.cs +++ b/XenModel/Utils/Helpers.Versions.cs @@ -167,28 +167,6 @@ namespace XenAdmin.Core #region Versions - /// - /// Dundee platform version is 2.0.0 - /// - /// May be null, in which case true is returned. - public static bool DundeeOrGreater(IXenConnection conn) - { - return conn == null || DundeeOrGreater(GetCoordinator(conn)); - } - - /// - /// Dundee platform version is 2.0.0 - /// - /// May be null, in which case true is returned. - public static bool DundeeOrGreater(Host host) - { - if (host == null) - return true; - - string platformVersion = HostPlatformVersion(host); - return platformVersion != null && ProductVersionCompare(platformVersion, "2.0.0") >= 0; - } - /// /// Ely platform version is 2.1.1 /// diff --git a/XenModel/Utils/Helpers.cs b/XenModel/Utils/Helpers.cs index 7f0d302bb..5a26f8dd0 100755 --- a/XenModel/Utils/Helpers.cs +++ b/XenModel/Utils/Helpers.cs @@ -222,7 +222,7 @@ namespace XenAdmin.Core public static bool CrossPoolMigrationRestrictedWithWlb(IXenConnection conn) { - return WlbEnabledAndConfigured(conn) && !DundeeOrGreater(conn); + return false; } diff --git a/XenModel/XenAPI-Extensions/Host.cs b/XenModel/XenAPI-Extensions/Host.cs index 96c69a83e..25fda9efe 100644 --- a/XenModel/XenAPI-Extensions/Host.cs +++ b/XenModel/XenAPI-Extensions/Host.cs @@ -415,9 +415,7 @@ namespace XenAPI /// 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) diff --git a/XenModel/XenAPI-Extensions/VM.cs b/XenModel/XenAPI-Extensions/VM.cs index f47e3e244..f07f61767 100644 --- a/XenModel/XenAPI-Extensions/VM.cs +++ b/XenModel/XenAPI-Extensions/VM.cs @@ -729,7 +729,7 @@ namespace XenAPI /// public bool HasNewVirtualisationStates() { - return IsWindows() && Helpers.DundeeOrGreater(Connection); + return IsWindows(); } ///