6.5. 连接到共享网络以访问共享


driver_handles_share_servers 参数(DHSS)等于 false 时,共享将导出到管理员提供的共享提供商网络。您必须将客户端(如计算实例)连接到共享提供商网络,以访问您的共享。

在以下示例中,共享提供商网络名为 StorageNFS。当使用 CephFS-NFS 后端部署共享文件系统服务(manila)时,StorageNFS 会被配置。按照以下步骤,连接到 OpenShift (RHOSO)部署中的 Red Hat OpenStack Services 中的可用网络。

注意

以下示例流程中的步骤使用 IPv4 寻址,但步骤与 IPv6 相同。

流程

  1. 为 StorageNFS 端口创建一个安全组,允许数据包出口端口,但不允许来自未建立连接的入口数据包:

    $ openstack security group create no-ingress -f yaml
    created_at: '2018-09-19T08:19:58Z'
    description: no-ingress
    id: 66f67c24-cd8b-45e2-b60f-9eaedc79e3c5
    name: no-ingress
    project_id: 1e021e8b322a40968484e1af538b8b63
    revision_number: 2
    rules: 'created_at=''2018-09-19T08:19:58Z'', direction=''egress'', ethertype=''IPv4'',
     id=''6c7f643f-3715-4df5-9fef-0850fb6eaaf2'', updated_at=''2018-09-19T08:19:58Z''
     created_at=''2018-09-19T08:19:58Z'', direction=''egress'', ethertype=''IPv6'',
     id=''a8ca1ac2-fbe5-40e9-ab67-3e55b7a8632a'', updated_at=''2018-09-19T08:19:58Z''
  2. 在 StorageNFS 网络中创建一个端口,其安全性由 no-ingress 安全组强制使用。

    注意

    在以下示例中,StorageNFS 网络上的 StorageNFS 子网将 IP 地址 198.51.100.160 分配给 nfs-port0

    $ openstack port create nfs-port0 \
      --network StorageNFS \
      --security-group no-ingress -f yaml
    
    admin_state_up: UP
    allowed_address_pairs: ''
    binding_host_id: null
    binding_profile: null
    binding_vif_details: null
    binding_vif_type: null
    binding_vnic_type: normal
    created_at: '2018-09-19T08:03:02Z'
    data_plane_status: null
    description: ''
    device_id: ''
    device_owner: ''
    dns_assignment: null
    dns_name: null
    extra_dhcp_opts: ''
    fixed_ips: ip_address='198.51.100.160', subnet_id='7bc188ae-aab3-425b-a894-863e4b664192'
    id: 7a91cbbc-8821-4d20-a24c-99c07178e5f7
    ip_address: null
    mac_address: fa:16:3e:be:41:6f
    name: nfs-port0
    network_id: cb2cbc5f-ea92-4c2d-beb8-d9b10e10efae
    option_name: null
    option_value: null
    port_security_enabled: true
    project_id: 1e021e8b322a40968484e1af538b8b63
    qos_policy_id: null
    revision_number: 6
    security_group_ids: 66f67c24-cd8b-45e2-b60f-9eaedc79e3c5
    status: DOWN
    subnet_id: null
    tags: ''
    trunk_details: null
    updated_at: '2018-09-19T08:03:03Z'
  3. nfs-port0 添加到 Compute 实例。

    $ openstack server add port instance0 nfs-port0
    $ openstack server list -f yaml
    - Flavor: m1.micro
      ID: 0b878c11-e791-434b-ab63-274ecfc957e8
      Image: manila-test
      Name: demo-instance0
      Networks: demo-network=198.51.100.4, 10.0.0.53; StorageNFS=198.51.100.160
      Status: ACTIVE

    除了其专用和浮动地址外,计算实例还分配一个具有 StorageNFS 网络上 IP 地址 198.51.100.160 的端口。当向共享授予该地址的访问权限时,您可以使用此 IP 地址挂载 NFS 共享。

    注意

    您可能需要调整计算实例上的网络配置,然后重启 Compute 实例的服务来激活具有此地址的接口。

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

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

關於紅帽

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

Theme

© 2026 Red Hat
返回顶部