第 3 章 在 undercloud 中配置路由的 spine-leaf

本节介绍了如何配置 undercloud 以适应带有可组合网络的路由的 spine-leaf 的用例。

3.1. 配置 spine leaf provisioning 网络

要为您的 spine leaf infrastructure 配置置备网络,请编辑 undercloud.conf 文件并设置以下流程中包含的相关参数。

流程

  1. stack 用户的身份登录 undercloud。
  2. 如果您还没有 undercloud.conf 文件,请复制示例模板文件:

    [stack@director ~]$ cp /usr/share/python-tripleoclient/undercloud.conf.sample ~/undercloud.conf
  3. 编辑 undercloud.conf 文件。
  4. [DEFAULT] 部分中设置以下值:

    1. local_ip 设置为 leaf0 上的 undercloud IP:

      local_ip = 192.168.10.1/24
    2. undercloud_public_host 设置为 undercloud 的外部面向外部的 IP 地址:

      undercloud_public_host = 10.1.1.1
    3. undercloud_admin_host 设置为 undercloud 的管理 IP 地址。这个 IP 地址通常位于 leaf0 中:

      undercloud_admin_host = 192.168.10.2
    4. local_interface 设置为本地网络的桥接:

      local_interface = eth1
    5. enable_routed_networks 设置为 true

      enable_routed_networks = true
    6. 使用 subnets 参数定义子网列表。在路由 spine 和 leaf 中为每个 L2 片段定义一个子网:

      subnets = leaf0,leaf1,leaf2
    7. 使用 local_subnet 参数指定与 undercloud 物理 L2 段本地关联的子网:

      local_subnet = leaf0
    8. 设置 undercloud_nameservers 的值。

      undercloud_nameservers = 10.11.5.19,10.11.5.20
      提示

      您可以通过查看 /etc/resolv.conf 来查找用于 undercloud 名称服务器的 DNS 服务器的当前 IP 地址。

  5. 为您在 subnets 参数中定义的每个子网创建一个新部分:

    [leaf0]
    cidr = 192.168.10.0/24
    dhcp_start = 192.168.10.10
    dhcp_end = 192.168.10.90
    inspection_iprange = 192.168.10.100,192.168.10.190
    gateway = 192.168.10.1
    masquerade = False
    
    [leaf1]
    cidr = 192.168.11.0/24
    dhcp_start = 192.168.11.10
    dhcp_end = 192.168.11.90
    inspection_iprange = 192.168.11.100,192.168.11.190
    gateway = 192.168.11.1
    masquerade = False
    
    [leaf2]
    cidr = 192.168.12.0/24
    dhcp_start = 192.168.12.10
    dhcp_end = 192.168.12.90
    inspection_iprange = 192.168.12.100,192.168.12.190
    gateway = 192.168.12.1
    masquerade = False
  6. 保存 undercloud.conf 文件。
  7. 运行 undercloud 安装命令:

    [stack@director ~]$ openstack undercloud install

此配置会在 provisioning 网络或 control plane 上创建三个子网。overcloud 使用每个网络来调配各个子叶中的系统。

为确保 DHCP 请求正确中继到 undercloud,您可能需要配置 DHCP 转发。