Red Hat Training

A Red Hat training course is available for Red Hat OpenStack Platform

19.4. 配置镜像导入方法和 Shared Staging 区域

OpenStack Image 服务(glance)的默认设置由安装 OpenStack 时使用的 Heat 模板决定。镜像服务 Heat 模板为 tht/puppet/services/glance-api.yaml

可互操作镜像导入允许两个镜像导入方法:

  • web-download 和
  • Glance 直接.

web-download 方法可让您从 URL 导入镜像; glance-direct 方法可让您从本地卷导入镜像。

19.4.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

GlanceBackendGlanceNfsEnabledGlanceNfsShare 参数在 高级 Overcloud 自定义指南中的"存储配置"部分定义https://access.redhat.com/documentation/zh-cn/red_hat_openstack_platform/13/html/advanced_overcloud_customization/storage_configuration

用于互操作性镜像导入的两个新参数定义了导入方法和共享 NFS 暂存区域。

GlanceEnabledImportMethods
定义可用的导入方法、web-download (默认)和 glance-direct。只有在您希望启用 web-download 以外的其他方法时才需要这一行。
GlanceStagingNfsShare
配置 glance-direct 导入方法使用的 NFS 暂存区域。此空间可以在高可用性群集设置中的节点之间共享。需要将 GlanceNfsEnabled 设置为 true。

配置设置:

  1. 创建一个名为 的新文件,如 glance-settings.yaml。此文件的内容应类似于上述示例。
  2. 使用 openstack overcloud deploy 命令将该文件添加到 OpenStack 环境中:

    $ openstack overcloud deploy --templates -e glance-settings.yaml

    有关使用环境文件的更多信息,请参阅高级 Overcloud 自定义指南中的 overcloud 创建环境文件 部分。