pkg/driver/vz: Support ASIF as diffdisk#4327
Merged
AkihiroSuda merged 6 commits intolima-vm:masterfrom Dec 1, 2025
Merged
Conversation
6e6c8b1 to
a86f7f8
Compare
AkihiroSuda
reviewed
Nov 10, 2025
AkihiroSuda
reviewed
Nov 10, 2025
AkihiroSuda
reviewed
Nov 10, 2025
4845910 to
b78a98d
Compare
Contributor
Author
|
Implemented conversion to ASIF |
566d590 to
a88474b
Compare
Contributor
Author
f165c11 to
27ffe60
Compare
AkihiroSuda
reviewed
Nov 18, 2025
AkihiroSuda
reviewed
Nov 18, 2025
AkihiroSuda
reviewed
Nov 18, 2025
AkihiroSuda
reviewed
Nov 18, 2025
AkihiroSuda
reviewed
Nov 18, 2025
AkihiroSuda
reviewed
Nov 18, 2025
caec7af to
d908a03
Compare
Contributor
Author
|
Force pushed and updated PR description. |
AkihiroSuda
reviewed
Nov 19, 2025
AkihiroSuda
reviewed
Nov 19, 2025
AkihiroSuda
reviewed
Nov 19, 2025
d908a03 to
0dde51e
Compare
Contributor
Author
|
https://github.com/lima-vm/lima/actions/runs/19491065038/job/55783186209?pr=4327#step:10:1084
Does sparsing work on clone? |
Depends on lima-vm/go-qcow2reader#61 How to setup ASIF as diffdisk: 1. Create an instance for test, then stop it. ```console $ limactl start template:ubuntu --name=asif-test --tty=false --log-level=fatal; limactl stop asif-test --log-level=fatal ``` 2. Convert `diffdisk` with ASIF image. (original will be renamed to `diffdisk.raw`) ```console $ hack/convert-diffdisk-to-asif.sh asif-test + instance=asif-test ++ limactl list asif-test --format '{{.Dir}}' + instance_dir=/Users/norio/.lima/asif-test ++ head -c 4 /Users/norio/.lima/asif-test/diffdisk + head4bytes= + case "${head4bytes}" in ++ limactl list asif-test --format '{{.Status}}' + instance_state=Stopped + [[ Stopped == \S\t\o\p\p\e\d ]] + diskutil image create blank --fs none --format ASIF --size 100GiB /Users/norio/.lima/asif-test/diffdisk.asif /Users/norio/.lima/asif-test/diffdisk.asif created ++ diskutil image attach -n /Users/norio/.lima/asif-test/diffdisk.asif + attached_device=/dev/disk5 + dd if=/Users/norio/.lima/asif-test/diffdisk of=/dev/disk5 status=progress conv=sparse 107152496640 bytes (107 GB, 100 GiB) transferred 115.003s, 932 MB/s 209715200+0 records in 209715200+0 records out 107374182400 bytes transferred in 115.228413 secs (931837727 bytes/sec) + hdiutil detach /dev/disk5 "disk5" ejected. + mv /Users/norio/.lima/asif-test/diffdisk /Users/norio/.lima/asif-test/diffdisk.raw + mv /Users/norio/.lima/asif-test/diffdisk.asif /Users/norio/.lima/asif-test/diffdisk + echo 'Converted diffdisk to ASIF format successfully' Converted diffdisk to ASIF format successfully ``` 3. Start the instance ```console $ limactl start asif-test ``` Signed-off-by: Norio Nomura <norio.nomura@gmail.com> Apply reviews - hack/convert-diffdisk-to-asif.sh: Add description of script. - pkg/driver/vz: Refine error text on detecting unexpected image type. Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
- Add `LIMA_VZ_ASIF` environment variable to use ASIF on creating diffdisk - pkg/imgutil: Add `ImageDiskManager.ConvertToASIF()` - Remove `hack/convert-diffdisk-to-asif.sh` Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
- Add `vmType.vz.diskImageFormat` that accepts "raw" or "asif"
```yaml
vmOpts:
vz:
diskImageFormat: null
# Specify the disk image format: "raw" or "asif".
# Currently only applies to the primary disk image.
# "asif" requires macOS 26+, and does not support converting back to "raw".
# 🟢 Builtin default: "raw"
```
- Dropped `LIMA_VZ_ASIF` environment variable
Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
# Conflicts:
# pkg/driver/vz/vz_driver_darwin.go
# pkg/driverutil/disk.go
Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
…onvert()` Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
0dde51e to
6b5eb41
Compare
AkihiroSuda
reviewed
Nov 21, 2025
- default.yaml: Fix comment placing - pkg/qemuimgutil: Change `QemuImageUtil.Convert` to returns error on specifying other than `raw.Type` - pkg/imgutil: Drop supported image format information from doc comment of `ImageDiskManager.Convert` Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
6b5eb41 to
cbe7241
Compare
AkihiroSuda
reviewed
Dec 1, 2025
| func EnsureDiskRaw(ctx context.Context, inst *limatype.Instance) error { | ||
| diffDisk := filepath.Join(inst.Dir, filenames.DiffDisk) | ||
| // EnsureDisk ensures that the diff disk exists with the specified size and format. | ||
| func EnsureDisk(ctx context.Context, instDir, diskSize string, diskImageFormat image.Type) error { |
Member
There was a problem hiding this comment.
diskImageFormat is ignored for ISO mode
Contributor
Author
|
Thanks! 🙏🏻 |
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Dec 26, 2025
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [lima-vm/lima](https://github.com/lima-vm/lima) | patch | `v2.0.2` → `v2.0.3` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>lima-vm/lima (lima-vm/lima)</summary> ### [`v2.0.3`](https://github.com/lima-vm/lima/releases/tag/v2.0.3) [Compare Source](lima-vm/lima@v2.0.2...v2.0.3) #### Changes - `limactl` CLI: - Fix [#​4468](lima-vm/lima#4468) "\[v2 regression] `limactl copy` (w/ rsync) puts the destination directory in an extra directory" ([#​4482](lima-vm/lima#4482)) - vz: - Fix compilation on macOS < 13 ([#​4412](lima-vm/lima#4412), [#​4438](lima-vm/lima#4438), thanks to [@​jandubois](https://github.com/jandubois) [@​razzius](https://github.com/razzius)) - Support ASIF disk format ([#​4327](lima-vm/lima#4327), thanks to [@​norio-nomura](https://github.com/norio-nomura)) - nerdctl: - Update from v2.2.0 to [v2.2.1](https://github.com/containerd/nerdctl/releases/tag/v2.2.1) ([#​4484](lima-vm/lima#4484)) - `nerdctl.lima`: respect `$LIMA_INSTANCE` ([#​4432](lima-vm/lima#4432), thanks to [@​Kim-Yukyung](https://github.com/Kim-Yukyung)) - Project: - Set up X and Mastodon accounts ([#​445](lima-vm/lima#445)) - <https://x.com/@​TheLimaProject> - <https://mastodon.social/@​TheLimaProject> Full changes: <https://github.com/lima-vm/lima/milestone/67?closed=1> Thanks to [@​EclipseAditya](https://github.com/EclipseAditya) [@​Kim-Yukyung](https://github.com/Kim-Yukyung) [@​afbjorklund](https://github.com/afbjorklund) [@​ashwat287](https://github.com/ashwat287) [@​buraksekili](https://github.com/buraksekili) [@​jandubois](https://github.com/jandubois) [@​k-veda](https://github.com/k-veda) [@​norio-nomura](https://github.com/norio-nomura) [@​paralin](https://github.com/paralin) [@​razzius](https://github.com/razzius) [@​sneugle](https://github.com/sneugle) [@​unsuman](https://github.com/unsuman) #### Usage ```console $ limactl create $ limactl start ... INFO[0029] READY. Run `lima` to open the shell. $ lima uname Linux ``` *** The binaries were built automatically on GitHub Actions. The build log is available for 90 days: <https://github.com/lima-vm/lima/actions/runs/20502264257> The sha256sum of the SHA256SUMS file itself is `4e87c2b80108bcbf96cb02a18349b702dc9cdec4386b218def65007f98152001` . *** Release manager: [@​AkihiroSuda](https://github.com/AkihiroSuda) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi42Ni40IiwidXBkYXRlZEluVmVyIjoiNDIuNjYuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6OnBhdGNoIl19-->
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on lima-vm/go-qcow2reader#61AddLIMA_VZ_ASIFenvironment variable to use ASIF on creating diffdiskvmType.vz.diskImageFormatthat accepts "raw" or "asif"ImageDiskManager.ConvertToRaw()toImageDiskManager.ConvertToRaw()that acceptsraw.Typeorasif.TypeHide obsolete description
How to setup ASIF as diffdisk:
$ limactl start template:ubuntu --name=asif-test --tty=false --log-level=fatal; limactl stop asif-test --log-level=fataldiffdiskwith ASIF image. (original will be renamed todiffdisk.raw)$ limactl start asif-test