Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Revert to VM snapshot instead of restarting VM #23

Open
richiejp opened this issue Jul 28, 2020 · 0 comments
Open

Revert to VM snapshot instead of restarting VM #23

richiejp opened this issue Jul 28, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@richiejp
Copy link
Collaborator

In os-autoinst we take a running VM snapshot by migrating the VM RAM/CPU to file and creating image overlays for each storage device. Then when the machine needs to be reverted, we can delete/recreate the image overlays, restart QEMU and perform a migration from file, which restores the running virtual machine.

QEMU also has a 'snapshot' feature, but it uses some of the same code as migration in addition to some features which are not well supported. So it makes sense to implement snapshots using the migration API which is very well supported.

Often reverting to a snapshot taken just after boot is faster than booting. If the RAM usage is low after boot, but systemd takes some time waiting for services to start, then it is a lot faster. This could reduce the time it takes to revert to only a few seconds.

Code reference:
https://github.com/os-autoinst/os-autoinst/blob/master/backend/qemu.pm#L280
https://github.com/os-autoinst/os-autoinst/blob/master/backend/qemu.pm#L417

FYI @shunghsiyu

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant