id: PG-33
category: vm-lifecycle
title: Image too big for the flavor?
situation: >-
  The boot is refused at once, or aborted after the image was downloaded. Nova checks the image against the
  flavor at two moments, with two different sizes.

diagram:
  type: compare
  caption: Two checks, two sizes
  columns:
    - kicker: At the API, before scheduling
      title: The file size
      icon: file-text
      tone: ink
      points:
        - "Compares the image file `size` and its `min_disk`"
        - A compressed qcow2 can pass
      verdict: Refused at once, HTTP 400
    - kicker: On the compute, after download
      title: The virtual size
      icon: hard-drive
      tone: stop
      points:
        - Compares the size of the disk the image holds
        - Fails what the API let through
      verdict: Build aborted, ERROR
  note: >-
    Setting `min_disk` on the image to its virtual size makes the API refuse a too small flavor at once.

checks:
  - label: Image sizes and min_disk
    hint: openstack image show <image> -c size -c virtual_size -c min_disk
  - label: Flavor root disk and RAM
    hint: openstack flavor show <flavor> -c disk -c ram
  - label: The fault of the instance
    hint: openstack server show <id> -c fault
  - label: Mind the units
    hint: "flavor disk in GB ; image size and virtual_size in bytes"

caution:
  - level: state-changing
    text: >-
      Changing `min_disk` or `min_ram` on an image applies to every later boot of it, for every user.
  - level: know
    text: >-
      A flavor with disk 0 is meant for volume-backed servers. By default policy, an image-backed boot with
      it is refused for non-admins.

lesson: The file size is not the disk size. Compare the flavor with the image's virtual size.

runbook:
  path: scheduling/image-larger-than-flavor-disk.md
  status: lab-verified
  release: "2026.1"

scope: >-
  Written from the Nova 2026.1 source and lab-run on Kolla-Ansible with local disks: an image without
  min_disk, a zero-disk flavor and min_ram. Not run: the API refusal on the image file size, and the check on
  a Ceph RBD image backend. Booting from a volume of the right size is the other way out: the flavor's disk is
  then not used for the root disk, but the volume must be at least min_disk. Resizes to a smaller disk are another subject.

linkedin:
  title: "Flavor's disk is too small: the file size is not the disk size"
  caption: |
    A flavor too small for an image. Sometimes the boot is refused at once. Sometimes the instance is scheduled, the image is downloaded, and the build is aborted. The difference is on the image.

    Nova checks the image against the flavor twice, with two different numbers:
    → at the API, before scheduling: the size of the image FILE, and its min_disk
    → on the compute, after the download: the VIRTUAL size, the disk the image actually holds

    A compressed qcow2 has a small file and a large virtual disk. With no min_disk set, it passes the first check and fails the second, after wasting a scheduling round and a download.

    The clean fix is on the image: set min_disk to its virtual size, and the API refuses a too small flavor immediately, with a clear message.
  hashtags: [OpenStack, Nova, Glance, CloudOperations, SRE, OzarLand]
