Bug 2214362
| Summary: | VM with containerDisk does not run when "Auto CPU Limit" feature enabled and ResourceQuota has limits.cpu=1 | ||
|---|---|---|---|
| Product: | Container Native Virtualization (CNV) | Reporter: | Denys Shchedrivyi <dshchedr> |
| Component: | Virtualization | Assignee: | Jed Lejosne <jlejosne> |
| Status: | ASSIGNED --- | QA Contact: | Kedar Bidarkar <kbidarka> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 4.14.0 | CC: | acardace, jlejosne |
| Target Milestone: | --- | ||
| Target Release: | 4.14.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | Bug | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Denys Shchedrivyi
2023-06-12 18:29:06 UTC
This is a valid concern, and a nice catch! The auto CPU limit feature was indeed created to work together with quotas to allow admins to control how many vCPUs users can create. And yes, a quota of 1 sounds like users should be allowed to create 1 VM with 1 CPU. However, in reality, more things might require CPU resources, like containerdisks as pointed out here. Disk hotplug is another concern, and maybe other things... I don't see a viable way to address that in the code, and it's probably something we need to defer to documentation. Most admins probably know if users will use container-disks/disk-hotplug and can account for it in their quota (10m per container-disk, 100m for disk-hotplug). Otherwise, for each vCPU admins want to allocate their users, they can add 1.2 (1200m) to the quota (instead of 1), which should be plenty (enables disk-hotplug + 10 containerdisks per VM). @jlejosne How do we want to proceed here? Is this something we can address in KubeVirt? The second paragraph above should mostly answer your question. In extreme use-cases, like when using auto CPU limit + a really small CPUAllocationRatio + few vCPUs + disk-hotplug/containerdisks, virt-launcher will need more that 1 host CPU per vCPU. Documentation should therefore tell cluster admins that creating CPU quotas equal to the number of vCPUs used by VMs may not be enough. We can make this simple with some quick math though. A 1 vCPU VM that uses disk-hotplug and 10 containerdisks (worst case scenario) will need 200m extra CPU. So, as long as CPUAllocationRatio is set at or above... 2(?) everything will work fine. (If I understand it right, 2 means 500m CPU per vCPU, so plently left for overhead). To keep the documentation simple, we could just say "do not use auto CPU limits with a CPUAllocationRatio of 1. We could also enforce that in HCO when validating the CR. |