mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-24 22:06:59 +01:00
CA-361078: Parse OVFs without a Limit
element in the vCPUs section
VMWare OVFs don't export the value Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
This commit is contained in:
parent
8493ee5e90
commit
a578b6924c
@ -533,13 +533,14 @@ namespace XenAdmin.Actions.OvfActions
|
||||
//There may be more than one entries corresponding to CPUs
|
||||
//The VirtualQuantity in each one is Cores
|
||||
|
||||
foreach (RASD_Type rasd in rasds)
|
||||
foreach (var rasd in rasds)
|
||||
{
|
||||
cpuCount += rasd.VirtualQuantity.Value;
|
||||
// CA-361078: Older versions of CHC/XC used to set the limit to 100,000 by default, and use
|
||||
// VirtualQuantity for max vCPUs.
|
||||
// This way, we keep backwards compatibility with older OVFs.
|
||||
maxCpusCount += rasd.Limit.Value >= 100_000 ? rasd.VirtualQuantity.Value : rasd.Limit.Value;
|
||||
var limit = rasd.Limit?.Value ?? 100_000;
|
||||
maxCpusCount += limit >= 100_000 ? rasd.VirtualQuantity.Value : limit;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user