xapi-project / xen-api

The Xapi Project's XenAPI Server
http://xenproject.org/developers/teams/xapi.html
Other
346 stars 283 forks source link

Reduce freeze time when suspending a VM #5683

Open benjamreis opened 1 month ago

benjamreis commented 1 month ago

For now when a VM is suspended, its freezed for whole suspend call. This can create long downtime for VM when we checkpoint them as the checkpoint triggers a suspension.

This is cause because the emu manager is not called with the live flag. Would it be a good idea to give the flag (as we do for live migration) so that during the suspension AMAP RAM is copied on the suspend VDI before the VM freezes and the downtime would only happen when copying the last part of the RAM.

What do you guys think?

cf-tubaf commented 1 month ago

To explain this issue further: Taking a Snapshot for a VM with RAM included, freezes the whole VM for the Period of time the RAM is saved to disk. It would be better to do it like in live migration to create pointers, copy the RAM when the Vm is still running and not freezed and do iterations to copy the rest of the RAM so that the downtime of the VMs is minimized to only 1s for instance instead of 3 Minutes.

psafont commented 1 month ago

There's a big issue to fix before it can work: When creating the suspend VDI, its size is estimated. This can't be done with the live flag because it's an iterative process that depends on guest activity, meaning it can't be estimated at all.

I'm not sure how this may be solved, maybe some VDI resizing is needed, or deduplication in the VM memory.