Product SiteDocumentation Site

13.2. Memory Management

The API provides two choices for a host's memory management:
Kernel SamePage Merging (KSM) uses the ksm element, which is a read-only element.
Example 13.5. KSM memory management
<host id="2ab5e1da-b726-4274-bbf7-0a42b16a0fc3"
  href="/rhevm-api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3">
    <name>zig</name>
    <status>UP</status>
    ...
    <ksm>true</ksm>
</host>

Transparent Hugepage support uses the transparent_hugepages element and updates with a PUT request:
Example 13.6. Transparent Hugepage memory management
PUT /rhevm-api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3 HTTP/1.1
Accept: application/xml
Content-Type: application/xml

<host>
    <transparent_hugepages>true</transparent_hugepages>
</host>

This request also sets the status of ksm to the opposite status. For example, if transparent_hugepages is set to true, the API sets ksm to false.
Example 13.7. Transparent Hugepage set to true, which sets KSM to false
<host id="2ab5e1da-b726-4274-bbf7-0a42b16a0fc3"
  href="/rhevm-api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3">
    <name>zig</name>
    <status>UP</status>
    ...
    <transparent_hugepages>true</transparent_hugepages>
    <ksm>false</ksm>
</host>

If transparent_hugepages is set to false, the API sets ksm to true.
Example 13.8. Transparent Hugepage set to false, which sets KSM to true
<host id="2ab5e1da-b726-4274-bbf7-0a42b16a0fc3"
  href="/rhevm-api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3">
    <name>zig</name>
    <status>UP</status>
    ...
    <transparent_hugepages>false</transparent_hugepages>
    <ksm>true</ksm>
</host>

Availability of Transparent Hugepage support is found in the capabilities collection. See Section 7.1.2, “Features”.