Nova cells

在 Train 版本中,Kolla Ansible 完全支持 Nova cells v2 扩展功能。虽然配置 Nova cells 的文档在 Kolla Ansible 中有说明,但将该配置在 Kayobe 中实现的方式在此处记录。

在 Kolla Ansible 中,Nova cells 通过组变量进行配置。在 Kayobe 中,这些组变量可以通过 Kayobe 配置来设置。例如,要配置 cell0001,可以创建以下文件

$KAYOBE_CONFIG_PATH/kolla/inventory/group_vars/cell0001/all
---
nova_cell_name: cell0001
nova_cell_novncproxy_group: cell0001-vnc
nova_cell_conductor_group: cell0001-control
nova_cell_compute_group: cell0001-compute

定义 cell group_vars 后,可以配置 Kayobe 资源清单。在 Kayobe 中,cell 控制器和 cell 计算主机将成为现有 controllerscompute Kayobe 组的一部分,因为通常需要以相同的方式配置它们。在 Kolla Ansible 中,为了防止非 cell 服务被映射到 cell 控制器,必须将 controllers 组拆分为两个。资源清单文件还应包含 cell 定义。以下组和主机文件提供了一个示例,说明如何实现这一点

$KAYOBE_CONFIG_PATH/inventory/groups
 # Kayobe groups inventory file. This file should generally not be modified.
 # If declares the top-level groups and sub-groups.

 ###############################################################################
 # Seed groups.

 [seed]
 # Empty group to provide declaration of seed group.

 [seed-hypervisor]
 # Empty group to provide declaration of seed-hypervisor group.

 [container-image-builders:children]
 # Build container images on the seed by default.
 seed

 ###############################################################################
 # Overcloud groups.

 [controllers]
 # Empty group to provide declaration of controllers group.

 [network:children]
 # Add controllers to network group by default for backwards compatibility,
 # although they could be separate hosts.
 top-level-controllers

 [monitoring]
 # Empty group to provide declaration of monitoring group.

 [storage]
 # Empty group to provide declaration of storage group.

 [compute]
 # Empty group to provide declaration of compute group.

 # Empty group to provide declaration of top-level controllers.
 [top-level-controllers]

 [overcloud:children]
 controllers
 network
 monitoring
 storage
 compute

 ###############################################################################
 # Docker groups.

 [docker:children]
 # Hosts in this group will have Docker installed.
 seed
 controllers
 network
 monitoring
 storage
 compute

 [docker-registry:children]
 # Hosts in this group will have a Docker Registry deployed. This group should
 # generally contain only a single host, to avoid deploying multiple independent
 # registries which may become unsynchronized.
 seed

 ###############################################################################
 # Baremetal compute node groups.

 [baremetal-compute]
 # Empty group to provide declaration of baremetal-compute group.

 ###############################################################################
 # Networking groups.

 [mgmt-switches]
 # Empty group to provide declaration of mgmt-switches group.

 [ctl-switches]
 # Empty group to provide declaration of ctl-switches group.

 [hs-switches]
 # Empty group to provide declaration of hs-switches group.

 [switches:children]
 mgmt-switches
 ctl-switches
 hs-switches
$KAYOBE_CONFIG_PATH/inventory/hosts
 # Kayobe hosts inventory file. This file should be modified to define the hosts
 # and their top-level group membership.

 # This host acts as the configuration management Ansible control host. This must be
 # localhost.
 localhost ansible_connection=local

 [seed-hypervisor]
 # Add a seed hypervisor node here if required. This host will run a seed node
 # Virtual Machine.

 [seed]
 operator

 [controllers:children]
 top-level-controllers
 cell-controllers

 [top-level-controllers]
 control01

 [cell-controllers:children]
 cell01-control
 cell02-control

 [compute:children]
 cell01-compute
 cell02-compute

 [cell01:children]
 cell01-control
 cell01-compute
 cell01-vnc

 [cell01-control]
 control02

 [cell01-vnc]
 control02

 [cell01-compute]
 compute01

 [cell02:children]
 cell02-control
 cell02-compute
 cell02-vnc

 [cell02-control]
 control03

 [cell02-vnc]
 control03

 [cell02-compute]
 compute02
 compute03

 ##################################

 [mgmt-switches]
 # Add management network switches here if required.

 [ctl-switches]
 # Add control and provisioning switches here if required.

 [hs-switches]
 # Add high speed switches here if required.

配置 Kayobe 资源清单后,可以配置 Kolla Ansible 资源清单。目前可以通过 kolla_overcloud_inventory_top_level_group_map 变量来完成。例如,要配置 Kayobe 资源清单中定义的两个 cell,可以将该变量设置为以下内容

$KAYOBE_CONFIG_PATH/kolla.yml
kolla_overcloud_inventory_top_level_group_map:
  control:
    groups:
      - top-level-controllers
  network:
    groups:
      - network
  compute:
    groups:
      - compute
  monitoring:
    groups:
      - monitoring
  cell-control:
    groups:
      - cell-controllers
  cell0001:
    groups:
      - cell01
  cell0001-control:
     groups:
      - cell01-control
  cell0001-compute:
    groups:
      - cell01-compute
  cell0001-vnc:
    groups:
      - cell01-vnc
  cell0002:
    groups:
      - cell02
  cell0002-control:
    groups:
      - cell02-control
  cell0002-compute:
    groups:
      - cell02-compute
  cell0002-vnc:
    groups:
      - cell02-vnc

最后,可以在 Kolla Ansible 中启用 Nova cells

$KAYOBE_CONFIG_PATH/kolla/globals.yml
 enable_cells: True