7.2.2. Command-line options for Image service caching


You can use the glance client to manage cached images. Because image cache is local to each node, you must perform cache operations on each node locally. If your Red Hat OpenStack Services on OpenShift (RHOSO) deployment has high availability with three, five, or seven controllers, then you specify the host address by using the --os-image-url option when running cache operations.

Example:

$ glance --os-image-url=<image_url> cache-list
  • Replace <image_url> with the URL for your image, for example "http://REPLICA""0.{REPLICA}""0.REPLICA""0.DOMAIN:9292", where REPLICA is a glanceAPI replica that does not own the data and DOMAIN is the service hostname associated with a specific glanceAPI.

If you have cachemanage middleware enabled, you can use the glance-cache-manage program to manage cached images. You can run the glance-cache-manage program from a different host than the host that contains the image cache.

Expand
表 7.2. Command options for image cache when using the glance client
CommandDescription

$ glance --os-image-url=<image_url> cache-queue <image_id>

Queue an image for immediate caching.

$ glance --os-image-url=<image_url> cache-list

List all images that are currently cached.

$ glance --os-image-url=<image_url> cache-delete <image_id> [<image_id> ...]

Delete one or more cached images or images that are queued for caching from the cache directory.

$ glance --os-image-url=<image_url> cache-clear

Remove all cached images and images that are queued for caching from the cache directory.

$ glance --os-image-url=<image_url> --target cached

Remove all cached images from the cache directory.

$ glance --os-image-url=<image_url> cache-clear --target queued

Remove all images that are queued for caching from the cache directory.

Expand
表 7.3. Command options for image cache when using the glance-cache-manage program
CommandDescription

$ glance-cache-manage --host=<host> list-cached

List all images that are currently cached on a specific host.

$ glance-cache-manage --host=<host> list-queued

List all images that are currently queued for caching on a specific host.

$ glance-cache-manage --host=<host> queue-image

Queue an image for caching on a specific host.

$ glance-cache-manage --host=<host> delete-cached-image

Delete an image from the cache or cache queue of a specific host.

$ glance-cache-manage --host=<host> delete-all-cached-images

Remove all images from the cache on a specific host.

$ glance-cache-manage --host=<host> delete-queued-image

Deleted an image from the cache queue on a specific host.

$ glance-cache-manage --host=<host> delete-all-queued-images

Deleted all images from the cache queue on a specific host.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部