Changing virtual CPU overcommitment

You can configure the number of virtual CPUs that can be provisioned for virtual machines by setting the vCPU overcommitment ratio on a particular node or on all of the compute nodes. This is the ratio of the number of virtual CPUs to physical. The default ratio is 8, which means that you can provision eight times over the number of physical CPUs available on a compute node. By increasing the ratio on a compute node, you can increase the number of virtual machines running on this node but potentially reduce their performance.

To change vCPU overcommitment per cluster

Use the command vinfra service compute set with the --nova-compute-cpu-allocation-ratio option. For example, to set the vCPU overcommitment ratio to 16, run:

# vinfra service compute set --nova-compute-cpu-allocation-ratio 16.0

To check that the ratio is successfully modified, execute the vinfra service compute show command:

# vinfra service compute show
+--------------+-------------------------------------------+
| Field        | Value                                     |
+--------------+-------------------------------------------+
| <...>        | <...>                                     |
| options      | cpu_model: ''                             |
|              | custom_params:                            |
|              | - config_file: nova.conf                  |
|              |   property: cpu_allocation_ratio          |
|              |   section: DEFAULT                        |
|              |   service_name: nova-compute              |
|              |   value: 16.0                             |
| <...>        | <...>                                     |
+--------------+-------------------------------------------+

To change vCPU overcommitment per node

Use the command vinfra service compute set with the --nova-compute-cpu-allocation-ratio option and specify particular nodes with the --nodes option. For example, to set the vCPU overcommitment ratio to 16 on the node node001, run:

# vinfra service compute set --nova-compute-cpu-allocation-ratio 16.0 --nodes node001

To check that the ratio is successfully modified, execute the vinfra service compute node show command:

# vinfra service compute node show node001
+----------------+------------------------------------------+
| Field          | Value                                    |
+----------------+------------------------------------------+
| custom_params  | - config_file: nova.conf                 |
|                |   property: cpu_allocation_ratio         |
|                |   section: DEFAULT                       |
|                |   service_name: nova-compute             |
|                |   value: 16.0                            |
| fenced_reason  |                                          |
| host           | node001.vstoragedomain                   |
| <...>          | <...>                                    |
+----------------+------------------------------------------+

To disable vCPU overcommitment per cluster

Change the ratio to 1 by running:

# vinfra service compute set --nova-compute-cpu-allocation-ratio 1

To disable vCPU overcommitment per node

Change the node overcommitment ratio to the default cluster value by setting it to 0:

# vinfra service compute set --nova-compute-cpu-allocation-ratio 0 --node node001