diff --git a/XenAdmin/Diagnostics/Checks/AssertCanEvacuateUpgradeCheck.cs b/XenAdmin/Diagnostics/Checks/AssertCanEvacuateUpgradeCheck.cs deleted file mode 100644 index cfd7b21c8..000000000 --- a/XenAdmin/Diagnostics/Checks/AssertCanEvacuateUpgradeCheck.cs +++ /dev/null @@ -1,133 +0,0 @@ -/* Copyright (c) Citrix Systems Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -using System.Collections.Generic; -using System.Linq; -using XenAdmin.Core; -using XenAdmin.Diagnostics.Problems; -using XenAdmin.Diagnostics.Problems.HostProblem; -using XenAdmin.Diagnostics.Problems.VMProblem; -using XenAPI; - -namespace XenAdmin.Diagnostics.Checks -{ - public class AssertCanEvacuateUpgradeCheck : AssertCanEvacuateCheck - { - public AssertCanEvacuateUpgradeCheck(Host host) - : base(host) - { - } - - public override Problem RunCheck() - { - if (!Host.IsLive) - return new HostNotLive(this, Host); - - //Storage link check - var storageLinkProblem = GetStorageLinkProblem(); - if (storageLinkProblem != null) - return storageLinkProblem; - - return base.RunCheck(); - } - - private Problem GetStorageLinkProblem() - { - if (Helpers.BostonOrGreater(Host)) - return null; - - var vmsInStorageLink = new List(); - foreach (var vm in Host.Connection.Cache.VMs.Where(vm => vm.is_a_real_vm)) - { - foreach (var sr in vm.SRs.Where(sr => sr.GetSRType(true) == SR.SRTypes.cslg)) - { - //Check if it is a supported adapter - if (IsSupportedAdapter(sr)) - { - if (vm.power_state == vm_power_state.Suspended || vm.power_state == vm_power_state.Running) - { - vmsInStorageLink.Add(vm); - break; - } - } - else - { - return new IsInStorageLinkLegacySR(this, vm); - } - } - } - if (vmsInStorageLink.Count > 0) - return new IsInStorageLinkLegacySR(this, vmsInStorageLink); - - return null; - } - - private bool IsSupportedAdapter(SR sr) - { - bool isSMIS = false; - bool isNetApp = false; - bool isDell = false; - try - { - var storageRepository = sr.StorageLinkRepository(Program.StorageLinkConnections); - - if (storageRepository == null) - { - // The CSLG is down, maybe because it was on local storage: - // try the other_config instead: see CA-63607. - string adapter; - if (sr.other_config.TryGetValue("CSLG-adapter", out adapter)) - { - isSMIS = (adapter == "SMI-S"); - isNetApp = adapter.ToLower().Contains("netapp"); - isDell = adapter.ToLower().Contains("equallogic"); - } - } - - else - { - // The CSLG is up: look up the adapter type, and save it away in the other_config - var storageSystem = storageRepository.StorageLinkSystem; - isSMIS = storageSystem.StorageLinkAdapter.IsSMIS; - isNetApp = storageSystem.StorageLinkAdapter.AdapterName.ToLower().Contains("netapp"); - isDell = storageSystem.StorageLinkAdapter.AdapterName.ToLower().Contains("equallogic"); - Helpers.SetOtherConfig(sr.Connection.Session, sr, "CSLG-adapter", - isSMIS ? "SMI-S" : storageSystem.StorageLinkAdapter.AdapterName); - } - } - catch - { - } - - return (isNetApp || isDell || isSMIS); - } - } -} \ No newline at end of file diff --git a/XenAdmin/Diagnostics/Checks/HostHasUnsupportedStorageLinkSRCheck.cs b/XenAdmin/Diagnostics/Checks/HostHasUnsupportedStorageLinkSRCheck.cs new file mode 100644 index 000000000..892670c8b --- /dev/null +++ b/XenAdmin/Diagnostics/Checks/HostHasUnsupportedStorageLinkSRCheck.cs @@ -0,0 +1,67 @@ +/* Copyright (c) Citrix Systems Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, + * with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above + * copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +using System.Linq; +using XenAdmin.Diagnostics.Problems.SRProblem; +using XenAPI; +using XenAdmin.Diagnostics.Problems; +using XenAdmin.Diagnostics.Problems.HostProblem; +using XenAdmin.Core; + +namespace XenAdmin.Diagnostics.Checks +{ + class HostHasUnsupportedStorageLinkSRCheck : Check + { + + public HostHasUnsupportedStorageLinkSRCheck(Host host) + : base(host) + { + } + + public override Problem RunCheck() + { + foreach (var sr in Host.Connection.Cache.SRs.Where(sr => sr.GetSRType(true) == SR.SRTypes.cslg)) + { + return new UnsupportedStorageLinkSrIsPresentProblem(this, sr); + } + + return null; + } + + public override string Description + { + get + { + return Messages.STORAGELINK_UPGRADE_TEST; + } + } + } +} diff --git a/XenAdmin/Diagnostics/Problems/SRProblem/UnsupportedStorageLinkSrIsPresentProblem.cs b/XenAdmin/Diagnostics/Problems/SRProblem/UnsupportedStorageLinkSrIsPresentProblem.cs new file mode 100644 index 000000000..fb5ead622 --- /dev/null +++ b/XenAdmin/Diagnostics/Problems/SRProblem/UnsupportedStorageLinkSrIsPresentProblem.cs @@ -0,0 +1,61 @@ +/* Copyright (c) Citrix Systems Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, + * with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above + * copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +using XenAdmin.Diagnostics.Checks; +using XenAPI; + + +namespace XenAdmin.Diagnostics.Problems.SRProblem +{ + class UnsupportedStorageLinkSrIsPresentProblem : SRProblem + { + public UnsupportedStorageLinkSrIsPresentProblem(Check check, SR sr) + : base(check, sr) + { + } + + public override string Description + { + get + { + return Messages.PROBLEM_UNSUPPORTED_STORAGELINK_SR; + } + } + + public override string HelpMessage + { + get + { + return Messages.PROBLEM_UNSUPPORTED_STORAGELINK_SR_HELP; + } + } + } +} diff --git a/XenAdmin/Diagnostics/Problems/VMProblem/IsInStorageLinkLegacySR.cs b/XenAdmin/Diagnostics/Problems/VMProblem/IsInStorageLinkLegacySR.cs deleted file mode 100644 index 946956397..000000000 --- a/XenAdmin/Diagnostics/Problems/VMProblem/IsInStorageLinkLegacySR.cs +++ /dev/null @@ -1,114 +0,0 @@ -/* Copyright (c) Citrix Systems Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Drawing; -using XenAdmin.Actions; -using XenAdmin.Actions.VMActions; -using XenAdmin.Diagnostics.Checks; -using XenAdmin.Dialogs; -using XenAdmin.Properties; -using XenAPI; - - -namespace XenAdmin.Diagnostics.Problems.VMProblem -{ - class IsInStorageLinkLegacySR : Problem - { - // Case 1: VMs using one of the CSLG adapters we can upgrade - private readonly List VMs = new List(); - public IsInStorageLinkLegacySR(Check check, List vm) - : base(check) - { - VMs = vm; - } - - // Case 2: VM using one of the CSLG adapters we can't upgrade - private readonly VM NotSMISVM; - public IsInStorageLinkLegacySR(Check check, VM vm) - : base(check) - { - NotSMISVM = vm; - } - - public override string Title - { - get { return Description; } - } - - public override string Description - { - get - { - if (NotSMISVM != null) - return Messages.ONLY_VMS_USING_STORAGELINK_SMIS; - return Messages.IS_IN_STORAGELINK_SR; - } - } - - public override string HelpMessage - { - get - { - if (NotSMISVM != null) - return Messages.TELL_ME_MORE; - else - return Messages.SHUTDOWN_VM; - } - } - - protected override AsyncAction CreateAction(out bool cancelled) - { - cancelled = false; - if (VMs.Count == 1) - { - if (VMs[0].power_state == vm_power_state.Suspended) - return new VMHardShutdown(VMs[0]); - return new VMCleanShutdown(VMs[0]); - } - if (VMs.Count > 1) - { - var listShutdownActions = new List(); - VMs.ForEach((vm) => - { - if (vm.power_state == vm_power_state.Suspended) - listShutdownActions.Add(new VMHardShutdown(vm)); - else - listShutdownActions.Add(new VMCleanShutdown(vm)); - }); - return new MultipleAction(VMs[0].Connection, Messages.ACTION_VM_SHUTTING_DOWN, Messages.ACTION_VM_SHUTTING_DOWN - , Messages.ACTION_VM_SHUT_DOWN, listShutdownActions); - } - return null; - } - } -} diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.cs b/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.cs index 14521a6e7..ffb01c99c 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.cs @@ -87,6 +87,8 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages public override void PopulatePage() { + radioButtonCslg.Visible = !Helpers.CreedenceOrGreater(Connection); //Hide iSL radio button for Creedence or higher (StorageLink is not supported) + foreach (var radioButton in RadioButtons) { var frontend = (SrWizardType)radioButton.Tag; diff --git a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_PrecheckPage.cs b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_PrecheckPage.cs index ee4af50ee..dbef43fa8 100644 --- a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_PrecheckPage.cs +++ b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_PrecheckPage.cs @@ -536,10 +536,7 @@ namespace XenAdmin.Wizards.PatchingWizard } else { - if (preCheckHostRow.Problem is IsInStorageLinkLegacySR) - new ThreeButtonDialog(new ThreeButtonDialog.Details(SystemIcons.Warning, Messages.ROLLING_UPGRADE_WARNING_SL)).ShowDialog(); - - else if (preCheckHostRow.Problem is WarningWithInformationUrl) + if (preCheckHostRow.Problem is WarningWithInformationUrl) (preCheckHostRow.Problem as WarningWithInformationUrl).LaunchUrlInBrowser(); else if (!cancelled) diff --git a/XenAdmin/Wizards/RollingUpgradeWizard/RollingUpgradeWizardPrecheckPage.cs b/XenAdmin/Wizards/RollingUpgradeWizard/RollingUpgradeWizardPrecheckPage.cs index 65a4b2ed8..808919f75 100644 --- a/XenAdmin/Wizards/RollingUpgradeWizard/RollingUpgradeWizardPrecheckPage.cs +++ b/XenAdmin/Wizards/RollingUpgradeWizard/RollingUpgradeWizardPrecheckPage.cs @@ -168,7 +168,7 @@ namespace XenAdmin.Wizards.RollingUpgradeWizard checkGroup = checks[checks.Count - 1].Value; foreach (Host host in SelectedServers) { - checkGroup.Add(new AssertCanEvacuateUpgradeCheck(host)); + checkGroup.Add(new AssertCanEvacuateCheck(host)); } //PBDsPluggedCheck @@ -197,6 +197,14 @@ namespace XenAdmin.Wizards.RollingUpgradeWizard } } + //iSL (StorageLink) check + checks.Add(new KeyValuePair>(Messages.CHECKING_STORAGELINK_STATUS, new List())); + checkGroup = checks[checks.Count - 1].Value; + foreach (Host host in SelectedServers) + { + checkGroup.Add(new HostHasUnsupportedStorageLinkSRCheck(host)); + } + //Upgrading to Clearwater and above - license changes warning and deprecations if(SelectedServers.Any(h=> !Helpers.ClearwaterOrGreater(h))) { diff --git a/XenAdmin/XenAdmin.csproj b/XenAdmin/XenAdmin.csproj index 773df2e6b..0393a0cff 100644 --- a/XenAdmin/XenAdmin.csproj +++ b/XenAdmin/XenAdmin.csproj @@ -192,6 +192,9 @@ UpsellPage.cs + + + @@ -1117,7 +1120,6 @@ HAWizard.cs - @@ -2438,7 +2440,6 @@ SectionHeaderLabel.cs - @@ -2456,7 +2457,6 @@ - diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 7f826b2ca..5aa7d35a8 100644 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -6068,6 +6068,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Checking StorageLink status. + /// + public static string CHECKING_STORAGELINK_STATUS { + get { + return ResourceManager.GetString("CHECKING_STORAGELINK_STATUS", resourceCulture); + } + } + /// /// Looks up a localized string similar to Checking upgrade hotfix status. /// @@ -24966,6 +24975,24 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Unsupported StorageLink SR is present.. + /// + public static string PROBLEM_UNSUPPORTED_STORAGELINK_SR { + get { + return ResourceManager.GetString("PROBLEM_UNSUPPORTED_STORAGELINK_SR", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove StorageLink SR before upgrading.. + /// + public static string PROBLEM_UNSUPPORTED_STORAGELINK_SR_HELP { + get { + return ResourceManager.GetString("PROBLEM_UNSUPPORTED_STORAGELINK_SR_HELP", resourceCulture); + } + } + /// /// Looks up a localized string similar to vApp {0}. /// @@ -28957,6 +28984,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to StorageLink SR status. + /// + public static string STORAGELINK_UPGRADE_TEST { + get { + return ResourceManager.GetString("STORAGELINK_UPGRADE_TEST", resourceCulture); + } + } + /// /// Looks up a localized string similar to StorageLink Storage Pool. /// diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index ad8ded08c..12850f496 100644 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -2201,6 +2201,9 @@ Do you want to assign it to the policy '{2}' instead? Checking StorageLink connections + + Checking StorageLink status + Checking storage connections status @@ -8683,6 +8686,12 @@ The VM protection policy for this VM does not have automatic archiving configure An error has occurred while attempting to connect to Storage Link Gateway: \n\n{0}\n\nPlease review the settings for this host and reconnect. + + Unsupported StorageLink SR is present. + + + Remove StorageLink SR before upgrading. + vApp {0} @@ -10031,6 +10040,9 @@ Do you want to connect to the pool master '{1}'? Unable to connect to StorageLink server on {0}. + + StorageLink SR status + Storage Pools