Using Libvirt / KVM on Ubuntu 16.04
Compiled against library: libvirt 1.3.1
Using library: libvirt 1.3.1
Using API: QEMU 1.3.1
Running hypervisor: QEMU 2.5.0
# dpkg -s qemu-kvm | grep Version
Version: 1:2.5+dfsg-5ubuntu10.
Is it safe to set the "MaxMemory" (reference) above the total physical memory of the host machine, if "currentMemory" will never exceed the actual available memory on the host machine?
Imagine a situation like:
- Host machine has 8GB of RAM
- VM is configured with 16GB of "MaxMemory", and 4GB of "currentMemory"
... is it possible for the VM to in any way utilize more than the currentMemory to crash the host, especially during the boot process?
To quote from the referenced link, "currentMemory" refers to:
The actual allocation of memory for the guest.
Which seems to imply the real limit of the VM's memory use is the "currentMemory"; however, this quote:
The run time maximum memory allocation of the guest.
... which is in reference to the "MaxMemory" sort of implies "at run time" maybe it can use more than the currentMemory?
Can someone shed some light on this? The way I sort of assume this all works is that KVM boots the VM and tells it that it has the "MaxMemory" available to it, and then shortly after that tells the VM that it can only use the "currentMemory". I'm concerned there may be a bit of a race condition there where the VM might be allowed to quickly claim the "MaxMemory". Though I suppose even if it did, OOM Killer would likely just kill the VM's process on the host machine.
The reason I want to do this is so that I can live migrate to other hosts which potentially can give 16GB of "currentMemory", even if it's not possible on the host machine the VM is originally configured on.