Change in vdsm[master]: WIP client: allow tuning of more SLA params

fromani at redhat.com fromani at redhat.com
Thu Mar 19 12:55:10 UTC 2015


Francesco Romani has uploaded a new change for review.

Change subject: WIP client: allow tuning of more SLA params
......................................................................

WIP client: allow tuning of more SLA params

still WIP, we probably don't want this.

Change-Id: I03e0900b829d49a63bef89e260ad2dc0be7e0a79
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M client/vdsClient.py
M vdsm/API.py
2 files changed, 14 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/38938/1

diff --git a/client/vdsClient.py b/client/vdsClient.py
index 546deab..7ed4c89 100644
--- a/client/vdsClient.py
+++ b/client/vdsClient.py
@@ -272,8 +272,11 @@
         return self.ExecAndExit(self.s.setNumberOfCpus(args[0], args[1]))
 
     def updateVmPolicy(self, args):
-        params = {'vmId': args[0], 'vcpuLimit': args[1]}
-        return self.ExecAndExit(self.s.updateVmPolicy(params))
+        if args[1] in ('vcpuLimit', 'vcpuQuota', 'vcpuPeriod'):
+            params = {'vmId': args[0], args[1]: args[2]}
+            return self.ExecAndExit(self.s.updateVmPolicy(params))
+        else:
+            raise ValueError('Invalid argument "%s".' % args[1])
 
     def do_changeCD(self, args):
         vmId = args[0]
@@ -2807,7 +2810,7 @@
             )),
         'updateVmPolicy': (
             serv.updateVmPolicy, (
-                '<vmId> <vcpuLimit>',
+                '<vmId> [vcpuLimit|vcpuQuota|vcpuPeriod] value',
                 'set SLA parameter for a VM'
             )),
         'externalVMList': (
diff --git a/vdsm/API.py b/vdsm/API.py
index 8151ff4..8d6f0a7 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -496,6 +496,14 @@
         # Remove the vmId parameter from params we do not need it anymore
         del params["vmId"]
 
+        vcpuQuota = params.pop('vcpuQuota', None)
+        if vcpuQuota:
+            return curVm.setCpuTuneQuota(vcpuQuota)
+
+        vcpuPeriod = params.pop('vcpuPeriod', None)
+        if vcpuPeriod:
+            return curVm.setCpuTunePeriod(vcpuPeriod)
+
         return curVm.updateVmPolicy(params)
 
     def migrate(self, params):


-- 
To view, visit https://gerrit.ovirt.org/38938
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I03e0900b829d49a63bef89e260ad2dc0be7e0a79
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list