Skip to content

Commit ee2b19f

Browse files
committed
templates: remove vz, vmnet, etc. in favor of the limactl CLI args
- `experimental/vz`: Merged into the default template in Lima v1.0. See also <https://lima-vm.io/docs/config/vmtype/>. - `vmnet`: Removed in Lima v1.0. Use `limactl create --network=lima:shared template://default` instead. See also <https://lima-vm.io/docs/config/network/>. - `experimental/net-user-v2`: Removed in Lima v1.0. Use `limactl create --network=lima:user-v2 template://default` instead. See also <https://lima-vm.io/docs/config/network/>. - `experimental/9p`: Removed in Lima v1.0. Use `limactl create --vm-type=qemu --mount-type=9p template://default` instead. See also <https://lima-vm.io/docs/config/mount/>. - `experimental/virtiofs-linux`: Removed in Lima v1.0. Use `limactl create --mount-type=virtiofs template://default` instead. See also <https://lima-vm.io/docs/config/mount/>. Signed-off-by: Akihiro Suda <[email protected]>
1 parent f1babc0 commit ee2b19f

File tree

11 files changed

+44
-175
lines changed

11 files changed

+44
-175
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,17 @@ jobs:
217217
strategy:
218218
fail-fast: false
219219
matrix:
220+
# Most templates use 9p as the mount type
220221
template:
221222
- alpine.yaml
222-
- debian.yaml
223+
- debian.yaml # reverse-sshfs
223224
- fedora.yaml
224225
# cloud-init 24.3.1-1 package has a regression: https://github.com/lima-vm/lima/issues/2714
225226
# - archlinux.yaml
226227
- opensuse.yaml
227-
- experimental/net-user-v2.yaml
228-
- experimental/9p.yaml
229228
- docker.yaml
230229
- ../hack/test-templates/alpine-iso-9p-writable.yaml # Covers alpine-iso.yaml
231-
- ../hack/test-templates/test-misc.yaml
230+
- ../hack/test-templates/test-misc.yaml # net-user-v2
232231
steps:
233232
- uses: actions/checkout@v4
234233
with:
@@ -345,13 +344,15 @@ jobs:
345344
run: make
346345
- name: Install
347346
run: make install
347+
- name: "Adjust LIMACTL_CREATE_ARGS"
348+
run: echo "LIMACTL_CREATE_ARGS=${LIMACTL_CREATE_ARGS} --network=lima:shared" >>$GITHUB_ENV
348349
- name: "Inject `no_timer_check` to kernel cmdline"
349350
# workaround to https://github.com/lima-vm/lima/issues/84
350-
run: ./hack/inject-cmdline-to-template.sh templates/vmnet.yaml no_timer_check
351-
- name: Cache image used by vmnet.yaml
351+
run: ./hack/inject-cmdline-to-template.sh templates/default.yaml no_timer_check
352+
- name: Cache image used by default .yaml
352353
uses: ./.github/actions/setup_cache_for_template
353354
with:
354-
template: templates/vmnet.yaml
355+
template: templates/default.yaml
355356
- name: Install test dependencies
356357
run: brew install qemu bash coreutils iperf3
357358
- name: Install socket_vmnet
@@ -376,7 +377,7 @@ jobs:
376377
timeout_minutes: 30
377378
retry_on: error
378379
max_attempts: 3
379-
command: ./hack/test-templates.sh templates/vmnet.yaml
380+
command: ./hack/test-templates.sh templates/default.yaml
380381
- if: always()
381382
uses: ./.github/actions/upload_failure_logs_if_exists
382383

