cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CLOUDSTACK-10321) CPU Cap for KVM
Date Mon, 12 Mar 2018 14:23:01 GMT

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-10321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16395303#comment-16395303
] 

ASF GitHub Bot commented on CLOUDSTACK-10321:
---------------------------------------------

nvazquez commented on a change in pull request #2482: CLOUDSTACK-10321: CPU Cap for KVM
URL: https://github.com/apache/cloudstack/pull/2482#discussion_r173813069
 
 

 ##########
 File path: server/src/com/cloud/hypervisor/KVMGuru.java
 ##########
 @@ -52,10 +59,49 @@ protected KVMGuru() {
         super();
     }
 
+    /**
+     * Retrieve host max CPU speed
+     */
+    protected double getHostCPUSpeed(HostVO host) {
+        return host.getSpeed();
+    }
+
+    protected double getVmSpeed(VirtualMachineTO to) {
+        return to.getMaxSpeed() != null ? to.getMaxSpeed() : to.getSpeed();
+    }
+
+    /**
+    * Set VM CPU quota percentage with respect to host CPU on 'to' if CPU limit option is
set
+    * @param to vm to
+    * @param vmProfile vm profile
+    */
+    protected void setVmQuotaPercentage(VirtualMachineTO to, VirtualMachineProfile vmProfile)
{
+        if (to.getLimitCpuUse()) {
+            VirtualMachine vm = vmProfile.getVirtualMachine();
+            HostVO host = _hostDao.findById(vm.getHostId());
+            if (host == null) {
+                throw new CloudRuntimeException("Host with id: " + vm.getHostId() + " not
found");
 
 Review comment:
   No problem. Thanks @rafaelweingartner for your review!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> CPU Cap for KVM
> ---------------
>
>                 Key: CLOUDSTACK-10321
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10321
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>            Reporter: Nicolas Vazquez
>            Assignee: Nicolas Vazquez
>            Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message