Derive min_disk from the image's virtual size - #1293
Open
toreanderson wants to merge 1 commit into
Open
toreanderson wants to merge 1 commit into
toreanderson wants to merge 1 commit into
Conversation
Nova refuses to boot an image on a root disk smaller than its virtual size, but min_disk was only ever raised to the size of the image data. For a compressed qcow2 that is a fraction of the virtual disk, so a definition without min_disk got 1 GiB for an image needing 10, and a too small min_disk in a definition went uncorrected. Raise min_disk to the virtual size Glance reports once an import has finished, rounded up to whole GiB, falling back to the size of the image data when it reports none. A definition may still ask for more; one asking for less is overridden, with a warning. min_disk becomes optional in the schema, since the manager can now work it out. Assisted-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Tore Anderson <tore@redpill-linpro.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nova refuses to boot an image on a root disk smaller than the image's virtual size.
set_propertiesraisesmin_diskonly to the size of the image data,cloud_image.sizerounded up to GiB. For a compressed qcow2 that is a fraction of the virtual disk, so:min_diskgets 1 GiB, for an image that may need 10;min_diskis too small is never corrected, so the image advertises a disk size Nova then refuses.For example, Ubuntu 24.04's cloud image is 0.6 GiB of qcow2 data, but its virtual disk is 3.5 GiB. AlmaLinux 9's is 0.55 GiB of data and a 10 GiB virtual disk.
Changes
min_diskis raised to the virtual size Glance reports, rounded up to whole GiB, and to the size of the image data when Glance reports novirtual_size.min_diskbecomes optional in the schema. Without it, the manager sets the floor.update_imagecall formin_disk, instead of up to two.Testing
test_set_properties_min_diskcovers:virtual_size;The cases that change behaviour fail on
main.test_image_min_diskcovers rounding;test_schema_min_disk_optionalcovers the schema.End to end on an OpenStack cloud: a sync of Debian 13, Ubuntu 24.04 Minimal and Rocky 10 from definitions without
min_diskset it to 3, 4 and 10 from thevirtual_sizeGlance reported after import, without warnings. Each then booted from a volume of exactly that size.Separately, 14 cloud images (AlmaLinux, CentOS Stream, Debian, Rocky, Ubuntu) were booted from volumes of exactly their rounded-up virtual size, 3–10 GiB, all successfully.
🤖 Generated with Claude Code