Enable huge pages on a active instance in Openstack

Solution Verified - Updated -

Environment

  • Red Hat OpenStack Platform 16

Issue

Instance was created without huge pages and setting the property hw:mem_page_size of the server don't have effect, even after a hard reboot.

Resolution

Create a new flavor (with huge pages), resize the instance and reboot it as below:

(overcloud) [stack@director ~]$ openstack flavor create --ram <size-mb> --disk <size-gb> --vcpus <no_reserved_vcpus> huge_pages_flavor
(overcloud) [stack@director ~]$ openstack flavor set huge_pages_flavor --property hw:mem_page_size=large
(overcloud) [stack@director ~]$ openstack server resize --wait --flavor huge_pages_flavor <instance>
(overcloud) [stack@director ~]$ openstack server resize --confirm <instance>
(overcloud) [stack@director ~]$ openstack server reboot --hard --wait <instance>

Root Cause

Huge pages cannot be added directly to the instance after it was created. This feature need to be enabled in flavor.

Diagnostic Steps

It's possible to check the configuration by the commands below:

[heat-admin@compute0 ~]# sudo grep Huge /proc/meminfo
[heat-admin@compute0 ~]# sudo numastat -m
(overcloud) [stack@director ~]$ openstack flavor show <flavor>
(overcloud) [stack@director ~]$ openstack server show <instance>
[heat-admin@compute0]# sudo podman exec -it nova_libvirt virsh dumpxml instance-00000001

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments