Closed Shashwatsh closed 6 years ago
It is a rare case, but if you really want, you can do it via <cputune>
element and if
statements inside domain xml template. Something like:
<domain>
...
<cputune>
{{ if eq .Plan.Name "small" }}
<shares>512</shares>
{{ else }}
<shares>1024</shares>
{{ end }}
<cputune>
...
</domain>
http://libvirt.org/formatdomain.html#elementsCPUTuning https://vmango.org/docs/configuration/hypervisor/#machine-templates https://golang.org/pkg/text/template/
ok i read the docs but still does 512 shares mean 50% of the CPU?
The short answer is 'no' :) You should look into period
and quota
.
so technically, shares is soft limit and hard limit is quota / period so, if i want 25% of the CPU then i could do quota to 25000 and period to 100000. am i correct?
Yes, for hard limits you need to use quota and period, but I cant provide you any hints about it, because I have never used this feature.
So, I think this issue has been resolved.
Indeed, apologies for not closing this issue i didn't notice it.
How do i limit the CPU allowance to 25% of a single core (for example: 1 ghz of physical 4gz core) is there a way to hard limit this?