6.11. 使用共享文件系统服务
Red Hat OpenStack Services on OpenShift (RHOSO)中的共享文件系统服务(manila)提供了一个自助服务 API 来创建和管理文件共享。文件共享(或"共享")是为从多个客户端进行并发读写访问而构建的。这使得共享文件系统服务在需要 ReadWriteMany 持久性存储的云环境中至关重要。
RHOSO 中的文件共享需要网络访问。在采用后,确保 Red Hat OpenStack Platform (RHOSP) 17.1 环境中的网络与您的新云的网络计划匹配。这样可确保租户工作负载在采用过程中保持连接到存储。共享文件系统服务 control plane 服务不在数据路径中。关闭 API、调度程序和共享管理器服务不会影响对现有共享文件系统的访问。
通常,存储和存储设备管理是独立的网络。共享文件系统服务只需要访问存储设备管理网络。例如,如果您在部署中使用了 Red Hat Ceph Storage 集群,"storage"网络指的是 Red Hat Ceph Storage 集群的公共网络,并且共享文件系统服务的共享管理器服务需要能够访问它。
共享文件系统服务支持以下存储网络场景:
- 您可以直接控制相应文件共享的网络。
- RHOSO 管理员配置存储网络。
6.11.1. 准备共享文件系统服务配置的指南 复制链接链接已复制到粘贴板!
要在 control plane 上部署共享文件系统服务(manila),您必须从 Red Hat OpenStack Platform 17.1 部署中复制原始配置文件。您必须检查文件中的内容,以确保您在 OpenShift (RHOSO) 18.0 上为 Red Hat OpenStack Services 采用正确的配置。并非所有内容都需要引入新的云环境。
查看以下准则,以准备您的共享文件系统服务配置文件进行采用:
共享文件系统服务 operator 设置以下配置,并可以忽略:
-
与数据库相关的配置(
[database]) -
服务身份验证(
auth_strategy,[keystone_authtoken]) -
消息总线配置(
transport_url,control_exchange) -
默认粘贴配置(
api_paste_config) -
Inter-service communication configuration (
[neutron],[nova],[cinder],[glance][oslo_messagingvdsm])
-
与数据库相关的配置(
-
忽略
osapi_share_listen配置。在 OpenShift 上的 Red Hat OpenStack Services (RHOSO) 18.0 中,您依赖 Red Hat OpenShift Container Platform (RHOCP)路由和入口。 - 检查策略覆盖。在 RHOSO 18.0 中,共享文件系统服务附带安全默认的基于角色的访问控制(RBAC),且可能不需要覆盖。
如果需要自定义策略,则必须将其作为
ConfigMap提供。以下示例 spec 演示了如何使用名为policy.yaml的文件设置名为manila-policy的ConfigMap:spec: manila: enabled: true template: manilaAPI: customServiceConfig: | [oslo_policy] policy_file=/etc/manila/policy.yaml extraMounts: - extraVol: - extraVolType: Undefined mounts: - mountPath: /etc/manila/ name: policy readOnly: true propagation: - ManilaAPI volumes: - name: policy projected: sources: - configMap: name: manila-policy items: - key: policy path: policy.yaml-
[DEFAULT]部分下的host选项的值必须是hostgroup。 -
要运行共享文件系统服务 API 服务,您必须将
enabled_share_protocols选项添加到manila: template: manilaAPI的customServiceConfig部分。 -
如果您有调度程序覆盖,请将它们添加到
manila: template: manilaScheduler中的customServiceConfig部分。 -
如果您使用 RHOSP 17.1 配置多个存储后端驱动程序,则需要在部署 RHOSO 18.0 时分割它们。每个存储后端驱动程序都需要使用自己的
manila-share服务实例。 如果存储后端驱动程序需要自定义容器镜像,请在 Red Hat Ecosystem Catalog 中找到它,并创建或修改
OpenStackVersion自定义资源(CR),以使用相同的自定义名称来指定自定义镜像。以下示例显示了
OpenStackControlPlaneCR 中的 manila spec,其中包含多个存储后端驱动程序,其中只有一个使用自定义容器镜像:spec: manila: enabled: true template: manilaAPI: customServiceConfig: | [DEFAULT] enabled_share_protocols = nfs replicas: 3 manilaScheduler: replicas: 3 manilaShares: netapp: customServiceConfig: | [DEFAULT] debug = true enabled_share_backends = netapp host = hostgroup [netapp] driver_handles_share_servers = False share_backend_name = netapp share_driver = manila.share.drivers.netapp.common.NetAppDriver netapp_storage_family = ontap_cluster netapp_transport_type = http replicas: 1 pure: customServiceConfig: | [DEFAULT] debug = true enabled_share_backends=pure-1 host = hostgroup [pure-1] driver_handles_share_servers = False share_backend_name = pure-1 share_driver = manila.share.drivers.purestorage.flashblade.FlashBladeShareDriver flashblade_mgmt_vip = 203.0.113.15 flashblade_data_vip = 203.0.10.14 replicas: 1以下示例显示了定义自定义容器镜像的
OpenStackVersionCR:apiVersion: core.openstack.org/v1beta1 kind: OpenStackVersion metadata: name: openstack spec: customContainerImages: cinderVolumeImages: pure: registry.connect.redhat.com/purestorage/openstack-manila-share-pure-rhosp-18-0OpenStackVersionCR 的名称必须与OpenStackControlPlaneCR 的名称匹配。如果您提供敏感信息,如密码、主机名和用户名,请使用 RHOCP secret 和
customServiceConfigSecrets密钥。您可以在任意服务中使用customConfigSecrets。如果您使用需要凭证的第三方存储,请使用customServiceConfigSecrets密钥在 manila CR/patch 文件中创建一个 secret。例如:创建包含 secret 的文件,如
netapp_secrets.conf:$ cat << __EOF__ > ~/netapp_secrets.conf [netapp] netapp_server_hostname = 203.0.113.10 netapp_login = fancy_netapp_user netapp_password = secret_netapp_password netapp_vserver = mydatavserver __EOF__$ oc create secret generic osp-secret-manila-netapp --from-file=~/<secret>-
将
<secret> 替换为包含 secret 的文件名称,如netapp_secrets.conf。
-
将
将 secret 添加到
customServiceConfigSecrets部分中的任何共享文件系统服务文件中。以下示例将osp-secret-manila-netappsecret 添加到manilaShares服务中:spec: manila: enabled: true template: < . . . > manilaShares: netapp: customServiceConfig: | [DEFAULT] debug = true enabled_share_backends = netapp host = hostgroup [netapp] driver_handles_share_servers = False share_backend_name = netapp share_driver = manila.share.drivers.netapp.common.NetAppDriver netapp_storage_family = ontap_cluster netapp_transport_type = http customServiceConfigSecrets: - osp-secret-manila-netapp replicas: 1 < . . . >