cmd/limactl/start.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,20 @@ func loadOrCreateInstance(cmd *cobra.Command, args []string, createOnly bool) (*
132132
templateName := filepath.Join(templateURL.Host, templateURL.Path)
133133
logrus.Debugf("interpreting argument %q as a template name %q", arg, templateName)
134134
switch templateName {
135+
case "experimental/vz":
136+
logrus.Warn("template://experimental/vz was merged into the default template in Lima v1.0. See also <https://lima-vm.io/docs/config/vmtype/>.")
135137
case "experimental/riscv64":
136138
logrus.Warn("template://experimental/riscv64 was merged into the default template in Lima v1.0. Use `limactl create --arch=riscv64 template://default` instead.")
137139
case "experimental/armv7l":
138140
logrus.Warn("template://experimental/armv7l was merged into the default template in Lima v1.0. Use `limactl create --arch=armv7l template://default` instead.")
141+
case "vmnet":
142+
logrus.Warn("template://vmnet was removed in Lima v1.0. Use `limactl create --network=lima:shared template://default` instead. See also <https://lima-vm.io/docs/config/network/>.")
143+
case "experimental/net-user-v2":
144+
logrus.Warn("template://experimental/net-user-v2 was removed in Lima v1.0. Use `limactl create --network=lima:user-v2 template://default` instead. See also <https://lima-vm.io/docs/config/network/>.")
145+
case "experimental/9p":
146+
logrus.Warn("template://experimental/9p was removed in Lima v1.0. Use `limactl create --vm-type=qemu --mount-type=9p template://default` instead. See also <https://lima-vm.io/docs/config/mount/>.")
147+
case "experimental/virtiofs-linux":
148+
logrus.Warn("template://experimental/virtiofs-linux was removed in Lima v1.0. Use `limactl create --mount-type=virtiofs template://default` instead. See also <https://lima-vm.io/docs/config/mount/>.")
139149
}
140150
if st.instName == "" {
141151
// e.g., templateName = "deprecated/centos-7" , st.instName = "centos-7"

examples/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ Container orchestration:
4949
- [`experimental/u7s`](./experimental/u7s.yaml): [Usernetes](https://github.com/rootless-containers/usernetes): Rootless Kubernetes
5050

5151
Optional feature enablers:
52-
- [`vmnet`](./vmnet.yaml): ⭐enable [`vmnet.framework`](../docs/network.md)
53-
- [`experimental/9p`](./experimental/9p.yaml): [experimental] use 9p mount type
54-
- [`experimental/virtiofs-linux`](./experimental/9p.yaml): [experimental] use virtiofs mount type for Linux
55-
- [`experimental/net-user-v2`](./experimental/net-user-v2.yaml): [experimental] user-v2 network
56-
to enable VM-to-VM communication without root privilege
5752
- [`experimental/vnc`](./experimental/vnc.yaml): [experimental] use vnc display and xorg server
5853
- [`experimental/alsa`](./experimental/alsa.yaml): [experimental] use alsa and default audio device
5954

@@ -68,8 +63,13 @@ Lost+found:
6863
- ~`nomad`~: Removed in Lima v0.17.1, as Nomad is [no longer free software](https://github.com/hashicorp/nomad/commit/b3e30b1dfa185d9437a25830522da47b91f78816)
6964
- ~`centos-stream-8`~: Remove in Lima v0.23.0, as CentOS Stream 8 reached [EOL](https://blog.centos.org/2023/04/end-dates-are-coming-for-centos-stream-8-and-centos-linux-7/).
7065
- ~`deprecated/centos-7`~: Remove in Lima v0.23.0, as CentOS 7 reached [EOL](https://blog.centos.org/2023/04/end-dates-are-coming-for-centos-stream-8-and-centos-linux-7/).
66+
- ~`experimental/vz`~: Merged into the default template in Lima v1.0. See also <https://lima-vm.io/docs/config/vmtype/>.
7167
- ~`experimental/armv7l`~: Merged into the `default` template in Lima v1.0. Use `limactl create --arch=armv7l template://default`.
7268
- ~`experimental/riscv64`~: Merged into the `default` template in Lima v1.0. Use `limactl create --arch=riscv64 template://default`.
69+
- ~`vmnet`~: Removed in Lima v1.0. Use `limactl create --network=lima:shared template://default` instead. See also <https://lima-vm.io/docs/config/network/>.
70+
- ~`experimental/net-user-v2`~: Removed in Lima v1.0. Use `limactl create --network=lima:user-v2 template://default` instead. See also <https://lima-vm.io/docs/config/network/>.
71+
- ~`experimental/9p`~: Removed in Lima v1.0. Use `limactl create --vm-type=qemu --mount-type=9p template://default` instead. See also <https://lima-vm.io/docs/config/mount/>.
72+
- ~`experimental/virtiofs-linux`~: Removed in Lima v1.0. Use `limactl create --mount-type=virtiofs-linux template://default` instead. See also <https://lima-vm.io/docs/config/mount/>.
7373

7474
## Tier
7575

examples/experimental/9p.yaml

Lines changed: 0 additions & 37 deletions
This file was deleted.

examples/experimental/net-user-v2.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

examples/experimental/virtiofs-linux.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.

examples/experimental/vz.yaml

Lines changed: 0 additions & 35 deletions
This file was deleted.

examples/vmnet.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

hack/common.inc.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ if [[ ${BASH_VERSINFO:-0} -lt 4 ]]; then
2222
ERROR "Bash version is too old: ${BASH_VERSION}"
2323
exit 1
2424
fi
25+
26+
: "${LIMA_HOME:=$HOME/.lima}"

hack/test-templates.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ case "$NAME" in
5656
# ● run-r2b459797f5b04262bfa79984077a65c7.service loaded failed failed /usr/bin/systemctl start man-db-cache-update
5757
CHECKS["systemd-strict"]=
5858
;;
59-
"vmnet")
60-
CHECKS["vmnet"]=1
61-
;;
6259
"test-misc")
6360
CHECKS["disk"]=1
6461
CHECKS["snapshot-online"]="1"
@@ -67,10 +64,6 @@ case "$NAME" in
6764
CHECKS["provision-ansible"]="1"
6865
CHECKS["param-env-variables"]="1"
6966
;;
70-
"net-user-v2")
71-
CHECKS["port-forwards"]=""
72-
CHECKS["user-v2"]=1
73-
;;
7467
"docker")
7568
CONTAINER_ENGINE="docker"
7669
;;
@@ -81,6 +74,21 @@ if limactl ls -q | grep -q "$NAME"; then
8174
exit 1
8275
fi
8376

77+
# Create ${NAME}-tmp to inspect the enabled features.
78+
# TODO: skip downloading and converting the image here?
79+
# shellcheck disable=SC2086
80+
"${LIMACTL_CREATE[@]}" ${LIMACTL_CREATE_ARGS} --name="${NAME}-tmp" "$FILE"
81+
case "$(yq '.networks[].lima' "${LIMA_HOME}/${NAME}-tmp/lima.yaml")" in
82+
"shared")
83+
CHECKS["vmnet"]=1
84+
;;
85+
"user-v2")
86+
CHECKS["port-forwards"]=""
87+
CHECKS["user-v2"]=1
88+
;;
89+
esac
90+
limactl rm -f "${NAME}-tmp"
91+
8492
if [[ -n ${CHECKS["port-forwards"]} ]]; then
8593
tmpconfig="$HOME/lima-config-tmp"
8694
mkdir -p "${tmpconfig}"

hack/test-templates/test-misc.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ probes:
5858
# $ limactl disk create data --size 10G
5959
additionalDisks:
6060
- "data"
61+
62+
networks:
63+
- lima: user-v2

0 commit comments

Comments
 (0)