The -balloon support has been added to KVM instances (
http://code.google.com/p/ganeti/issues/detail?id=173 ). But changing the
amount of memory available to the instance requires to manually interact
with the control file
echo balloon 256 | socat - UNIX-CLIENT:sileht.tetaneutral.net.monitor
which is inconvenient and needs to be done after each reboot.
In the attached patch, we implemented the gnt-instance "balloon" command
and the "memory" KVM parameter.
When the user does gnt-instance balloon --memory XXX INSTANCE it will
a) send the balloon XXX command to the monitor of the INSTANCE ,
b) change the "memory" KVM parameter to XXX by calling _ParseArgs
as if gnt-instance modify -H memory=XXX INSTANCE was run and
execute the returned function.
When the KVM instance is run ( at the end of _ExecuteKVMRuntime ) the
balloon XXX command is sent to the monitor of the instance, if XXX > 0
the balloon driver uses the required memory as soon as possible.
We would very much like to hear your thoughts about how it is done.
We've not been
able to find an example of a dynamicaly modified KVM parameter requiring
with the monitor. There is a good chance that our approach is completly
wrong and we
would be gratefull if someone could point us in the right direction.