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 client
  • The openrc file containing appropriate credentials
  • The 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 ...

Get OpenStack Cloud Computing Cookbook - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.