Hi Fabrice,

The "hugepages" custom property value in oVirt should be set to size of the pages in KiB (i.e. 1GiB = 1048576, 2MiB = 2048).
In addition, it is recommended to set the huge page size of the VM to the largest size supported by the host.

In the configuration you sent, the huge page size of the VM is set to 64 KiB and since the VM's allocated memory size is at least 32,768 MiB then it requires at least (32768 * 1024/64=) 524,288 pages. Since you only have 120 pages declared in the host then it failed with an error "...there are not enough free huge pages to run the VM".


So to solve the problem, please change the VM's huge page size to be the same as the host's huge page supported size which is 1GiB and therefore hugepages value should be 1048576 KiB instead of 64:
<custom_property>
      <name>hugepages</name>
      <value>1048576</value>
</custom_property>


Please note that since total VM's memory size is no more than 64 GB then only 64 pages will be needed by the VM and it's < 120 pages supported by the host and therefore OK.

Hope it helped.

Regards,
Sharon

On Wed, Nov 14, 2018 at 2:11 PM, Fabrice Bacchella <fabrice.bacchella@orange.fr> wrote:
I'm trying to understand huge page in oVirt, I'm quite sure to understand it well.

I have an host with 128GiB. I have configured reserved huge page:

cat /proc/cmdline 

... hugepagesz=1GB hugepages=120

$ grep -r . /sys/kernel/mm/hugepages
/sys/kernel/mm/hugepages/hugepages-1048576kB/nr_overcommit_hugepages:0
/sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages:120
/sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages_mempolicy:120
/sys/kernel/mm/hugepages/hugepages-1048576kB/surplus_hugepages:0
/sys/kernel/mm/hugepages/hugepages-1048576kB/resv_hugepages:0
/sys/kernel/mm/hugepages/hugepages-1048576kB/free_hugepages:120
/sys/kernel/mm/hugepages/hugepages-2048kB/nr_overcommit_hugepages:0
/sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages:0
/sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages_mempolicy:0
/sys/kernel/mm/hugepages/hugepages-2048kB/surplus_hugepages:0
/sys/kernel/mm/hugepages/hugepages-2048kB/resv_hugepages:0
/sys/kernel/mm/hugepages/hugepages-2048kB/free_hugepages:0

I have a big VM running on it:
  <custom_properties>
    <custom_property>
      <name>hugepages</name>
      <value>64</value>
    </custom_property>
  </custom_properties>
  <memory>68719476736</memory>, aka 
65536 MiB
  <memory_policy>
    <guaranteed>34359738368</guaranteed>, aka 
32768 MiB
    <max>68719476736</max>
  </memory_policy>

And it keep failing when I want to start it:
/var/log/ovirt-engine/engine.log:2018-11-14 12:56:06,937+01 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-66) [13c13a2c-f973-4ba2-b8bd-260e5b35a047] EVENT_ID: USER_FAILED_RUN_VM(54), Failed to run VM XXX due to a failed validation: [Cannot run VM. There is no host that satisfies current scheduling constraints. See below for details:, The host XXX did not satisfy internal filter HugePages because there are not enough free huge pages to run the VM.]

The huge page fs is mounted:

$ findmnt
| |-/dev/hugepages1G                  hugetlbfs      hugetlbfs   rw,relatime,pagesize=1G
| `-/dev/hugepages                    hugetlbfs      hugetlbfs   rw,relatime

What am I missing ?

_______________________________________________
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-leave@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/VTYKTSSAXQQLS5HO5KOQSBDIHPTAHTOR/