Skip to content

CPU speed in compute offering is not a MHz speed when using KVM and libvirt.  #6743

@correajl

Description

@correajl
ISSUE TYPE
  • Improvement Request
COMPONENT NAME
Cloudstack management and cloudstack agent. 
CLOUDSTACK VERSION
4.17.0.1
CONFIGURATION

2 management servers, 2 databases, advanced network, everything working fine.

OS / ENVIRONMENT

Ubuntu Server 22.04 LTS, KVM, libvirt 8.0.0-1ubuntu7.1, cgroup2.

SUMMARY

The value "CPU (in MHz)" used by Compute Offerings has nothing to do with the CPU speed when using KVM. The value configured as "CPU (in MHz)" is mapped to "shares" element in the cputune section of libvirt configuration of domain (KVM). This mapping is done using this

int minSpeed = (int)(newServiceOffering.getSpeed() / (divideCpuByOverprovisioning ? cpuOvercommitRatio : 1));

So, if I have a 1000 Mhz value in compute offering and try to launch a VM with 80 CPUs, I will get 80000 configured as 'shares' value. 'Shares' is a relative value that defines how much CPU time a VM will have when compared to others. This description in MHz is very confusing.

The second problem is why is this value required when creating a custom constrained compute offering? Why couldn't we just inform the number of CPUs and memory to limit the ranges that service offering permits? In UI the value is required. Looking at
createServiceOffering API definition the only two required parameters are displaytext and name. But trying to create I have:

~# create serviceoffering name="Custom VM" displaytext="Custom VM" storagetype=shared provisioningtype=fat mincpunumber=2 maxcpunumber=80 minmemory=1000 maxmemory=1000000 offerha=true dynamicscalingenabled=true
Error: (HTTP 431, error code 4350) For creating a custom compute offering min/max cpu and min/max memory/cpu speed should all be null or all specified

My first suggestion is to permit the creation of a compute offering without inform this value. If this is not possible for some reason, so my suggestion is to change the description of this value in some way. For KVM users/admins, this MHz notation is so confusing.

STEPS TO REPRODUCE

In UI the value "CPU (in MHz)" when creating a custom constrained compute offering not to be required. The same when using API.

Or, change the "CPU (in MHz)" to something more representative, that makes more sense.

EXPECTED RESULTS

Do not inform "CPU (in MHz)" or have a better description when using KVM as hypervisor.

ACTUAL RESULTS

Sometimes, depending on the value entered in "CPU (in MHz)" the hypervisor can't launch the instance.

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions