Skip to content

Import file:// URLs via glance-direct#1253

Draft
ideaship wants to merge 1 commit into
mainfrom
file-uri-glance-direct
Draft

Import file:// URLs via glance-direct#1253
ideaship wants to merge 1 commit into
mainfrom
file-uri-glance-direct

Conversation

@ideaship

@ideaship ideaship commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

What

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 its plugins. This switches it to the glance-direct import method, so a
local-file import runs the same decompress/convert/store taskflow as web-download.

Reuses the _glance_direct_import() helper from #1252; stacked on
prefetch-on-stuck until 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 RBD
glance 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 the
same 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 and manage images all use
http(s) sources), so within OSISM this is effectively inert; it matters mainly to
the standalone PyPI package.

Related

🤖 Generated with Claude Code

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>
@ideaship ideaship force-pushed the file-uri-glance-direct branch from 08b0feb to 23d5e72 Compare July 14, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

2 participants