搜索

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

download PDF

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

在本例中,共享供应商网络称为 StorageNFS。当 director 使用 CephFS-NFS 后端部署共享文件系统服务(manila)时,会配置 StorageNFS。按照以下步骤连接到您的云管理员可用的网络。

注意

示例流程中的步骤使用 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 安全组强制使用。

    $ 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'
    注意

    在本例中,StorageNFS 网络上的 StorageNFS 子网将 IP 地址 198.51.100.160 分配给 nfs-port0。如需有关 StorageNFS 子网的更多信息,请参阅 部署 Red Hat Ceph Storage 和 Red Hat OpenStack Platform 中的 配置共享供应商 StorageNFS 网络

  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 实例上的网络配置,并重启 Compute 实例的服务来激活使用此地址的接口。

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.