[
https://issues.apache.org/jira/browse/CLOUDSTACK-10321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16395040#comment-16395040
]
ASF GitHub Bot commented on CLOUDSTACK-10321:
---------------------------------------------
rafaelweingartner commented on a change in pull request #2482:
CLOUDSTACK-10321: CPU Cap for KVM
URL: https://github.com/apache/cloudstack/pull/2482#discussion_r173748358
##########
File path:
plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
##########
@@ -1984,6 +1984,24 @@ protected String getUuid(String uuid) {
return uuid;
}
+ /**
+ * Set quota and period tags on 'ctd' when CPU limit use is set
+ */
+ protected void setQuotaAndPeriod(VirtualMachineTO vmTO, CpuTuneDef ctd) {
+ if (vmTO.getLimitCpuUse() && vmTO.getCpuQuotaPercentage() != null) {
+ Double cpuQuotaPercentage = vmTO.getCpuQuotaPercentage();
+ int period = CpuTuneDef.DEFAULT_PERIOD;
+ int quota = (int) (period * cpuQuotaPercentage);
+ if (quota < CpuTuneDef.MIN_QUOTA) {
+ quota = CpuTuneDef.MIN_QUOTA;
Review comment:
what about some logging and documentation explaining why and when this
happen?
The logginf to show this change is useful for operators to understand why
the value they configure is not being used.
----------------------------------------------------------------
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:
[email protected]
> 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)