lima
lima copied to clipboard
Implement the snapshot commands
For making qcow2 snapshots of the running virtual machine.
It is possible to make multiple snapshots, in the diffdisk.
Closes #1051
limactl start
limactl snapshot create default --tag snap
limactl snapshot list default
limactl snapshot apply default --tag snap
limactl stop
limactl snapshot delete default --tag snap
This has similar problems to the pause commands, in that the ssh mux is not too happy about the restore ?
- https://github.com/lima-vm/lima/pull/642
Adding basic implementation of "del" and "list", will rewrite as per comments above.
$ _output/bin/limactl backup --tag tag alpine
INFO[0000] Sending HMP savevm command
$ _output/bin/limactl restore --list alpine
Snapshot list:
ID TAG VM SIZE DATE VM CLOCK
1 tag 274 MiB 2022-09-21 19:34:50 00:02:39.937
$ _output/bin/limactl backup --tag tag --rm alpine
INFO[0000] Sending HMP delvm command
$ _output/bin/limactl restore --list alpine
$
Thanks, the CLI design looks good, could you update the docs and integration tests?
Left to do is adding integration tests, for the limactl snapshot sub-commands.
Some help with the integration tests for snapshots would be appreciated. 🙏
Integration tests can be added like this https://github.com/lima-vm/lima/blob/4a4cc62749c1ad5d781054981dd1da19de1202bf/hack/test-example.sh#L24 https://github.com/lima-vm/lima/blob/4a4cc62749c1ad5d781054981dd1da19de1202bf/hack/test-example.sh#L240-L267
Snapshot worked on default (and alpine, but failed on experimental/9p ?
TEST| [INFO] Testing online snapshots
time="2022-11-16T20:21:20Z" level=info msg="Sending HMP savevm command"
TEST| [INFO] snapshot list: expected=snap1 got=
Error: ERROR] snapshot list did not return expected value
Need to see if there is a better way to return errors, after running HMP/QMP...
Now it is at least logging the real problem:
"output: Error: Migration is disabled when VirtFS export path '/tmp/lima' is mounted in the guest using mount_tag 'mount1'\r\n"
So this means that snapshots won't work with 9p mounts, while the instance is still running.
EDIT: Disabled the online tests for 9p, still running offline tests.
Trimmed off the extra whitespace, from the output.
Could you rebase to rerun the CI?
It would be nice, if the generated command help stayed out of the README....
Sorry needs rebase again
CI failing
+ set +x
TEST| [INFO] Testing online snapshots
time="2023-05-09T05:21:18Z" level=info msg="Sending HMP savevm command"
time="2023-05-09T05:21:26Z" level=info msg="Sending HMP info command"
TEST| [INFO] snapshot list: expected=snap1 got=snap1
time="2023-05-09T05:21:26Z" level=info msg="Sending HMP loadvm command"
Timed out!
CI for experimental/net-user-v2.yaml seems consistenly failing
CI for
experimental/net-user-v2.yamlseems consistenly failing
Looks like the net-user-v2 does not survive an "online" VM restore.
So it needs to be excluded.
"net-user-v2")
CHECKS["port-forwards"]=""
CHECKS["user-v2"]=1
;;
It already was, for 9p.
"9p")
CHECKS["snapshot-online"]=""
;;