fix(xo-server/VM/create): compute quotas from user inputs (#3546)

Fixes #2683
This commit is contained in:
Pierre Donias 2018-10-17 14:55:48 +02:00 committed by Julien Fontanet
parent e76603ce7e
commit 37a906a233
2 changed files with 5 additions and 2 deletions

View File

@ -20,6 +20,7 @@
- [Backups] Fix stuck backups due to broken NFS remotes [#3467](https://github.com/vatesfr/xen-orchestra/issues/3467) (PR [#3534](https://github.com/vatesfr/xen-orchestra/pull/3534))
- [New VM] Fix missing cloud config when creating multiple VMs at once in some cases [#3532](https://github.com/vatesfr/xen-orchestra/issues/3532) (PR [#3535](https://github.com/vatesfr/xen-orchestra/pull/3535))
- [VM] Fix an error when an admin tried to add a disk on a Self VM whose resource set had been deleted [#2814](https://github.com/vatesfr/xen-orchestra/issues/2814)
- [Self/Create VM] Fix some quotas based on the template instead of the user inputs [#2683](https://github.com/vatesfr/xen-orchestra/issues/2683)
### Released packages

View File

@ -68,10 +68,12 @@ export async function create (params) {
const xapi = this.getXapi(template)
const objectIds = [template.id]
const cpus = extract(params, 'CPUs')
const memoryMax = extract(params, 'memoryMax')
const limits = {
cpus: template.CPUs.number,
cpus: cpus !== undefined ? cpus : template.CPUs.number,
disk: 0,
memory: template.memory.dynamic[1],
memory: memoryMax !== undefined ? memoryMax : template.memory.dynamic[1],
vms: 1,
}
const vdiSizesByDevice = {}