Skip to content
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

limactl depends on qemu or qemu-img, but lima brew package does not depend on qemu #3169

Open
nirs opened this issue Jan 28, 2025 · 3 comments
Labels
area/cli limactl CLI user experience area/homebrew Homebrew formula component/qemu QEMU

Comments

@nirs
Copy link
Member

nirs commented Jan 28, 2025

Description

When installing lima via brew, qemu is not installed.

limactl start works with vz and create the root disk without qemu-img, but creating a vm with additional disks will fail when creating the disk:

% limactl disk create mydisk --size 10g
INFO[0000] Creating qcow2 disk "mydisk" with size 10GiB 
FATA[0000] failed to create qcow2 disk in "/Users/nsoffer/.lima/_disks/mydisk": failed to run [qemu-img create -f qcow2 /Users/nsoffer/.lima/_disks/mydisk/datadisk 10737418240]: "": exec: "qemu-img": executable file not found in $PATH 

This failure could be avoided if we remove the unneeded dependency on qemu-img (#2853), but we still depend on qemu-img to create qcow2 disks. We also depend on qemu for the limactl snapshot command.

If we have a dependency we should depend on the package we depend on for best user experience.

If we want to introduce a soft dependency, that we can work with or without, we need to change the code so qcow2 format and qemu vmType are available only if qemu-img is available. The online help can recommend installing additional packages.

Possible fixes:

  • require qemu in lima brew package
  • change the code to make qemu-img optional
    • make default disk format "raw"
    • support qcow2 disks only if qemu-img is available
    • support snapshots for qemu vms only if qemu is installed
    • fail validation or warn of vmType: qemu if qemu is not installed

Related issues:

@nirs nirs added area/cli limactl CLI user experience area/homebrew Homebrew formula component/qemu QEMU labels Jan 28, 2025
@AkihiroSuda
Copy link
Member

require qemu in lima brew package

I don't think qemu should be depended on, as it is required only for rarely-used additional disks when vmType is set to vz.

parikshithb added a commit to parikshithb/ramen that referenced this issue Jan 29, 2025
* Tested with env/regional-dr.yaml cluster creation on mac
* Updated lima version in test/README.md
* Updated test/README.md to install qemu for macOS due to lima
  dependency issue ([issue #3169](lima-vm/lima#3169))

Signed-off-by: Parikshith <[email protected]>
parikshithb added a commit to parikshithb/ramen that referenced this issue Jan 29, 2025
* Tested with env/regional-dr.yaml cluster creation on mac
* Updated lima version in test/README.md
* Updated test/README.md to install qemu for macOS due to lima
  dependency with qemu ([issue #3169](lima-vm/lima#3169))

Signed-off-by: Parikshith <[email protected]>
parikshithb added a commit to parikshithb/ramen that referenced this issue Jan 29, 2025
* Tested with env/regional-dr.yaml cluster creation on mac
* Updated lima version in test/README.md
* Updated test/README.md to install qemu for macOS due to lima
  dependency with qemu ([issue #3169](lima-vm/lima#3169))

Signed-off-by: Parikshith <[email protected]>
@nirs
Copy link
Member Author

nirs commented Jan 29, 2025

require qemu in lima brew package

I don't think qemu should be depended on, as it is required only for rarely-used additional disks when vmType is set to vz.

It makes sense, so we want a soft dependency. If qemu-image is available, we can support qcow2 format when creating or resizing images. If not, trying to create qcow2 format or resize qcow2 image can fail with helpful message like:

"qcow2" format requires the qemu package

And same if you try to resize a qcow2 disk.

To make this change we need to change the default format to be raw. This may be break some users, but using a default which is not available in all case is a mistake that we have to fix sooner or later.

But if we remove the unneeded dependency on qemu-img for raw images (#2853), this issue is mostly resolved, since with vz there is no use case for creating or resizing disk in qcow2 format.

@jandubois
Copy link
Member

To make this change we need to change the default format to be raw.

The default format for what? For additional disks?

I don't understand: if we can read qcow2 disks (to convert to raw format), why can't we also create empty/unformatted qcow2 disks?

parikshithb added a commit to parikshithb/ramen that referenced this issue Jan 30, 2025
* Tested with env/regional-dr.yaml cluster creation on mac
* Updated lima version in test/README.md
* Updated test/README.md to install qemu for macOS due to lima
  dependency with qemu ([issue #3169](lima-vm/lima#3169))

Signed-off-by: Parikshith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli limactl CLI user experience area/homebrew Homebrew formula component/qemu QEMU
Projects
None yet
Development

No branches or pull requests

3 participants