Red Hat Training

A Red Hat training course is available for Red Hat OpenStack Platform

11.6. 自定义网络的网络接口注意事项

当您使用可组合网络时,process-templates.py 脚本会呈现静态模板,使其包含您在 network_data.yamlroles_data.yaml 文件中定义的网络和角色。确保您的渲染的 NIC 模板包含以下项目:

  • 每个角色(包括自定义可组合网络)的静态文件。
  • 每个角色的每个静态文件都包含正确的网络定义。

每个静态文件都需要自定义网络的所有参数定义,即使角色上未使用了网络。检查以确保渲染的模板包含这些参数。例如,如果只将 StorageBackup 网络添加到 Ceph 节点,则所有角色的 NIC 配置模板中的 parameter 部分还包括此定义:

parameters:
  ...
  StorageBackupIpSubnet:
    default: ''
    description: IP address/subnet on the external network
    type: string
  ...

如果需要,您还可以包含 VLAN ID 和/或网关 IP 的参数定义:

parameters:
  ...
  StorageBackupNetworkVlanID:
    default: 60
    description: Vlan ID for the management network traffic.
    type: number
  StorageBackupDefaultRoute:
	  description: The default route of the storage backup network.
	  type: string
  ...

自定义网络的 IpSubnet 参数会出现在每个角色的参数定义中。但是,由于 Ceph 角色可能是唯一使用 StorageBackup 网络的角色,因此只有 Ceph 角色的 NIC 配置模板才会在模板的 network_config 部分中使用 StorageBackup 参数。

      $network_config:
        network_config:
        - type: interface
          name: nic1
          use_dhcp: false
          addresses:
          - ip_netmask:
              get_param: StorageBackupIpSubnet