Skip to content

Refused disk shrink is still saved to the profile config; colima list reports the stale size #1661

Open

Description

@mschoenlaub

Description

When a start asks for a smaller disk than the instance has, colima refuses the shrink but still saves the requested size in the profile's colima.yaml. colima list and colima status then report that saved size instead of the size the data disk actually has, and the stale value persists across restarts.

Two code paths are involved:

  • environment/vm/lima/disk.go, in the resize step: when conf.Disk - instance.Disk is negative it logs disk size cannot be reduced, ignoring... and returns, but the config with the smaller size is still saved.
  • environment/vm/lima/limautil/instance.go, in Instances(): the Disk value from limactl list is overwritten with conf.Disk from the saved config (// report correct disk usage). After a refused shrink that value is not the disk's size.

Because instance.Disk is the saved config value and not the real size, a later start with a size between the stale value and the real size is treated as a grow. Colima calls limactl disk resize, lima refuses with Disk shrinking is currently unavailable, colima logs a warning, and the requested size is saved anyway.

Version

colima version v0.10.3
git commit: 00f6c297e92a82c04a4ab507db0a61435650d7e8
limactl version 2.2.0
qemu-img version 11.1.0

Operating System

  • macOS Intel <= 13 (Ventura)
  • macOS Intel >= 14 (Sonoma)
  • Apple Silicon <= 13 (Ventura)
  • Apple Silicon >= 14 (Sonoma)
  • Linux

macOS 26.7.1, Apple Silicon, vmType qemu (default for this profile), mountType sshfs.

Output of colima status

colima [profile=captest-stale] is running using QEMU
arch: aarch64
runtime: containerd
mountType: sshfs
containerd socket: unix:///Users/<user>/.colima/captest-stale/containerd.sock
buildkitd socket: unix:///Users/<user>/.colima/captest-stale/buildkitd.sock

Reproduction Steps

Each step records colima list --json (disk field), limactl disk ls --json colima-captest-stale (size field, with LIMA_HOME=~/.colima/_lima), the disk: line of ~/.colima/captest-stale/colima.yaml, and df -h of the data disk mount inside the VM.

  1. colima start -p captest-stale --cpu 1 --memory 2 --disk 20 --runtime containerd

    colima list disk : 20 GiB
    limactl disk ls  : 20 GiB
    colima.yaml      : disk: 20
    inside VM        : 20G
    
  2. colima stop -p captest-stale && colima start -p captest-stale --disk 10

    level=warning msg="disk size cannot be reduced, ignoring..." context=vm
    colima list disk : 10 GiB
    limactl disk ls  : 20 GiB
    colima.yaml      : disk: 10
    inside VM        : 20G
    
  3. colima stop -p captest-stale && colima start -p captest-stale --disk 15

    level=warning msg="unable to resize disk: error resizing disk: exit status 1, output: ... specified size `15GiB` is less than the current disk size `20GiB`. Disk shrinking is currently unavailable" context=vm
    colima list disk : 15 GiB
    limactl disk ls  : 20 GiB
    colima.yaml      : disk: 15
    inside VM        : 20G
    
  4. colima stop -p captest-stale && colima start -p captest-stale --disk 25

    level=info msg="resizing disk to 25GiB..." context=vm
    colima list disk : 25 GiB
    limactl disk ls  : 25 GiB
    colima.yaml      : disk: 25
    inside VM        : 25G
    

Step 4 shows the values agree again once the requested size is above the real one.

Expected behaviour

After steps 2 and 3, colima list and colima status report 20 GiB, the size the data disk has, and the saved colima.yaml keeps disk: 20. A refused shrink should not change the recorded size.

Either of these would do it:

  • Keep the previous disk value in the saved config when the shrink is refused or limactl disk resize fails, so the saved config keeps describing the instance.
  • Stop overriding the limactl list disk value in Instances(), or override it with the data disk's size from limactl disk ls, so the listing reports the real size regardless of the config.

Additional context

Tooling that drives colima from its own configuration hits this when a user lowers the disk setting and raises it again later: colima list under-reports until a start with a size at or above the stale value, and that start logs a resize although nothing changes. Not an urgent problem, since the real disk is never shrunk, but the saved config and the listing stop being a reliable description of the instance.

Activity

  1. added a commit that references this issue on Oct 29, 2026
    1801926
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions