Created
August 30, 2024 17:16
-
-
Save jmsdnns/5ba4d73bd75f1ac9ab070452dec395f2 to your computer and use it in GitHub Desktop.
A simple config for managing groups of VMs using lima and just
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: | |
just -l | |
lsvm: | |
limactl ls | |
mkvm id: | |
limactl create \ | |
--name="{{id}}" \ | |
--vm-type=vz \ | |
--rosetta \ | |
--mount-type=virtiofs \ | |
--mount-writable \ | |
--network=vzNAT \ | |
--tty=false \ | |
template://default | |
mkswarm name count: | |
for i in $(seq 1 {{count}}); do \ | |
just mkvm {{name}}-$i; \ | |
done | |
startswarm name: | |
for id in $(limactl list --format '{{{{.Name}}' | grep {{name}}); do \ | |
limactl start $id; \ | |
done | |
stopswarm name: | |
for id in $(limactl list --format '{{{{.Name}}' | grep {{name}}); do \ | |
limactl stop $id; \ | |
done | |
rmvm id: | |
limactl delete {{id}} | |
rmswarm name: | |
for id in $(limactl list --format '{{{{.Name}}' | grep {{name}}); do \ | |
just rmvm $id; \ | |
done | |
shellvm id: | |
eval $(limactl show-ssh --format=cmd "{{id}}" 2>/dev/null) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment