From d82861727db1e74f2d9e463f4986db253bf09f91 Mon Sep 17 00:00:00 2001 From: wescoeur Date: Wed, 6 Apr 2016 17:32:51 +0200 Subject: [PATCH] api.vm: Set vcpus max. --- src/api/vm.coffee | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/api/vm.coffee b/src/api/vm.coffee index d1107c877..f2f9a1a50 100644 --- a/src/api/vm.coffee +++ b/src/api/vm.coffee @@ -455,6 +455,9 @@ set = $coroutine (params) -> yield xapi.call 'VM.set_VCPUs_max', ref, "#{CPUs}" yield xapi.call 'VM.set_VCPUs_at_startup', ref, "#{CPUs}" + if 'cpusMax' of params + yield xapi.call 'VM.set_VCPUs_max', ref, "#{CPUs}" + # HA policy # TODO: also handle "best-effort" case if 'high_availability' of params @@ -509,6 +512,8 @@ set.params = { # Number of virtual CPUs to allocate. CPUs: { type: 'integer', optional: true } + cpusMax: { type: ['integer', 'string'], optional: true } + # Memory to allocate (in bytes). # # Note: static_min ≤ dynamic_min ≤ dynamic_max ≤ static_max