2.5. 配置 image-volume 缓存
块存储服务具有可选的 Image-Volume 缓存,可在从镜像创建卷时使用。此缓存旨在提高从频繁使用的镜像创建卷的速度。有关如何从镜像创建卷的详情,请参考 创建块存储卷。
启用后,Image-Volume 缓存会在第一次创建卷时存储镜像的副本。此存储镜像在本地缓存到块存储后端,以帮助在下次使用镜像创建卷时提高性能。Image-Volume 缓存的限制可设置为大小(以 GB 为单位)、镜像数量或两者。
Image-Volume 缓存由多个后端支持。如果您使用第三方后端,请参阅其文档来获取有关 Image-Volume 缓存支持的信息。
先决条件
- 为块存储服务配置了 内部租户。如需更多信息,请参阅 为块存储服务(cinder)创建和配置内部项目。
- 已安装 undercloud。有关更多信息,请参阅 Director 安装和使用中的安装 director。https://access.redhat.com/documentation/zh-cn/red_hat_openstack_platform/17.0/html/director_installation_and_usage/assembly_installing-director-on-the-undercloud#proc_installing-director_installing-director-on-the-undercloud
流程
-
以
stack
用户身份登录 undercloud 主机。 查找
stackrc
undercloud 凭证文件:source ~/stackrc
$ source ~/stackrc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 要在后端上启用和配置 Image-Volume 缓存,您必须将以下值添加到 overcloud 部署命令中包含的环境文件的
ExtraConfig
部分:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 块存储服务数据库使用时间戳来跟踪每个缓存的镜像最近用于创建镜像的时间。如果设置了 MAXSIZE 和 MAXNUMBER,则块存储服务将根据需要删除缓存的镜像,以便使新镜像成为新的镜像。当满足 Image-Volume 缓存限制时,会首先删除带有最旧时间戳的镜像。
- 将更新保存到环境文件。
- 使用其他环境文件将环境文件添加到堆栈中,并部署 overcloud。