Import file:// URLs via glance-direct#1253
Draft
ideaship wants to merge 1 commit into
Draft
Conversation
4ae4ec3 to
08b0feb
Compare
The file:// branch of import_image() uploaded the local file with the legacy image data API (new_image.upload()), which bypasses Glance's interoperable image import and therefore its import plugins. Where those plugins convert images (e.g. image_conversion to raw for a Ceph/RBD store), a file:// image was stored in its original format, so it could not be COW-cloned and nova had to download and convert it per instance. Import the local file via the glance-direct method instead, reusing the _glance_direct_import() helper, so a file:// import runs the same decompress/convert/store taskflow as web-download. Delete the image and flag an error if staging, import or the wait fails. glance-direct is a long-standing, default-enabled Glance import method and uses the same staging store as web-download, so this needs nothing beyond what web-download already requires. It applies the deployment's configured import plugins, so the stored image only differs from the old path on deployments that have conversion or decompression enabled -- which is exactly where that transformation is wanted. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Roger Luethi <luethi@osism.tech>
08b0feb to
23d5e72
Compare
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.
What
The
file://branch ofimport_image()uploaded the local file with the legacyimage data API (
new_image.upload()), which bypasses Glance's interoperable imageimport and its plugins. This switches it to the
glance-directimport method, so alocal-file import runs the same decompress/convert/store taskflow as web-download.
Reuses the
_glance_direct_import()helper from #1252; stacked onprefetch-on-stuckuntil that merges.Why it matters
Where the import plugins convert images to raw (OSISM's Ceph/RBD setup), the legacy
upload stored a
file://image in its original format. A non-raw image in the RBDglance store cannot be COW-cloned, so nova downloads and converts it to raw per
instance on compute-local disk — slower, more space, and able to fail in RBD-only
or space-constrained setups. glance-direct produces a raw, COW-cloneable image.
Compatibility
glance-direct is a long-standing, default-enabled Glance import method — nothing in
kolla or the OSISM overlays overrides
enabled_import_methods— and it uses thesame staging store web-download already relies on
(
/var/lib/glance/staging). So on any deployment where web-download works today,this needs nothing new, and it has been stable in Glance since well before any
OSISM-supported release.
glance-direct applies the deployment's configured import plugins, so the stored
image differs from the legacy path only where conversion or decompression is
enabled — i.e. exactly where that transformation is intended. No OSISM flow imports
via
file://today (octavia, clusterapi, gardenlinux andmanage imagesall usehttp(s)sources), so within OSISM this is effectively inert; it matters mainly tothe standalone PyPI package.
Related
🤖 Generated with Claude Code