Commit Graph

12 Commits

Author SHA1 Message Date
Danilo Del Busso
afb419af04
CP-44767, CP-44766 & CP-44765: Refactor usage of VM restrictions and add reference_label to OVFs (#3211)
* Tidy up `VM` extension: use `var`
* Tidy up `VM` extension: remove redundant initialisers
* Tidy up `VM` extension: use type keywords when possible
* Tidy up `VM` extension: merge conditional expressions
* Tidy up `VM` extension: remove redundant qualifiers
* Tidy up `VM` extension: remove redundant type arguments
* Tidy up `VM` extension: remove redundant `else`s and parentheses
* Tidy up `VM` extension: fix naming
* Tidy up `VM` extension: misc changes
* Tidy up `VM` extension: use `null` propagation
* Tidy up `VM` extension: fix whitespace
* Tidy up `VM` extension: apply ReSharper Code Cleanup utility
* Tidy up `VM` extension: Fix naming of private string array
* CP-44767: Ignore VM restriction when fetching `MaxVCPUsAllowed`
Instead, fetch the highest available value in all templates for the host.
This means that VMs imported from vhd won't automatically default to `DEFAULT_NUM_VCPUS_ALLOWED`, and that VMs that have been kept across XenServer upgrades won't be limited to the number of vCPUs in their own (possibly outdated) restrictions
* CP-44766: Use value in template with a matching `reference_label` when checking VM restrictions
* Move restriction getters to own region
* CP-44766: Use matching templates to fetch VM restrictions
- Rewrite `GetRestrictions...` methods to perform simpler operations
- Add `GetIntRestrictionValue` and `GetBoolRestrictionValue` wrappers to `GetRestrictionValueFromMatchingTemplate`
- Now all calls to a restrictions first check the template value, with a fall-back to defaults
* CP-44765: Export `reference-label` when generating OVFs
---------

Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
2023-09-29 03:45:17 +01:00
Konstantina Chremmou
d7b519a53c Updated copyright notice on files.
Signed-off-by: Konstantina Chremmou <Konstantina.Chremmou@cloud.com>
2023-01-30 16:24:16 +00:00
Konstantina Chremmou
abf4ae3f35 CP-36392 pt.1: Removed unused using directives.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
2021-04-07 10:04:47 +01:00
Michael Zhao
7c8b2f6d40 CA-271850: Increase the timeout of session for querying MaximumTolerableHostFailures. 2018-03-20 07:09:34 +00:00
Callum McIntyre
e77b8f9445 [CP-24974] Avoid calculatingVM agility/failure tolerance twice
This is caused by the `waitingNtolUpdate.waitOne()` call being at the end of the loop, not the beginning. The reason is that the `waitingNtolUpdate` is set during the first iteration (before the thread even gets loaded) - because the setter for Settings in this file sets it (and that's set by the setter for AssignPriorites.Connection, which is set in the HAWizard constructor). So when the thread first spawns we do the calculations, then get to the `waitOne` lock, which is set so we go back around the loop and calculate everything again before returning to the lock and waiting to be triggered. The correct behaviour is to trigger only once on the page load, and then only when re-triggered. To achieve that I've moved the `waitOne` call to the beginning of the loop, so that (assuming the `waitingNtolUpdate` lock is set before the thread is first started) we immediately run the calculations and then stop at the beginning of the loop waiting to be triggered again. This means that on page load (and after each re-trigger) we only calculate once.

The assumption that the lock is set before the thread is triggered is currently valid, because as mentioned above it's currently set by the setter for Settings which is indirectly called by the wizard constructor. I don't want to rely on that behaviour though because it's very indirect, so just to be safe I've added an explicit set just before the thread is triggered so that it's guaranteed to run the calculations the first time. This isn't strictly necessary but seems better than relying on the existing implicit setting. Since we use the same mechanism just in a different place, all the existing code that sets `waitingNtolUpdate` continues to trigger this thread as expected.
2017-10-06 14:07:31 +01: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
Konstantina Chremmou
f165cef307 CA-104329: Do not re-iterate through the datagridview rows to retrieve the VMs'
restart settings when leaving the page. Get the already calculated value from the
tolerance indicator instead.
2016-12-13 09:10:26 +00:00
Konstantina Chremmou
d35c162e76 CP-17689: Restrict maximum host failures to tolerate to the number specified by the other-config:hci-limit-fault-tolerance field. 2016-06-29 12:57:29 +01:00
Gabor Apati-Nagy
aefed11165 Revert "CA-149867: Invoke on MainWindow instead of various controls"
This reverts commit 92f0499911.
2015-04-16 14:17:02 +01:00
Gabor Apati-Nagy
92f0499911 CA-149867: Invoke on MainWindow instead of various controls
We observed that some threads can reach deadlock-ish state after they have Invoked into a control's UI thread. When it happens they are all in a waiting for join or in sleep state for very long time, although there should not be any deadlock situations.
It seems this has something to do with multiple parent controls and with which control we invoked on. This should not make a difference, because we have got one UI thread (for MainWindow) they should wait for, but we have seen it does.

The solution that fixed this issue was to invoke on the MainWindow instead of various controls (see a4fe507adf ).

This changeset is changing all our Invokes to invoke into MainWindow
instead of a control itself. (MainWindow's UI thread is the only UI thread
all Control is using in XenCenter)
This changeset should be in place until we have found the root cause or the exact reason for the above.
2015-04-08 15:16:10 +01:00
Stephen Turner
f6cfb5bd7e In preparation for [CA-112247], change an abstract base class into non-abstract, because there is a Designer bug that can't load controls derived from ABCs. 2014-04-15 11:58:12 +01:00
Mihaela Stoica
bd36a85bff CP-4816: Initial commit to git repo
Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
2013-06-24 12:41:48 +01:00