cloudstack/plugins
Wido den Hollander c496c84c6c kvm: Properly report available memory to Management Server (#2795)
The KVM Agent had two mechanisms for reporting its capabilities
and memory to the Management Server.

On startup it would ask libvirt the amount of Memory the Host has
and subtract and add the reserved and overcommit memory.

When the HostStats were however reported to the Management Server
these two configured values on the Agent were no longer reported
in the statistics thus showing all the available memory in the
Agent/Host to the Management Server.

This commit unifies this by using the same logic on Agent Startup
and during statistics reporting.

  memory=3069636608, reservedMemory=1073741824

This was reported by a 4GB Hypervisor with this setting:

  host.reserved.mem.mb=1024

The GUI (thus API) would then show:

  Memory Total	2.86 GB

This way the Agent properly 'lies' to the Management Server about its
capabilities in terms of Memory.

This is very helpful if you want to overprovision or undercommit machines
for various reasons.

Overcommitting can be done when KSM or ZSwap or a fast SWAP device is
installed in the machine.

Underprovisioning is done when the Host might run other tasks then a KVM
hypervisor, for example when it runs in a hyperconverged setup with Ceph.

In addition internally many values have been changed from a Double to a Long
and also store the amount of bytes instead of Kilobytes.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
2019-01-24 20:18:04 -02:00
..
acl Merge remote-tracking branch 'origin/4.11' 2018-12-28 15:11:15 +05:30
affinity-group-processors Updating pom.xml version numbers for release 4.11.3.0-SNAPSHOT 2018-11-20 13:11:52 +00:00
alert-handlers Updating pom.xml version numbers for release 4.11.3.0-SNAPSHOT 2018-11-20 13:11:52 +00:00
api Merge remote-tracking branch 'origin/4.11' 2018-12-04 16:39:21 +05:30
ca/root-ca Updating pom.xml version numbers for release 4.11.3.0-SNAPSHOT 2018-11-20 13:11:52 +00:00
database Updating pom.xml version numbers for release 4.11.3.0-SNAPSHOT 2018-11-20 13:11:52 +00:00
dedicated-resources Updating pom.xml version numbers for release 4.11.3.0-SNAPSHOT 2018-11-20 13:11:52 +00:00
deployment-planners Updating pom.xml version numbers for release 4.11.3.0-SNAPSHOT 2018-11-20 13:11:52 +00:00
event-bus Updating pom.xml version numbers for release 4.11.3.0-SNAPSHOT 2018-11-20 13:11:52 +00:00
ha-planners/skip-heurestics Updating pom.xml version numbers for release 4.11.3.0-SNAPSHOT 2018-11-20 13:11:52 +00:00
host-allocators/random Updating pom.xml version numbers for release 4.11.3.0-SNAPSHOT 2018-11-20 13:11:52 +00:00
hypervisors kvm: Properly report available memory to Management Server (#2795) 2019-01-24 20:18:04 -02:00
integrations Updating pom.xml version numbers for release 4.11.3.0-SNAPSHOT 2018-11-20 13:11:52 +00:00
metrics Updating pom.xml version numbers for release 4.11.3.0-SNAPSHOT 2018-11-20 13:11:52 +00:00
network-elements Updating pom.xml version numbers for release 4.11.3.0-SNAPSHOT 2018-11-20 13:11:52 +00:00
outofbandmanagement-drivers Updating pom.xml version numbers for release 4.11.3.0-SNAPSHOT 2018-11-20 13:11:52 +00:00
storage Allow KVM VM live migration with ROOT volume on file storage type (#2997) 2018-12-14 09:01:28 -02:00
storage-allocators/random Updating pom.xml version numbers for release 4.11.3.0-SNAPSHOT 2018-11-20 13:11:52 +00:00
user-authenticators Updating pom.xml version numbers for release 4.11.3.0-SNAPSHOT 2018-11-20 13:11:52 +00:00
pom.xml Updating pom.xml version numbers for release 4.11.3.0-SNAPSHOT 2018-11-20 13:11:52 +00:00