lima
lima copied to clipboard
delete all instances at once
It'd be nice to delete all instances at once by using --all flag provided in the delete command.
$ limactl list
NAME STATUS SSH ARCH CPUS MEMORY DISK DIR
buildkit Stopped 127.0.0.1:0 x86_64 4 4GiB 100GiB /Users/batuhan.apaydin/.lima/buildkit
default Stopped 127.0.0.1:0 x86_64 4 4GiB 100GiB /Users/batuhan.apaydin/.lima/default
$ limactl delete --all
INFO[0000] The QEMU process seems already stopped
INFO[0000] The host agent process seems already stopped
INFO[0000] Removing *.pid *.sock under "/Users/batuhan.apaydin/.lima/buildkit"
INFO[0000] Removing "/Users/batuhan.apaydin/.lima/buildkit/ha.sock"
INFO[0000] Deleted "buildkit" ("/Users/batuhan.apaydin/.lima/buildkit")
INFO[0000] The QEMU process seems already stopped
INFO[0000] The host agent process seems already stopped
INFO[0000] Removing *.pid *.sock under "/Users/batuhan.apaydin/.lima/default"
INFO[0000] Deleted "default" ("/Users/batuhan.apaydin/.lima/default")
- [ ] limactl delete --all should show a warning and an "Are you sure?" prompt and require a --tty=false option to skip the prompt.
- [ ] limactl delete --all --force, should remove all the instances even if they are working, once we remove the --force flag, it should prompt an info message to warn me there are some working instances, are you ok to delete them?
- [ ] limactl delete --all something to be an error; if you specify --all, you must not specify any instance names.
please feel free to assign it to me. I'm willing to work on that.
Or use xargs ?
Usually I just use limactl rm -f $(limactl ls -q)
yes, both actions would work and great, but IMO, to support --all flag is the easiest way of doing this 🙈
I know that podman has it, and docker does not. Seems to be mostly the tool developers, wanting the nuclear option ?
https://docs.podman.io/en/latest/markdown/podman-rm.1.html
--all, -a
Remove all containers. Can be used in conjunction with -f as well.
Normally you don't have so many VMs, that it becomes an issue
I'm unsure about making it too easy for users to blow away all their instances. I wonder if limactl delete --all should show a warning and an "Are you sure?" prompt, and require a --tty=false option to skip the prompt.
Question: what would limactl delete --all do when some instances are still running? Delete the ones that are stopped, or show and error and do nothing.
Also, I would expect limactl delete --all something to be an error; if you specify --all you must not specify any instance names.
hello @jandubois, great advices, thank you so much. I converted them to an action item in the PR's description to specify the definition of done of the issue. ✌️
- it should prompt an info message to warn me there are some working instances, are you ok to delete them?
I think in that case the command should show an error message and tell the user to re-run the command with the --force option. It should not delete the stopped instances either when it can't delete all of them.