Commit Graph

104 Commits

Author SHA1 Message Date
Konstantina Chremmou
f05b16eff7 Do not use the task description as the AsyncAction description because in most cases it is not localised.
Also, do not poll if the RelatedTask is null.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2021-03-16 10:27:55 +00:00
Konstantina Chremmou
eb3662aa88 CA-345342: Cope with optional parameters in the HTTP_actions.
- Removed wrapper delegates; call the http_actions directly.
- In case of failure or cancellation of the http_action, poll the related task
  ignoring any exceptions thrown, so that any clean up code within the http_action's exception handling can run.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2021-02-10 23:45:23 +00:00
Konstantina Chremmou
b0eafcf1d1 Code design issue: do not override DestroyTask. Minor refactoring in VMSnapshotCreateAction.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2021-02-10 23:45:23 +00:00
Konstantina Chremmou
0598e6342d Merge remote-tracking branch 'upstream/master' into feature/REQ-797 2021-01-19 11:01:02 +00:00
Konstantina Chremmou
542a329a27 Fixed failure to start a VM after it was imported as an XVA package.
Regression introduced by the changes for CA-64500. Since we initiate a VMStartAction
we need to ensure that the VM object passed to the action has a non-null Connection.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2020-12-18 01:34:25 +00:00
Konstantina Chremmou
84d0a2b8ae Bad application of the code reusability principle in VMDestroyAction.
Destroying a VM does not disrupt the connection, hence the use of the BestEffort
method is not warranted. After this correction, BestEffort is only used in the
DestroyedBondAction, hence I removed it completely and replaced it with simpler
exception handling in the latter class's Run method.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2020-12-03 14:56:11 +00:00
Konstantina Chremmou
fbb25c7970 Minor modifications to task polling:
- Consolidated Action.PollToCompletion overloads, among others, to reduce precision loss.
- Logging the environment's stack trace is not very useful in the case of an API failure.
- Log the task's opaque_ref so it's easier to trace errors in the server side logs.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2020-10-13 15:02:31 +01:00
Konstantina Chremmou
38c88b5692 CA-64500: Offer the option to start the vApp or VM automatically after an OVF/OVA import.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2020-10-13 14:34:15 +01:00
Konstantina Chremmou
bf9f5b1308 Ensure all the CommandLib classes are defined in this namespace so as to avoid conflicts with homonymous classes from other namespaces.
- Automatic indentation fix as a consequence.
- Use proper xml doc for the various methods and classes.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2020-10-07 13:22:33 +01:00
Konstantina Chremmou
e3d6db3a80 Removed support for long retired XVA v1 packages.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2020-10-07 13:22:33 +01:00
Konstantina Chremmou
c244d8d4db CA-339584: Include CD VDI in the storage mapping for intra-pool migration
Also: removed unused method; some property modernisation; removed class
LiveMigrateOptionsVmMapping which was rather complicating things.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2020-08-11 08:46:42 +01:00
Konstantina Chremmou
db041099ef CA-339271: Improved action description. Also:
Added cancelling ability to MoveVM action; made some simplifications.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2020-06-19 14:04:59 +01:00
Konstantina Chremmou
acd3094b48 CA-314005: Proceed to setting the memory if the issued shutdown has been interrupted by a different shutdown task.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2020-06-10 23:48:54 +01:00
Konstantina Chremmou
8a478011d9 CA-339370: Assign the new VM's name at a late stage to reduce duplicate names. Some simplifications.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2020-05-19 07:49:23 +01:00
Konstantina Chremmou
5614dafbe6 CA-329742, CA-330301: Logging simplification.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2019-11-13 12:31:44 +00:00
Konstantina Chremmou
99572da0fb Corrections to the logging of Win32 exceptions. Minor refactoring.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2019-11-13 12:31:44 +00:00
Konstantina Chremmou
667e9e8caf Log the stack trace when an exception is encountered and don't use the *Format() counterpart of the logging method for it.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2019-11-13 12:31:44 +00:00
Konstantina Chremmou
fad80c778b Avoid duplicate logging; compact multiple logging calls.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2019-11-13 12:31:44 +00:00
Konstantina Chremmou
fb2edf99b8 Do not initialise a logger if a class does not use it.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2019-11-13 12:31:44 +00:00
Konstantina Chremmou
ec79720057 Do not pass the delegates showing messages as parameters to the actions, but rather have them handle action events.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2019-10-14 09:24:36 +01:00
Konstantina Chremmou
e6da7045b6 Ensure we always dispose of the ArchiveIterator and ArchiveWriter after use.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2019-08-13 10:18:15 +01:00
Lin Liu
52a9bbe257 CA-322735: Keep XenCenter showing the real device number used in the VM
Signed-off-by: Lin Liu <lin.liu@citrix.com>
2019-07-09 08:31:04 +01:00
Michael Z
372088cf43 CA-320459: Mistake in handling vGPUs when creating a VM from template.
Signed-off-by: Michael Z <michael.zhao@citrix.com>
2019-06-10 14:49:31 +08:00
Michael Z
9a26478a16 CP-31400: Collection of improvements.
1. Update AddVGPUDialog title;
2. Add label above the combobox;
3. In the combobox, add text to the entry saying if multiple vGPU is supported;
4. When the dialog is open, focus on the combobox;
5. Preselect the vGPU type if there is only one option available;
6. Setup the Help ID for dialog;
7. Optimize vGPU adding and deleting in GpuAssignAction.

