* 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>
Further changes
* implemented similar logic for the Commands too as those are keep on getting updates so affected
* moved these static fields to a class (at Images)
* used the same casing as in Resources once they have been moved
Signed-off-by: Gabor Apati-Nagy <gabor.apati-nagy@citrix.com>
Added a check for default_template as a workaround an issue where the allowed_operations of a default template _initially_ indicated that cross pool migration was allowed.
Signed-off-by: Gabor Apati-Nagy <gabor.apati-nagy@citrix.com>
The resume on server uses the CrossPoolMigrateCommand to implement the migration of the VM to the desired host. Before this change that command had no support for resuming a VM after migrating it, so the VM was not resumed. With this change, the CrossPoolMigrateWizard can take an optional (default false) parameter to restart the VM after migration. When this is true, the migrate action becomes a MultipleAction, first migrating and then restarting the VM.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
The reported bug was that the new VM would crash because when clicking through the wizard the pool master is selected by default, not the slave the VM snapshot is on. We already select a default host when a new VM is created from a selected host using HostAncestor, but this property is null for a template (which isn't in the server/VM tree). The fix is that if the selection is a template (which it is when we use new VM from Snapshot) then we instead use its host (using Home()) as the default host. Now the correct host is selected in the VM wizard and the VM creation succeeds.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>