You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2018/03/08 16:04:42 UTC

[GitHub] nvazquez opened a new pull request #2482: CLOUDSTACK-10321: CPU Cap for KVM

nvazquez opened a new pull request #2482: CLOUDSTACK-10321: CPU Cap for KVM
URL: https://github.com/apache/cloudstack/pull/2482
 
 
   JIRA Ticket: https://issues.apache.org/jira/browse/CLOUDSTACK-10321
   
   ## Context
   Libvirt has the concept of a 'period' and a 'quota'. If the period is 10000 microseconds, a quote can be set, say 5000 and the VM CPU will be limited to only using 5000 microseconds of CPU every 10000 microseconds. 
   This patch basically looks at the host CPU MHz (say 2000 MHz), looks at the VM's configured MHz (say 500 MHz), comes up with a percent (25%), then uses that against the period to come up with a quota number (2500). Additionally, it only applies appropriately when the service offering has the CPU cap option set/checkmarked.
   
   ## Solution
   These changes are restricted to the KVM hypervisor plugin, where creation of a VM (spec) will consider CPU cap (max speed) defined in the service offering to define and set quota/limits in the VM?s spec. This will set quota based on a fixed/pre-defined period value, and add respective flag/nodes in the VM/domain XML as documented here: https://libvirt.org/formatdomain.html#elementsCPUTuning 
   
   ## Behavior
   - Setting the CPU cap option on a service offering must cause the VM created with that CPU offering, to run at the MHz value set until the core it is running on becomes contended (under KVM)
   - If the CPU cap option is set in a service offering and the core that a VM is running on becomes contended, then (under KVM) the VM should receive the appropriate MHz according to its and the other VMs MHz values translated as 'shares' values.  (this is the current behaviour for contended and uncontended cores).

----------------------------------------------------------------
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


With regards,
Apache Git Services