Signed-off-by: Michael Z <michael.zhao@citrix.com>
2019-06-10 14:49:31 +08:00
Michael Z
9c94e4ffd0 CP-30423: Update binding; Remove hardcode for device; Simplify combobox building calculation.
Signed-off-by: Michael Z <michael.zhao@citrix.com>
2019-06-10 14:49:31 +08:00
Michael
99af56ac94 REQ-720: Initial implementation of GPUEditPage and AddVgpuDialog. (#2422)
* CP-31063: Add support for multiple vGPU
(incomplete)

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>

* CP-31063: Add support for multiple vGPU
(part 2)

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>

* AddVGPUDialog

Signed-off-by: Michael Z <michael.zhao@citrix.com>

* Update bindings.

Signed-off-by: Michael Z <michael.zhao@citrix.com>

* REQ-720: Initial implementation of AddVgpuDialog.

Signed-off-by: Michael Z <michael.zhao@citrix.com>

* Improve the handling of buttons and combobox. Fix comments.

Signed-off-by: Michael Z <michael.zhao@citrix.com>

* Fix comments.

Signed-off-by: Michael Z <michael.zhao@citrix.com>
2019-06-10 14:49:31 +08:00
Mihaela Stoica
97101ca2e8 CA-309844: Fix meddling actions
- Refactored MeddlingAction and Task classes: moved the logic for building a MeddlingAction outside the Task class and switched to using the vm_operations enum to identify which tasks are suitable for MeddlingAction

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
2019-03-15 09:42:04 +00:00
Ji Jiang
ba649634e5 CP-30602: Add boot mode info to Naples XC
Signed-off-by: Ji Jiang <ji.jiang@citrix.com>
2019-02-15 12:02:11 +00:00
Tim Liu
f0b1e6b3af CP-28676: XC: Allow choosing boot options during new VM wizard
1. Update the duplicated shortcuts on CPU&Mem Page
2. Default radio boxes invisible
3. Move hardcoded logic to VM.cs
4. BIOS boot should be always enabled
5. Move radio boxes to Installation Media page
6. Extract radio boxes as a user control
7. Update summary

Signed-off-by: Tim Liu <tim.liu@citrix.com>
2018-08-28 12:46:36 +01:00
Tim Liu
98207906d7 CP-28676: XC: Allow choosing boot options during new VM wizard
Signed-off-by: Tim Liu <tim.liu@citrix.com>
2018-08-28 12:46:36 +01:00
Konstantina Chremmou
21d6080464 Normalisation and internationalisation for exceptions thrown when failing to resolve objects in the cache.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2018-04-23 09:54:48 +01:00
Konstantina Chremmou
63c6b817d5 CA-40854: The Session's uuid is in reality its opaque_ref. Use the opaque_ref so
it's obvious what it is. The Session's uuid will be deprecated from the API bindings.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2018-02-21 14:08:01 +00:00
Konstantina Chremmou
123db499f5 Merge branch 'master' into REQ-420 2018-01-25 13:38:58 +00:00
Mihaela Stoica
f62cc5c521 CA-279502: Added check for the server version before calling VM.get_is_default_template
This fixes the error thrown when importing templates with XenCenter 7.3 on servers earlier than 7.2

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
2018-01-12 11:01:09 +00:00
Konstantina Chremmou
fb8434819d Namespace tidy 3/several: replaced XenAdmin.Core (instances in XenCenterLib) with XenCenterLib.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2017-11-30 13:56:32 +00:00
Konstantina Chremmou
a170ec33e2 Merge remote-tracking branch 'upstream/master' into REQ-420
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>

# Conflicts:
#	autogenerated XenModel/XenAPI/* files
2017-11-17 11:53:41 +00:00
Mihaela Stoica
7ac856943e CA-272143: Import wizard stuck in "Waiting for Import template wizard to complete" when importing a default template
When trying to import a default template from xva, xapi notices that it is a default template, finds an existing one on the host and returns that one.
With these changes, XenCenter handles this case and displays an error, instead of waiting for the returned VM to be linked to the import task (which never happens).

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
2017-11-09 11:31:00 +00:00
Konstantina Chremmou
673846924b Do not set API object properties that have a default value of "OpaqueRef:NULL" to null.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2017-09-14 12:48:05 +01:00
Konstantina Chremmou
915059d099 The Proxy_xxx classes should not be used outside the API bindings (in reality
these classes should have been internal).

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2017-09-14 11:52:15 +01:00
Konstantina Chremmou
514c33140b Converted remaining extension get and set properties of the API classes to methods
in order to prevent them from being serialised alongside the API properties.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2017-09-05 02:15:38 +01:00
Konstantina Chremmou
ae22560ce8 Converted all extension get properties of the API classes to methods in order to
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>
2017-09-03 03:35:30 +01:00
Stephen Turner
eda73f1dff Fix several usage errors identified by Lexica 2017-06-20 14:29:22 +01:00
Mihaela Stoica
78ad827cc4 CA-242134: Remove TampaOrGreater, its usages and unreachable code
Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
2017-05-05 14:31:43 +01:00
Mihaela Stoica
76b3c05b9a CA-250145: XenCenter cannot shutdown VM as VmPowerAdmin user if HA is enabled
The error was happening because of the Pool.sync_database call (when HA is enabled and the VM has a saved restart priority other than DoNotRestart) which requires pool admin or pool operator roles.
This call is not needed, so removing it.

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
2017-04-28 09:08:44 +01:00
Mihaela Stoica
74885674c3 CA-238901: PVS proxy not setup for imported VM
For ElyOrGreater hosts, we try move the existing VIFs to the desired networks. We will only destroy and create new ones for older hosts or when a corresponding VIF cannot be found in the network mapping.

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
2017-01-20 12:54:13 +00:00
Gabor Apati-Nagy
7c0bc50b4a CA-176169: Changed copyright statements to include the comma in Citrix Systems,
Inc.

Signed-off-by: Gabor Apati-Nagy<gabor.apati-nagy@citrix.com>
2017-01-16 19:59:50 +00:00
Mihaela Stoica
c395a8ce14 CA-233454: Fix the action test
Added an extra parameter to the CreateVmFastAction constructor, which is used to specify whether to set the VM's property IsBeingCreated. In order to set this property, we need to wait for the newly created VM to appear in the cache. But we cannot do this in the action test, because the cache is not being updated. Therefore the action needs skip this step when running from the tests. The IsBeingCreated property is only used in the UI, to refresh the PVS tab after the VM is created, so the accuracy of the action test (CreateVMFastActionTest) is not affected by this change.

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
2016-12-01 12:09:03 +00:00
mcintyre94
7f2ecb6eab [CA-233454] PVS tab doesn't show a new VM when it's created (#1314)
* [CA-233454] PVS tab doesn't show a new VM when it's created

Refined the rules for not adding a VM to the table, if it is a template (thus not_a_real_vm), and it has the __gui__ prefix (thus hidden), we still add it, but hide it.
When its name is changed (to remove the __gui__ prefix), we update its name and re-calculate whether it should be visible (in the case of a new VM this will be true once the __gui__ prefix is gone). Also resort the table if a node changes from hidden to visible, because it appears as an addition to the table.

Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>

* [CA-233454] Update criteria for VM visibility to include is_a_real_vm

is_a_template is changed before the name_label removes the __gui__ prefix, so this works with no other changes to the vm property changed event.

Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>

* [CA-233454] Update when the VMs are shown in the PVS list

New observable property IsBeingCreated for VMs, set to true when they're made a hidden object, and false when they're removed from hidden objects (both in CreateVMAction). In the PVS Page when this is set to false, we re-evaluate whether a VM can be shown. This means that new VMs show here at the same time they're added to the tree (only different is tree refresh time), instead of far earlier (and before their networks were added).

Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>

* [CA-233454] Set IsbeingCreated in the CreateVMFastAction

* [CA-233454] Properly support the VM Fast Create action

Further changes to CreateVMFastAction, to ensure it works with PVS tab - use the __gui__ prefix when the VM is created and then change it back just before showing.

* [CA-233454] Small logic adjustments/tidying up
2016-11-30 12:24:02 +00:00
Callum McIntyre
9b1a3315f0 [CA-226897] Resume on Server option won't automatically resume the VM
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>
2016-11-03 15:35:25 +00:00
Konstantina Chremmou
c7994c286d CA-227272: Ignore unresolved VDIs first, then check if the storage mapping contains
the resolved ones and then try getting the target SR from the mapping.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2016-10-28 10:57:10 +01:00