Setting CPU limits for a flavor
In addition to defining the number of vCPUs assigned to an instance, limits on the use of these CPU cycles can be further imposed. Nova relies on the underlying hypervisor for the specific implementation of the CPU limits, and thus the values available may vary. Our example is based on QEMU/KVM.
CPU limits are a special case of flavor attributes that you may encounter.
Getting ready
To add a CPU limit to a flavor, you will need the following:
The
openstack
command-line clientThe
openrc
file containing appropriate credentialsThe name of the flavor to change
The values you would like to set the CPU limit to (share of time the allotted CPU is allowed to consume in milliseconds per cycle)
These values in our example are as follows:
cpu_quota
= 5000 mscpu_period
= 2500 ms
How to do it…
The following commands are used to add CPU limits to a flavor.
Note
CPU limits are not applied live. Rather, they are applied on instance launch.
At the time of this writing, the openstack...