3.4. 为路由网络创建单元角色文件
当每个堆栈使用不同的网络时,为每个单元堆栈创建一个单元角色文件,其中包含自定义单元角色。
注意
您必须为每个自定义角色创建一个类别。如需更多信息,请参阅为单元角色设计主机。
流程
生成包含
CellController
角色的新角色数据文件,以及您在单元堆栈所需的其他角色。以下示例生成角色数据文件cell1_roles_data.yaml
,其中包括角色CellController
和Compute
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow openstack overcloud roles generate \ --roles-path /usr/share/openstack-tripleo-heat-templates/roles \ -o cell1/cell1_roles_data.yaml \ Compute:ComputeCell1 \ CellController:CellControllerCell1
(undercloud)$ openstack overcloud roles generate \ --roles-path /usr/share/openstack-tripleo-heat-templates/roles \ -o cell1/cell1_roles_data.yaml \ Compute:ComputeCell1 \ CellController:CellControllerCell1
将
HostnameFormatDefault
添加到新单元角色文件中的每个角色定义中:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - name: ComputeCell1 ... HostnameFormatDefault: '%stackname%-compute-cell1-%index%' ServicesDefault: ... networks: ... - name: CellControllerCell1 ... HostnameFormatDefault: '%stackname%-cellcontrol-cell1-%index%' ServicesDefault: ... networks: ...
- name: ComputeCell1 ... HostnameFormatDefault: '%stackname%-compute-cell1-%index%' ServicesDefault: ... networks: ... - name: CellControllerCell1 ... HostnameFormatDefault: '%stackname%-cellcontrol-cell1-%index%' ServicesDefault: ... networks: ...
将网络服务(neutron) DHCP 和元数据代理添加到
ComputeCell1
和CellControllerCell1
角色(如果它们尚不存在):Copy to Clipboard Copied! Toggle word wrap Toggle overflow - name: ComputeCell1 ... HostnameFormatDefault: '%stackname%-compute-cell1-%index%' ServicesDefault: - OS::TripleO::Services::NeutronDhcpAgent - OS::TripleO::Services::NeutronMetadataAgent ... networks: ... - name: CellControllerCell1 ... HostnameFormatDefault: '%stackname%-cellcontrol-cell1-%index%' ServicesDefault: - OS::TripleO::Services::NeutronDhcpAgent - OS::TripleO::Services::NeutronMetadataAgent ... networks: ...
- name: ComputeCell1 ... HostnameFormatDefault: '%stackname%-compute-cell1-%index%' ServicesDefault: - OS::TripleO::Services::NeutronDhcpAgent - OS::TripleO::Services::NeutronMetadataAgent ... networks: ... - name: CellControllerCell1 ... HostnameFormatDefault: '%stackname%-cellcontrol-cell1-%index%' ServicesDefault: - OS::TripleO::Services::NeutronDhcpAgent - OS::TripleO::Services::NeutronMetadataAgent ... networks: ...
将您在
network_data_routed_multi_cell.yaml
中配置的子网添加到ComputeCell1
和CellControllerCell1
角色中:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - name: ComputeCell1 ... networks: InternalApi: subnet: internal_api_subnet_cell1 Tenant: subnet: tenant_subnet_cell1 Storage: subnet: storage_subnet_cell1 ... - name: CellControllerCell1 ... networks: External: subnet: external_subnet InternalApi: subnet: internal_api_subnet_cell1 Storage: subnet: storage_subnet_cell1 StorageMgmt: subnet: storage_mgmt_subnet_cell1 Tenant: subnet: tenant_subnet_cell1
- name: ComputeCell1 ... networks: InternalApi: subnet: internal_api_subnet_cell1 Tenant: subnet: tenant_subnet_cell1 Storage: subnet: storage_subnet_cell1 ... - name: CellControllerCell1 ... networks: External: subnet: external_subnet InternalApi: subnet: internal_api_subnet_cell1 Storage: subnet: storage_subnet_cell1 StorageMgmt: subnet: storage_mgmt_subnet_cell1 Tenant: subnet: tenant_subnet_cell1