-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add snapshotting functionality #368
Comments
Silly question - I saved a snapshot, e.g.,:
And I'm wondering where it saves to?
I see it uses qemu-img here: https://github.com/lima-vm/lima/pull/1054/files#diff-25a805e06b16efefb1e5acb2009e512cca20865126e3a6afa52df59dcb4cf0fbR158 but I'm not experienced enough to know how to get it. I'd like to be able to export the VM and then, for example, import it into a cloud via storage. Or do I not need a snapshot (which is a diff) and just want one of these files here?
If the basedisk is some format I can use, or I can load the iso into a VM image (which I think I know how to do) that might fit the bill - just trying to figure out the right (or recommended) path. Thanks for the help! |
The snapshots, like the normal contents, are stored in the Both are normally in the QCOW2 file format, unless using lima-alpine in which case the basedisk is an ISO image. You can learn this, using the regular The diffdisk has the basedisk, as a "backing file". https://www.qemu.org/docs/master/system/images.html You need both files, but the basedisk is the same as in cache. The It also allows for manipulating the snapshots, but requires that the virtual machine using it is offline. |
Great, thank you! Any reason they don't have an extension so it's obvious to the untrained eye? |
No particular reason, just UNIX. Like "README", versus "README.txt"? Think I had to add DOS extensions like .img and .iso, for VirtualBox to work |
Gotcha! And super cool - thanks for giving me this nugget of info. I know about $ file basedisk basedisk: QEMU QCOW2 Image (v2), 2361393152 bytes $ file diffdisk diffdisk: QEMU QCOW2 Image (v3), has backing file (path /home/vanessa/.lima/flux-0/basedisk), 268435456000 bytes |
You can also use |
I would like to be able to create one or more snapshots of a lima vm and be able to roll back to some specified snapshot. I'm thinking this would be a copy of the qcow2 images stored in the
~/.lima/machine-name/
directory. It would be totally fine (and probably desirable) to shut the machine down before making a copy of the images.This would be useful for e.g. testing a provisioning script. I could set up the machine with a base install of ubuntu, take a snapshot, and then be able to quickly roll back to the base state of the machine without necessarily re-doing the machine from scratch. It could also be useful for testing potentially destructive operations inside the VM.
The text was updated successfully, but these errors were encountered: