第 3 章 镜像导入和共享暂存
OpenStack Image 服务(glance)的默认设置由安装 Red Hat OpenStack Platform (RHOSP)时使用的 heat 模板决定。Image 服务 heat 模板为 deployment/glance/glance-api-container-puppet.yaml。
您可以使用以下方法导入镜像:
-
web-download:使用web-download方法从 URL 导入镜像。 -
glance-direct:使用glance-direct方法从本地卷中导入镜像。
3.1. 创建并部署 glance-settings.yaml 文件 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
使用自定义环境文件来配置导入参数。这些参数覆盖核心 heat 模板集合中存在的默认值。示例环境内容包含可互操作性镜像导入的参数。
parameter_defaults: # Configure NFS backend GlanceBackend: file GlanceNfsEnabled: true GlanceNfsShare: 192.168.122.1:/export/glance # Enable glance-direct import method GlanceEnabledImportMethods: glance-direct,web-download # Configure NFS staging area (required for glance-direct import method) GlanceStagingNfsShare: 192.168.122.1:/export/glance-staging
parameter_defaults:
# Configure NFS backend
GlanceBackend: file
GlanceNfsEnabled: true
GlanceNfsShare: 192.168.122.1:/export/glance
# Enable glance-direct import method
GlanceEnabledImportMethods: glance-direct,web-download
# Configure NFS staging area (required for glance-direct import method)
GlanceStagingNfsShare: 192.168.122.1:/export/glance-staging
GlanceBackend、GlanceNfsEnabled 和 GlanceNfsShare 参数在 Overcloud 参数 指南中定义。
使用两个新参数进行互操作性镜像导入,以定义导入方法和共享的 NFS 暂存区域。
- GlanceEnabledImportMethods
- 定义可用的导入方法、web-download (默认)和 glance-direct。只有在您要启用 web-download 以外的其他方法时,才需要此参数。
- GlanceStagingNfsShare
-
配置 glance-direct 导入方法使用的 NFS 暂存区域。此空间可以在高可用性集群配置中的节点之间共享。如果要使用此参数,还必须将
GlanceNfsEnabled参数设置为true。
流程
-
创建一个新文件,如
glance-settings.yaml。使用示例中的语法来填充此文件。 在
openstack overcloud deploy命令中包含glance-settings.yaml文件,以及与部署相关的任何其他环境文件:openstack overcloud deploy --templates -e glance-settings.yaml
$ openstack overcloud deploy --templates -e glance-settings.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
有关使用环境文件的更多信息,请参阅 Director 安装和使用 指南。