Skip to content

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

Merged
hemanthnakkina merged 1 commit into
canonical:mainfrom
munirsidd:bug/2173743
Nov 11, 2026
Merged

hemanthnakkina merged 1 commit into
canonical:mainfrom
munirsidd:bug/2173743

Conversation

@munirsidd

@munirsidd munirsidd commented Nov 10, 2026 •

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/latest/admin/image-caching.html#image-caching-resource-accounting

Closes-bug: #2173743

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
@munirsidd

Copy link
Copy Markdown
Author

E2E test on stable/2024.1:
https://pastebin.canonical.com/p/p9dYVrSpKr

@freyes freyes left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hemanthnakkina
hemanthnakkina merged commit a0ef4f9 into canonical:main Nov 11, 2026
3 checks passed
@munirsidd
munirsidd deleted the bug/2173743 branch November 12, 2026 04:16
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