4.8. 向 spine-leaf 部署中添加一个新的 leaf


在增加网络容量或添加新的物理站点时,您可能需要在 Red Hat OpenStack Platform (RHOSP) spine-leaf 网络中有一个新的叶型。

前提条件

  • 您的 RHOSP 部署使用 spine-leaf 网络拓扑。

流程

  1. 以 stack 用户身份登录 undercloud 主机。
  2. 提供 undercloud 凭证文件:

    $ source ~/stackrc
  3. /usr/share/openstack-tripleo-heat-templates/network_data_spine_leaf.yaml 文件中,在适当的基本网络中,添加一个叶子网作为您要添加的新叶的可组合网络项。

    Example

    在本例中,添加了新的 leaf (leaf3)的子网条目:

    - name: InternalApi
      name_lower: internal_api
      vip: true
      vlan: 10
      ip_subnet: '172.18.0.0/24'
      allocation_pools: [{'start': '172.18.0.4', 'end': '172.18.0.250'}]
      gateway_ip: '172.18.0.1'
      subnets:
        internal_api_leaf1:
          vlan: 11
          ip_subnet: '172.18.1.0/24'
          allocation_pools: [{'start': '172.18.1.4', 'end': '172.18.1.250'}]
          gateway_ip: '172.18.1.1'
        internal_api_leaf2:
          vlan: 12
          ip_subnet: '172.18.2.0/24'
          allocation_pools: [{'start': '172.18.2.4', 'end': '172.18.2.250'}]
          gateway_ip: '172.18.2.1'
        internal_api_leaf3:
          vlan: 13
          ip_subnet: '172.18.3.0/24'
          allocation_pools: [{'start': '172.18.3.4', 'end': '172.18.3.250'}]
          gateway_ip: '172.18.3.1'
  4. 为您要添加的新 leaf 创建一个角色数据文件。

    1. 为您要添加的新叶叶复制 leaf Compute 和 leaf Ceph Storage 文件。

      Example

      在本例中,Compute1.yamlCephStorage1.yaml 分别从新 leaf, Compute3.yamlCephStorage3.yaml 复制。

      $ cp ~/roles/Compute1.yaml ~/roles/Compute3.yaml
      $ cp ~/roles/CephStorage1.yaml ~/roles/CephStorage3.yaml
    2. 编辑新 leaf 文件中的 name,HostnameFormatDefault, 和 deprecated_nic_config_name 参数,以便它们与相应的 Leaf 参数保持一致。

      Example

      例如,Leaf 1 Compute 文件中的参数具有以下值:

      - name: ComputeLeaf1
        HostnameFormatDefault: '%stackname%-compute-leaf1-%index%'
        deprecated_nic_config_name: 'computeleaf1.yaml'

      示例

      Leaf 1 Ceph Storage 参数具有以下值:

      - name: CephStorageLeaf1
        HostnameFormatDefault: '%stackname%-cephstorage-leaf1-%index%'
        deprecated_nic_config_name: 'ceph-strorageleaf1.yaml'
    3. 编辑新 leaf 文件中的 network 参数,以便它们与相应的 Leaf 网络参数保持一致。

      示例

      例如,Leaf 1 Compute 文件中的参数具有以下值:

      - name: ComputeLeaf1
        networks:
          InternalApi:
            subnet: internal_api_leaf1
          Tenant:
            subnet: tenant_leaf1
          Storage:
            subnet: storage_leaf1

      示例

      Leaf 1 Ceph Storage 参数具有以下值:

      - name: CephStorageLeaf1
        networks:
          Storage:
            subnet: storage_leaf1
          StorageMgmt:
            subnet: storage_mgmt_leaf1
    4. 角色配置完成后,运行以下命令来生成完整的角色数据文件。在您的网络中包含所有叶叶以及您要添加的新叶叶。

      示例

      在本例中,leaf3 添加到 leaf0, leaf1, 和 leaf2 中:

      $ openstack overcloud roles generate --roles-path ~/roles -o roles_data_spine_leaf.yaml Controller Compute Compute1 Compute2 Compute3 CephStorage CephStorage1 CephStorage2 CephStorage3

      这会创建一个完整的 roles_data_spine_leaf.yaml 文件,其中包含每个对应叶网络的所有自定义角色。

  5. 为要添加的叶创建一个自定义 NIC 配置。

    1. 为您要添加的新叶型复制 leaf Compute 和 leaf Ceph Storage NIC 配置文件。

      Example

      在本例中,computeleaf1.yamlceph-storageleaf1.yaml 复制到新的 leaf, computeleaf3.yamlceph-storageleaf3.yaml,代表:

      $ cp ~/templates/spine-leaf-nics/computeleaf1.yaml ~/templates/spine-leaf-nics/computeleaf3.yaml
      $ cp ~/templates/spine-leaf-nics/ceph-storageleaf1.yaml ~/templates/spine-leaf-nics/ceph-storageleaf3.yaml
    2. /usr/share/openstack-tripleo-heat-templates/network_data_spine_leaf.yaml 中,在文件中的 resource_registry 部分下,添加一组 ::Net::SoftwareConfig 资源,映射到对应的 NIC 模板:

      Example

      在本例中,添加了新的 leaf NIC 配置文件(computeleaf3.yamlceph-storageleaf3.yaml):

      resource_registry:
        OS::TripleO::Controller::Net::SoftwareConfig: /home/stack/templates/spine-leaf-nics/controller.yaml
        OS::TripleO::ComputeLeaf0::Net::SoftwareConfig: /home/stack/templates/spine-leaf-nics/computeleaf0.yaml
        OS::TripleO::ComputeLeaf1::Net::SoftwareConfig: /home/stack/templates/spine-leaf-nics/computeleaf1.yaml
        OS::TripleO::ComputeLeaf2::Net::SoftwareConfig: /home/stack/templates/spine-leaf-nics/computeleaf2.yaml
        OS::TripleO::ComputeLeaf3::Net::SoftwareConfig: /home/stack/templates/spine-leaf-nics/computeleaf3.yaml
        OS::TripleO::CephStorageLeaf0::Net::SoftwareConfig: /home/stack/templates/spine-leaf-nics/ceph-storageleaf0.yaml
        OS::TripleO::CephStorageLeaf1::Net::SoftwareConfig: /home/stack/templates/spine-leaf-nics/ceph-storageleaf1.yaml
        OS::TripleO::CephStorageLeaf2::Net::SoftwareConfig: /home/stack/templates/spine-leaf-nics/ceph-storageleaf2.yaml
        OS::TripleO::CephStorageLeaf3::Net::SoftwareConfig: /home/stack/templates/spine-leaf-nics/ceph-storageleaf3.yaml

      这些资源映射会在部署过程中覆盖默认资源映射。

      因此,您现在有一组 NIC 模板和一个环境文件,它将所需的 ::Net::SoftwareConfig 资源映射到它们。最终运行 openstack overcloud deploy 命令时,请确保按以下顺序包含环境文件:

    3. /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml,它可启用网络隔离。

      请注意,director 从 network-isolation.j2.yaml Jinja2 模板呈现此文件。

    4. /usr/share/openstack-tripleo-heat-templates/environments/network-environment.yaml,它是默认的网络环境文件,包括默认的 NIC 资源映射。

      请注意,director 从 network-environment.j2.yaml Jinja2 模板呈现此文件。

    5. /home/stack/templates/spine-leaf-nics.yaml,其中包含您的自定义 NIC 资源映射并覆盖默认 NIC 资源映射。

      以下命令片断演示了排序:

      $ openstack overcloud deploy --templates
          ...
          -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \
          -e /usr/share/openstack-tripleo-heat-templates/environments/network-environment.yaml \
          -e /home/stack/templates/spine-leaf-nics.yaml \
          ...
  6. 更新 control plane 参数。

    ~/templates/spine-leaf-ctlplane.yaml 中,在 parameter_defaults 部分下为新的 leaf 网络添加 control plane 子网映射:

    Example

    在本例中,添加了新的 leaf (leaf3)条目:

    parameter_defaults:
      ...
      ControllerControlPlaneSubnet: leaf0
      Compute0ControlPlaneSubnet: leaf0
      Compute1ControlPlaneSubnet: leaf1
      Compute2ControlPlaneSubnet: leaf2
      Compute3ControlPlaneSubnet: leaf3
      CephStorage0ControlPlaneSubnet: leaf0
      CephStorage1ControlPlaneSubnet: leaf1
      CephStorage2ControlPlaneSubnet: leaf2
      CephStorage3ControlPlaneSubnet: leaf3
  7. 映射新的叶网络。

    ~/templates/spine-leaf-separate.yaml 中,在 parameter_defaults 部分下,包括新叶网络的外部网络映射。

    • 对于扁平网络映射,列出 NeutronFlatNetworks 参数中的新 leaf (leaf3),并为新的叶设置 NeutronBridgeMappings 参数:

      parameter_defaults:
        NeutronFlatNetworks: leaf0,leaf1,leaf2, leaf3
        Controller0Parameters:
          NeutronBridgeMappings: "leaf0:br-ex"
        Compute0Parameters:
          NeutronBridgeMappings: "leaf0:br-ex"
        Compute1Parameters:
          NeutronBridgeMappings: "leaf1:br-ex"
        Compute2Parameters:
          NeutronBridgeMappings: "leaf2:br-ex"
        Compute3Parameters:
          NeutronBridgeMappings: "leaf3:br-ex"
    • 对于 VLAN 网络映射,还要将 NeutronNetworkVLANRanges 设置为映射新叶(leaf3)网络的 VLAN:

        NeutronNetworkType: 'geneve,vlan'
        NeutronNetworkVLANRanges: 'leaf0:1:1000,leaf1:1:1000,leaf2:1:1000,leaf3:1:1000'
  8. 按照 第 4.7 节 “部署启用了 spine-leaf 的 overcloud” 中的步骤重新部署启用了 spine-leaf 的 overcloud。
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.