Changing parameters in OpenStack configuration files

You can modify the following parameters in the OpenStack configuration files:

Parameter Configuration file Description Value
ram_weight_multiplier /etc/kolla/nova-scheduler/nova.conf Defines how compute nodes with available RAM are weighed. With a positive value, virtual machines are placed on nodes with more available RAM, and thus, evenly spread across all compute nodes. In this case, however, you may end up unable to launch large VMs on particular nodes while having plenty of free RAM in the entire cluster. To optimize VM distribution and fill up nodes as much as possible, you can set this parameter to a negative value. Valid values are integer or float. The default value is 1.0.
scheduler_host_subset_size /etc/kolla/nova-scheduler/nova.conf Defines a number of compute nodes best suited for a new VM, one of which is randomly chosen by the scheduler. Valid values are 1 or greater. Any value less than 1 is treated as 1. The higher the value, the less optimal the chosen node may be for a VM. The default value is 1.
vxlan_udp_port /etc/kolla/neutron-openvswitch-agent/ml2_conf.ini Specifies the UDP port used for VXLAN tunnels. When changing the port, iptables rules are automatically configured for both the old and new ports. The default port is 4789.
cpu_allocation_ratio /etc/kolla/nova-compute/nova.conf

Defines the virtual CPU to physical CPU allocation ratio.

Changing CPU allocation ratio will not affect virtual CPUs already provisioned for virtual machines.

Valid values are positive integer or float. The default value is 8.0.
ram_allocation_ratio /etc/kolla/nova-compute/nova.conf

Defines the maximum reserved RAM to physical RAM allocation ratio.

Changing RAM allocation ratio will not affect RAM already provisioned for virtual machines.

Valid values are positive integer or float. The default value is 1.0. The maximum recommended value is 1.5.

To change a compute parameter

Use the following command:

vinfra service compute set [--custom-param <service_name> <config_file> <section> <property> <value>]
                           [--nova-scheduler-ram-weight-multiplier <value>]
                           [--nova-compute-ram-allocation-ratio <value>]
                           [--neutron-openvswitch-vxlan-port <value>]
                           [--nova-scheduler-host-subset-size <value>]
                           [--nova-compute-cpu-allocation-ratio <value>]
--custom-param <service_name> <config_file> <section> <property> <value>

Set custom parameters for OpenStack configuration files:

  • service_name is the service name: nova-scheduler, nova-compute, or neutron-openvswitch-agent
  • config_file specifies the service configuration file: nova.conf for nova-scheduler and nova-compute, or ml2_conf.ini for neutron-openvswitch-agent
  • section specifies the section in the service configuration file where the parameter is defined: DEFAULT in nova.conf or agent in ml2_conf.ini
  • property is the parameter to be changed: ram_weight_multiplier, ram_allocation_ratio, scheduler_host_subset, and cpu_allocation_ratio in nova.conf; vxlan_udp_port in ml2_conf.ini
  • value is a new parameter value
--nova-scheduler-ram-weight-multiplier <value>
Shortcut for --custom-param nova-scheduler nova.conf DEFAULT ram_weight_multiplier <value>
--nova-compute-ram-allocation-ratio <value>
Shortcut for --custom-param nova-compute nova.conf DEFAULT ram_allocation_ratio <value>
--neutron-openvswitch-vxlan-port <value>
Shortcut for --custom-param neutron-openvswitch-agent ml2_conf.ini agent vxlan_udp_port <value>
--nova-scheduler-host-subset-size <value>
Shortcut for --custom-param nova-scheduler nova.conf DEFAULT scheduler_host_subset_size <value>
--nova-compute-cpu-allocation-ratio <value>
Shortcut for --custom-param nova-scheduler nova.conf DEFAULT cpu_allocation_ratio <value>

For example, to change ram_weight_multiplier and vxlan_udp_port, run:

# vinfra service compute set --nova-scheduler-ram-weight-multiplier -1 --neutron-openvswitch-vxlan-port 4787

To check that the custom parameters are successfully modified, run:

# vinfra service compute show
| Field        | Value                                     |
| <...>        | <...>                                     |
| options      | cpu_model: ''                             |
|              | custom_params:                            |
|              | - config_file: nova.conf                  |
|              |   property: ram_weight_multiplier         |
|              |   section: DEFAULT                        |
|              |   service_name: nova-scheduler            |
|              |   value: -1.0                             |
|              | - config_file: ml2_conf.ini               |
|              |   property: vxlan_udp_port                |
|              |   section: agent                          |
|              |   service_name: neutron-openvswitch-agent |
|              |   value: 4787                             |
|              | notification_forwarding: disabled         |
| status       | active                                    |

The applied changes are consistent on all compute nodes and not overwritten after product updates and upgrades.