Add provisioned memory to node info

Adds a separate field to the node memory, "provisioned", which totals
the amount of memory provisioned to all VMs on the node, regardless of
state, and in contrast to "allocated" which only counts running VMs.

Allows for the detection of potential overprovisioned states when
factoring in non-running VMs.

Includes the supporting code to get this data, since the original
implementation of VM memory selection was dependent on the VM being
running and getting this from libvirt. Now, if the VM is not active, it
gets this from the domain XML instead.
This commit is contained in:
2020-10-18 14:02:34 -04:00
parent 9d7067469a
commit a4b80be5ed
6 changed files with 99 additions and 47 deletions

View File

@ -531,15 +531,18 @@ class API_Node_Root(Resource):
total:
type: integer
description: The total amount of node RAM in MB
allocated:
type: integer
description: The total amount of RAM allocated to domains in MB
used:
type: integer
description: The total used RAM on the node in MB
free:
type: integer
description: The total free RAM on the node in MB
allocated:
type: integer
description: The total amount of RAM allocated to running domains in MB
provisioned:
type: integer
description: The total amount of RAM provisioned to all domains (regardless of state) on this node in MB
parameters:
- in: query
name: limit