Skip to content

Cannot create a VM with additional disks; qemu-img convert fails to convert to raw #3720

Open
@pavelanni

Description

@pavelanni

Description

After upgrading to 1.2 I can't create a VM with additional drives.

Steps to reproduce.

  1. Create a disk with limactl disk create disk1 --size 10GiB
  2. 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"
  1. Start the VM with limactl start --name ubuntu-bug ubuntu-bug.yaml
  2. 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")
  3. 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"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionUsed to work but has been broken

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions