Here is something you probably did not know – dynamic memory can actually help with live migration of virtual machines. When you live migrate a virtual machine that has dynamic memory enabled, we perform some tricks to help with the overall migration process. Particularly, when you live migrate the virtual machine, we do not add more memory to the virtual machine for the entire process (okay, there is a timeout where if things are taking too long we will assume that something has gone wrong and will start normal operations again).
We also “squeeze” the virtual machines prior to live migration. This process is a little bit complicated – so lets dive in:
First we look at the priority of the virtual machine. This determines how much we squeeze the virtual machine by. A low priority virtual machine will get squeezed down to “only as much memory as it needs”, while a high priority virtual machine will be squeezed down to “half the memory buffer you requested” (and middle priority will be somewhere in the middle). This memory squeeze has two advantages:
- It reduces the amount of data we have to transfer over the network, thus reducing the overall live migration time.
- It reduces the amount of memory needed to start the virtual machine on the destination server, increasing the likelihood of a successful live migration.
Once we have completed the live migration – we return all the dynamic memory behaviors back to normal and the virtual machine is able to continue on its way.