Changing parameters in OpenStack configuration files

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

  • ram_weight_multiplier in /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 in /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 in /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 in /etc/kolla/nova-compute/nova.conf defines the virtual CPU to physical CPU allocation ratio.

    Valid values are positive integer or float. The default value is 8.0.

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

  • ram_allocation_ratio in /etc/kolla/nova-compute/nova.conf defines the maximum reserved RAM to physical RAM allocation ratio.

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

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

The parameters can be set when creating the compute cluster or afterwards by using either the --custom-param option or the shortcuts for each parameter (refer to vinfra service compute create or Changing compute cluster parameters). 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, execute the vinfra service compute show command:

# 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.