You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there are 2 ways to specify CPU when creating a Kubevirt VM instance.
In the .spec.domain.[requests, limits].cpu section
In the .spec.domain.cpu.[cores, sockets, thread] section
I believe the former applies to the launcher pod and the latter applies to the actual VM, so I believe calculating off of the latter is correct. We need to verify and adjust if needed. Here is the code:
for vm := 0; vm < len(instances); vm++ {
// according to kubevirt docs, vcpu is determined by the value of sockets * cores * threads
// see https://kubevirt.io/user-guide/compute/dedicated_cpu_resources/#requesting-dedicated-cpu-resources
sockets := int(instances[vm].Spec.Domain.CPU.Sockets)
if sockets == 0 {
sockets = 1
}
cores := int(instances[vm].Spec.Domain.CPU.Cores)
if cores == 0 {
cores = 1
}
threads := int(instances[vm].Spec.Domain.CPU.Threads)
if threads == 0 {
threads = 1
}
sum += sockets * cores * threads
}
The text was updated successfully, but these errors were encountered:
Currently, there are 2 ways to specify CPU when creating a Kubevirt VM instance.
I believe the former applies to the launcher pod and the latter applies to the actual VM, so I believe calculating off of the latter is correct. We need to verify and adjust if needed. Here is the code:
The text was updated successfully, but these errors were encountered: