diff --git a/XenAdmin/Commands/Controls/MigrateVMToolStripMenuItem.cs b/XenAdmin/Commands/Controls/MigrateVMToolStripMenuItem.cs index 8656fe55b..9733907c1 100644 --- a/XenAdmin/Commands/Controls/MigrateVMToolStripMenuItem.cs +++ b/XenAdmin/Commands/Controls/MigrateVMToolStripMenuItem.cs @@ -57,7 +57,7 @@ namespace XenAdmin.Commands protected override void AddAdditionalMenuItems(SelectedItemCollection selection) { - if (selection.ToList().All(item => Helpers.TampaOrGreater(item.Connection))) + if (selection.ToList().All(item => Helpers.TampaOrGreater(item.Connection) && !Helpers.CrossPoolMigrationRestrictedWithWlb(item.Connection))) { VMOperationCommand cmd = new CrossPoolMigrateCommand(Command.MainWindowCommandInterface, selection); DropDownItems.Add(new ToolStripSeparator()); diff --git a/XenAdmin/Commands/Controls/VMOperationToolStripMenuItem.cs b/XenAdmin/Commands/Controls/VMOperationToolStripMenuItem.cs index 330864d74..67a80b0be 100644 --- a/XenAdmin/Commands/Controls/VMOperationToolStripMenuItem.cs +++ b/XenAdmin/Commands/Controls/VMOperationToolStripMenuItem.cs @@ -162,6 +162,8 @@ namespace XenAdmin.Commands base.DropDownItems.Insert(hostMenuItems.IndexOf(menuItem) + 1, menuItem); } }); + + Program.Invoke(Program.MainWindow, () => AddAdditionalMenuItems(selection)); } private void EnableAppropriateHostsNoWlb(Session session) diff --git a/XenAdmin/Commands/CrossPoolMigrateCommand.cs b/XenAdmin/Commands/CrossPoolMigrateCommand.cs index bfbc5280f..195e58ae6 100644 --- a/XenAdmin/Commands/CrossPoolMigrateCommand.cs +++ b/XenAdmin/Commands/CrossPoolMigrateCommand.cs @@ -114,7 +114,7 @@ namespace XenAdmin.Commands return !failureFound && vm.allowed_operations != null && vm.allowed_operations.Contains(vm_operations.migrate_send) && - !Helpers.WlbEnabledAndConfigured(vm.Connection) && + !Helpers.CrossPoolMigrationRestrictedWithWlb(vm.Connection) && vm.SRs.ToList().All(sr=> sr != null && !sr.HBALunPerVDI) && (preselectedHost == null || vm.Connection.Resolve(vm.resident_on) != preselectedHost); //Not the same as the pre-selected host } diff --git a/XenAdmin/Wizards/CrossPoolMigrateWizard/Filters/WlbEnabledFilter.cs b/XenAdmin/Wizards/CrossPoolMigrateWizard/Filters/WlbEnabledFilter.cs index 5152cbac4..764b61da8 100644 --- a/XenAdmin/Wizards/CrossPoolMigrateWizard/Filters/WlbEnabledFilter.cs +++ b/XenAdmin/Wizards/CrossPoolMigrateWizard/Filters/WlbEnabledFilter.cs @@ -58,9 +58,9 @@ namespace XenAdmin.Wizards.CrossPoolMigrateWizard.Filters bool targetWlb = false; if(ItemToFilterOn != null) - targetWlb = Helpers.WlbEnabledAndConfigured(ItemToFilterOn.Connection); + targetWlb = Helpers.CrossPoolMigrationRestrictedWithWlb(ItemToFilterOn.Connection); - bool sourceWlb = preSelectedVMs.Any(vm => Helpers.WlbEnabledAndConfigured(vm.Connection)); + bool sourceWlb = preSelectedVMs.Any(vm => Helpers.CrossPoolMigrationRestrictedWithWlb(vm.Connection)); reason = targetWlb ? Messages.CPM_WLB_ENABLED_ON_HOST_FAILURE_REASON : Messages.CPM_WLB_ENABLED_ON_VM_FAILURE_REASON; diff --git a/XenModel/Utils/Helpers.cs b/XenModel/Utils/Helpers.cs index e6f3fb427..987a905be 100755 --- a/XenModel/Utils/Helpers.cs +++ b/XenModel/Utils/Helpers.cs @@ -491,6 +491,11 @@ namespace XenAdmin.Core return (p != null && !String.IsNullOrEmpty(p.wlb_url)); } + public static bool CrossPoolMigrationRestrictedWithWlb(IXenConnection conn) + { + return WlbEnabledAndConfigured(conn) && !DundeeOrGreater(conn); + } + #region AllocationBoundsStructAndMethods public struct AllocationBounds {