Open
Description
Description
After upgrading to 1.2 I can't create a VM with additional drives.
Steps to reproduce.
- Create a disk with
limactl disk create disk1 --size 10GiB
- Create a template YAML
ubuntu-bug.yaml
:
minimumLimaVersion: 1.1.0
base:
- template://_images/ubuntu
- template://_default/mounts
additionalDisks:
- name: "disk1"
format: true
fsType: "xfs"
- Start the VM with
limactl start --name ubuntu-bug ubuntu-bug.yaml
- Get ERROR:
FATA[0005] exiting, status={Running:false Degraded:false Exiting:true Errors:[] SSHLocalPort:0} (hint: see "/Users/pavel/.lima/ubuntu-bug/ha.stderr.log")
- Check the log:
{"level":"info","msg":"Mounting disk \"disk1\" on \"/mnt/lima-disk1\"","time":"2025-07-11T15:10:41-04:00"}
{"level":"debug","msg":"Converting extra disk \"/Users/pavel/.lima/_disks/disk1/datadisk\" to a raw disk (if it is not a raw)","time":"2025-07-11T15:10:41-04:00"}
{"level":"fatal","msg":"failed to convert extra disk \"/Users/pavel/.lima/_disks/disk1/datadisk\" to a raw disk: failed to run [qemu-img convert -O raw /Users/pavel/.lima/_disks/disk1/datadisk /Users/pavel/.lima/_disks/disk1/datadisk]: stdout=\"\", stderr=\"qemu-img: /Users/pavel/.lima/_disks/disk1/datadisk: error while converting raw: Failed to get \\\"write\\\" lock\\nIs another process using the image [/Users/pavel/.lima/_disks/disk1/datadisk]?\\n\": exit status 1","time":"2025-07-11T15:10:41-04:00"}
Lima tries to use qemu-img
to convert the disk to raw in-place and fails.
This works in 1.1.1 (just tested by installing the 1.1.1 binary).
In 1.1.1 the log looks fine:
{"level":"info","msg":"Mounting disk \"disk1\" on \"/mnt/lima-disk1\"","time":"2025-07-11T15:21:57-04:00"}
{"level":"debug","msg":"Converting extra disk \"/Users/pavel/.lima/_disks/disk1/datadisk\" to a raw disk (if it is not a raw)","time":"2025-07-11T15:21:57-04:00"}
{"level":"info","msg":"Converting \"/Users/pavel/.lima/_disks/disk1/datadisk\" (qcow2) to a raw disk \"/Users/pavel/.lima/_disks/disk1/datadisk\"","time":"2025-07-11T15:21:57-04:00"}