What is the best practice for overcommiting memory with libvirt and kvm ?
Long story -
I have a small and underutilized server running multiple VMs (both host and guest running centos 7.4) most of the VMs are not critical and are mostly used for testing. a couple VMs are more important than the other ones and should have the option to utilze almost the whole memory of the server if they are being heavily used.
I started with just giving every VM the maximum memory it might ever need, but that just used all the server RAM and most of it's SWAP and on top of it had ksmd running like crazy even though all VMs together aren't using even 30% of the server RAM.
I than tried naively setting up currentMemory to be about 1/4 of the maximum memory for all VMs. But it doesn't seem like the available memory to the guest increase as more memory is being used and once the guest uses all of the available currentMemory it will start to fail.
I than tried to use MOM from the oVirt project which can work with libvirt but information online is quite old (~2011) and though the project seem to be maintained I found the documentation to be incomplete and initial setup difficult and buggy.
After getting everything to run and looking at the balloon.rules policy code it seem like though it can work for my use case the default policy is probably too basic and I will need to write a policy that will better support my use case which seem cumbersome especially when documentation is lacking.
So I'm hopping there is a better solution or approach I might be missing