This change improves the performance of the drop-down menu considerably, as it avoids the server calls from the Command.ToolTipText
Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
- added an action for the API call that retrieves the WLB VM recommendations
- removed the thread used for updating the menu items, so that we always access the menu items on the UI thread and do only the server calls on separate threads (for WLB, getting the recommendations now is done on the new action, for non-WLB we have the `workerQueueWithoutWlb`)
Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
* CA-286291: Fix the crash when quickly and repeatedly popping up Migrate-to-Server menu.
* Update the thread model.
Signed-off-by: Michael Zhao <michael.zhao@citrix.com>
* Fix an error in using _stopped flag.
* CA-284226: Reduce unnecessary CanExecute() calls.
* CA-284226: Optimize the performance of menu Migrate to Server and Start on Server.
* Fix an error in updating Migrate menu with WLB, which lead to crash.
* Clear the worker queue when menu is closed.
Signed-off-by: Michael Zhao <michael.zhao@citrix.com>
* Fix comments.
Also, changed the access modifiers of several members to private, because they don't need to be exposed outside the parent class.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
Instead of showing the cross-pool migration upsell dialog, we now show the wizard, where user can try to perform an intra-pool copy (the cross-pool option is disabled with an explanatory message displayed)
Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
We always add the VM wizard button to the migrate dropdown, but it's
currently not added until the end of the enable loop - after we've
calculated whether we can boot on each host. There's no reason to wait
until we've done all that before showing the wizard, so add it straight
away to the end of the list before the loop.
Signed-off-by: Callum McIntyre <callum.mcintyre@citrix.com>
When we right click migrate a VM we load all the hosts in the pool into
a dropdown, and then one-by-one assert whether the selected VM can boot
on that host, enabling each option where this is positive. If the
dropdown is exited then nothing stops these assert calls from
continuing, and looking at the logs we can see that they do.
With a large pool this is problematic because the UI basically locks up
until it's completed all these asserts, even if we've already selected a
host to migrate to. If we try to migrate another host then we see in the logs that both the old thread and new
thread are making `assert_can_boot_here` calls, and the UI for the new
thread doesn't function until the old one has finished.
This commit adds a new property `_isDropDownClosed`, which is set by the
new `OnDropDownClosed` event handler. In the loop enabling dropdown
items, each iteration we check this property - and if it is true then
the dropdown is no longer showing so we stop the loop and thus don't
call any more `assert_can_boot_here` commands. This stops the UI locking
up after the dropdown is closed.
Signed-off-by: Callum McIntyre <callum.mcintyre@citrix.com>
prevent them from being serialised alongside the API properties. This will also
be useful for moving the API bindings out of XenModel.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
(The member 'CanExecute()' does not hide an inherited member. The new keyword is not required)
Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
[VMSS] XC -> right click 'VM' -> Assign VM to snapshot schedule shows all policies,
even though they are not supported by VM
Signed-Off-By: Sharath Babu <sharath.babu@citrix.com>