Skip to content

fix: reserve DISK_GB for libvirt image cache in nova.conf - #240

Merged
hemanthnakkina merged 1 commit into
canonical:stable/2025.1from
munirsidd:bug/2173743-2025.1
Nov 25, 2026
Merged

hemanthnakkina merged 1 commit into
canonical:stable/2025.1from
munirsidd:bug/2173743-2025.1

Conversation

@munirsidd

Copy link
Copy Markdown

Nova does not count the libvirt image cache (/var/lib/nova/instances/_base) in the DISK_GB inventory it reports to Placement. The cache shares a filesystem with instance disks, so the scheduler sees more free local disk than actually exists. On busy hosts the cache can grow to hundreds of GB that Placement does not account for; hosts running at high utilization then fill up after scheduling has already succeeded, causing instance build failures and interrupting running instances when guest disk writes fail.

As mentioned in upstream documentation [1], set workarounds.reserve_disk_resource_for_image_cache = True so nova-compute adds the actual size of the image cache to the reserved DISK_GB it reports to Placement. The option has no effect when _base is on a separate filesystem or when instances use Ceph RBD, so it is safe as a default.

[1] - https://docs.openstack.org/nova/2025.1/admin/image-caching.html#image-caching-resource-accounting

Closes-bug: #2173743
(cherry picked from commit 9185ca4)

QA steps

  1. Deploy sunbeam
  2. Build and install the openstack-hypervisor snap with this branch
  3. Verify nova-compute config:
$ sudo grep -A2 "\[workarounds\]" /var/snap/openstack-hypervisor/common/etc/nova/nova.conf
[workarounds]
disable_rootwrap = True
reserve_disk_resource_for_image_cache = True
  1. Record current Placement reserved DISK_GB for the compute node:
    openstack resource provider inventory show <compute-uuid> DISK_GB.
  2. Boot an instance from an image not yet cached on that host, wait for the update_resources_interval periodic to run, then re-check the inventory: reserved DISK_GB should now include the image's size in _base in addition to the instance's disk
  3. Sanity check that instances boot and run normally

Nova omits the shared libvirt image cache (_base) from reported DISK_GB
inventory, causing Placement to overcommit disk space. Under high utilization,
the cache can grow to hundreds of GBs, exhausting the host disk, failing new
builds, and interrupting active instances.

Enable workarounds.reserve_disk_resource_for_image_cache so nova-compute
tracks cache size against reserved disk.

Closes-bug: #2173743
(cherry picked from commit 9185ca4)
@hemanthnakkina
hemanthnakkina merged commit 491bb78 into canonical:stable/2025.1 Nov 25, 2026
3 checks passed
@munirsidd
munirsidd deleted the bug/2173743-2025.1 branch November 26, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants