lima
lima copied to clipboard
Override parameters in template file from cli
Description
Hi. I wonder if it's possible to override template parameters via limactl? For example:
limactl start --name=default --template=default.yml --cpus=1 --memory=2GiB
If it's not very difficult I can contribute with some guidance.
can be related to https://github.com/lima-vm/lima/issues/545
--cpus=1 --memory=2GiB
I'd prefer this to support JSON paths like --set .cpus=1 --set .memory=2GiB
This has been discussed multiple times before. One still unresolved challenge is where to store the manual overrides. Editing/merging this into the user-provided lima.yaml
is difficult if you want to preserve existing comments etc.
I guess we could store them in a separate file for per-instance overrides...
Another thing to consider: I believe you should be able to change settings this was as well, so this should work:
limactl start --name=default template://default --set .cpus=1 --set .memory=8GiB
limactl stop
limactl start --set .cpus=6
And now the instance should be running with 6 CPUs and 8 GiB of memory.
This has been discussed multiple times before. One still unresolved challenge is where to store the manual overrides. Editing/merging this into the user-provided
lima.yaml
is difficult if you want to preserve existing comments etc.I guess we could store them in a separate file for per-instance overrides...
Another thing to consider: I believe you should be able to change settings this was as well, so this should work:
limactl start --name=default template://default --set .cpus=1 --set .memory=8GiB limactl stop limactl start --set .cpus=6
And now the instance should be running with 6 CPUs and 8 GiB of memory.
Agree, actually any solution is fine by me.
I guess we could store them in a separate file for per-instance overrides...
SGTM
limactl start --set .cpus=6
I feel this should be limactl edit --set .cpus=6
.
The limactl start
command should accept --set
only for new instances.