4.11. 将新叶添加到 spine-leaf 部署中


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

先决条件

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

流程

  1. stack 用户身份登录 undercloud 主机。
  2. 查找 stackrc undercloud 凭据文件:

    $ source ~/stackrc
  3. 打开网络定义模板,例如 /home/stack/templates/spine-leaf-networks-data.yaml。在适当的基础网络下,添加一个叶子网作为您要添加的新叶的可组合网络项。

    示例

    在本例中,添加了新的 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. 为您要添加的新叶创建一个角色数据文件。

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

      示例

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

      $ cp ~/roles/Compute1.yaml ~/roles/Compute3.yaml
      $ cp ~/roles/CephStorage1.yaml ~/roles/CephStorage3.yaml
    2. 编辑新叶文件中的 nameHostnameFormatDefault 参数,使其与对应的叶参数一致。

      示例

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

      - name: ComputeLeaf1
        HostnameFormatDefault: '%stackname%-compute-leaf1-%index%'

      示例

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

      - name: CephStorageLeaf1
        HostnameFormatDefault: '%stackname%-cephstorage-leaf1-%index%'
    3. 编辑新叶文件中的 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. 角色配置完成后,运行以下命令来生成完整的角色数据文件。在您的网络中包含所有 leafs,以及您要添加的新 leafs。

      示例

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

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

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

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

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

      示例

      在本例中,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
  6. 打开包含每个角色的角色和自定义 NIC 模板映射的自定义环境文件,如 spine-leaf-nic-roles-map.yaml。为您要添加的新叶插入每个角色的条目。

    parameter_defaults:
      %%ROLE%%NetworkConfigTemplate: <path_to_ansible_jinja2_nic_config_file>

    示例

    在本例中,添加了 ComputeLeaf3NetworkConfigTemplateCephStorage3NetworkConfigTemplate 条目:

    parameter_defaults:
      Controller0NetworkConfigTemplate: '/home/stack/templates/spine-leaf-nics/single-nic-vlans.j2'
      Controller1NetworkConfigTemplate: '/home/stack/templates/spine-leaf-nics/single-nic-vlans.j2'
      Controller2NetworkConfigTemplate: '/home/stack/templates/spine-leaf-nics/single-nic-vlans.j2'
      ComputeLeaf0NetworkConfigTemplate: '/home/stack/templates/spine-leaf-nics/single-nic-vlans.j2'
      ComputeLeaf1NetworkConfigTemplate: '/home/stack/templates/spine-leaf-nics/single-nic-vlans.j2'
      ComputeLeaf2NetworkConfigTemplate: '/home/stack/templates/spine-leaf-nics/single-nic-vlans.j2'
      ComputeLeaf3NetworkConfigTemplate: '/home/stack/templates/spine-leaf-nics/single-nic-vlans.j2'
      CephStorage0NetworkConfigTemplate: '/home/stack/templates/spine-leaf-nics/single-nic-vlans.j2'
      CephStorage1NetworkConfigTemplate: '/home/stack/templates/spine-leaf-nics/single-nic-vlans.j2'
      CephStorage2NetworkConfigTemplate: '/home/stack/templates/spine-leaf-nics/single-nic-vlans.j2'
      CephStorage3NetworkConfigTemplate: '/home/stack/templates/spine-leaf-nics/single-nic-vlans.j2'
  7. 打开包含独立网络映射的自定义网络环境文件,并设置对 overcloud 的 control plane 网络的访问权限,如 spine-leaf-ctlplane.yaml 并更新 control plane 参数。

    parameter_defaults 部分下,为新的叶网络添加 control plane 子网映射。此外,也包括新叶网络的外部网络映射。

    • 对于扁平网络映射,在 NeutronFlatNetworks 参数中列出新叶(leaf3),并为新的 leaf 设置 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'

      示例

      在本例中,使用了扁平网络映射,并且添加了新的 leaf (leaf3)条目:

      parameter_defaults:
        NeutronFlatNetworks: leaf0,leaf1,leaf2,leaf3
        Controller0Parameters:
          NeutronBridgeMappings: "leaf0:br-ex"
        ControllerControlPlaneSubnet: leaf0
        Controller1Parameters:
          NeutronBridgeMappings: "leaf0:br-ex"
        Controller1ControlPlaneSubnet: leaf0
        Controller2Parameters:
          NeutronBridgeMappings: "leaf0:br-ex"
        Controller2ControlPlaneSubnet: leaf0
        Compute0Parameters:
          NeutronBridgeMappings: "leaf0:br-ex"
        Compute0ControlPlaneSubnet: leaf0
        Compute1Parameters:
          NeutronBridgeMappings: "leaf1:br-ex"
        Compute1ControlPlaneSubnet: leaf1
        Compute2Parameters:
          NeutronBridgeMappings: "leaf2:br-ex"
        Compute2ControlPlaneSubnet: leaf2
        Compute3Parameters:
          NeutronBridgeMappings: "leaf3:br-ex"
        Compute3ControlPlaneSubnet: leaf3
  8. 按照 部署启用了 spine-leaf 的 overcloud 中的步骤,重新部署启用了 spine-leaf 的 overcloud
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2026 Red Hat
返回顶部