Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • allocation_ratio: What amount of overcommitment do we allow? For the example above we see a ratio of "16.0" for VCPU, meaning that we allow reserving 16 times as many virtual CPU's as we have physical CPUs. Each megabyte of memory we only allow to reserve once.
  • min_unit: The smallest reservation we allow of a certain resource. This is per default 1 for all resources. Setting this to "4096" for the MEMORY_MB resource would for instance make sure that the specific provider only allows VM's with at least 4GB of memory. 
  • max_unit: The largest reservation we allow of a certain resource. This is per default all the resources available, allowing a single VM to take all available resources, but can be changed as we like. For instance we could set the VCPU's max_unit to 4 to only allow VM's with up to 4 CPU's on this provider.
  • reserved: Some resources can be reserved for the hypervisor. Defaults to 512 MB RAM, but this value should probably be a bit higher for our large compute-nodes to consider the amount of memory used for page-tables and such.
  • step_size: What increments do we allow in resource reservations? Do we allow 1, 2, 3, 4 CPU's, or only 2 and 4? Step size can limit the sizes we allow.
  • total: The amount of resources the provider have of the given type. The example above have 16 VCPU's, and with an allocation_ratio of 16 that means that the provider allows a total reservation of 256 VCPUs.

Modify resource inventory

Limit VM-sizes for a node:

To limit a certain compute-node to only allow 1-2 VCPU's we can use the following command:

Code Block
$ openstack resource provider inventory set --resource VCPU:max_unit=2 --amend e5956494-254f-4556-b942-2a899700f173
+----------------+------------------+----------+----------+----------+-----------+-------+
| resource_class | allocation_ratio | min_unit | max_unit | reserved | step_size | total |
+----------------+------------------+----------+----------+----------+-----------+-------+
| VCPU           |             16.0 |        1 |        2 |        0 |         1 |    12 |
| MEMORY_MB      |              1.1 |        1 |    64265 |      512 |         1 | 64265 |
| DISK_GB        |              1.0 |        1 |     8814 |        0 |         1 |  8814 |
+----------------+------------------+----------+----------+----------+-----------+-------+

Allow RAM overcommitment:

To change the allocation-ratio for memory you could use the following command:

...

Now the compute-node allows an 10% overcommitment with the regards to memory. 

Change all compute-nodes inventory

It is also possible to change the allocation_ratio for all compute-nodes with a oneliner:

...