4.2. 创建角色数据文件


要为每个叶定义每个可组合角色,并将可组合网络附加到每个对应的角色,请完成以下步骤。

流程

  1. stack 用户的主目录中创建自定义角色目录:

    $ mkdir ~/roles
  2. 将默认的 Controller、Compute 和 Ceph Storage 角色从 director 核心模板集合复制到 roles 目录。重命名 Compute 和 Ceph Storage 的文件以适合 Leaf 0 :

    $ cp /usr/share/openstack-tripleo-heat-templates/roles/Controller.yaml ~/roles/Controller.yaml
    $ cp /usr/share/openstack-tripleo-heat-templates/roles/Compute.yaml ~/roles/Compute0.yaml
    $ cp /usr/share/openstack-tripleo-heat-templates/roles/CephStorage.yaml ~/roles/CephStorage0.yaml
  3. 复制 Leaf 0 Compute 和 Ceph Storage 文件作为您的 Leaf 1 和 Leaf 2 文件的基础:

    $ cp ~/roles/Compute0.yaml ~/roles/Compute1.yaml
    $ cp ~/roles/Compute0.yaml ~/roles/Compute2.yaml
    $ cp ~/roles/CephStorage0.yaml ~/roles/CephStorage1.yaml
    $ cp ~/roles/CephStorage0.yaml ~/roles/CephStorage2.yaml
  4. 编辑 Leaf 0, Leaf 1, 和 Leaf 2 文件中的 name, HostnameFormatDefault, and deprecated_nic_config_name 参数,以便它们与对应的 Leaf 参数一致。例如,Leaf 0 Compute 文件中的参数具有以下值:

    - name: ComputeLeaf0
      HostnameFormatDefault: '%stackname%-compute-leaf0-%index%'
      deprecated_nic_config_name: 'computeleaf0.yaml'

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

    - name: CephStorageLeaf0
      HostnameFormatDefault: '%stackname%-cephstorage-leaf0-%index%'
      deprecated_nic_config_name: 'ceph-strorageleaf0.yaml'
  5. 编辑 Leaf 1 和 Leaf 2 文件中的 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
    注意

    这只适用于 Leaf 1 和 Leaf 2。Leaf 0 的 network 参数保留基本子网值,这些值是每个子网的小写名称再加上一个 _subnet 后缀。例如,Leaf 0 的内部 API 是 internal_api_subnet

  6. 角色配置完成后,运行以下命令来生成完整的角色数据文件:

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

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

每个角色都有自己的 NIC 配置。在配置 spine-leaf 配置前,您必须创建一个基本 NIC 模板集合来适合您的当前 NIC 配置。

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2026 Red Hat
返回顶部