-
Notifications
You must be signed in to change notification settings - Fork 767
pkg/driver/vz: Support ASIF as diffdisk #4327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
pkg/driver/vz: Support ASIF as diffdisk #4327
Conversation
6e6c8b1 to
a86f7f8
Compare
4845910 to
b78a98d
Compare
|
Implemented conversion to ASIF |
566d590 to
a88474b
Compare
f165c11 to
27ffe60
Compare
caec7af to
d908a03
Compare
|
Force pushed and updated PR description. |
d908a03 to
0dde51e
Compare
|
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 <[email protected]> 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 <[email protected]>
- 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 <[email protected]>
- 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 <[email protected]>
# Conflicts:
# pkg/driver/vz/vz_driver_darwin.go
# pkg/driverutil/disk.go
Signed-off-by: Norio Nomura <[email protected]>
…onvert()` Signed-off-by: Norio Nomura <[email protected]>
- default.yaml: Fix comment placing - pkg/qemuimgutil: Change `QemuImageUtil.Convert` to returns error on specifying other than `raw.Type` Signed-off-by: Norio Nomura <[email protected]>
0dde51e to
6b5eb41
Compare
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