跳转到: 导航, 搜索

Blueprint-nova-compute-cells

Warning.svg 旧设计页面

此页面用于帮助设计已实现的功能。因此,此页面可能不会更新,并且可能包含过时的信息。上次更新时间为 2014-12-10

  • Launchpad 条目: NovaSpec:nova-compute-cells
  • 创建者: Chris Behrens
  • 贡献者: Chris Behrens, Brian Elliott, Dragon, Alex Meade, Brian Lamar, Matt Sherborne, Sam Morrison

总结

此蓝图引入了新的 nova-cells 服务。

该服务的目标是

  • 允许额外的扩展和(地理)分布,而无需复杂的数据库或消息队列集群
  • 将 Cell 调度与主机调度分离

发布说明

原理

术语和历史

熟悉 Amazon EC2 (例如) 的读者会理解

  • 地理区域有多个可用区
  • 可用区是经过工程设计,可以与其他可用区隔离故障的位置,并提供与其他同一区域可用区之间的廉价、低延迟网络连接。(AWS 术语)
  • 例如 EU-West-1 有 EU-West-1a EU-West-1b EU-West-1c。
  • 客户端连接到区域(即 EC2 端点)
  • 在请求虚拟机时,如果未指定可用区,调度器将选择在区域中使用哪个可用区
  • 或者,如果用户指定了可用区,虚拟机将启动在该可用区

“区域”的支持存在于 OpenStack 的早期版本中。Bexar 版本基于 Amazon 术语实现了实例的 `Availability Zones`。

Zone

后来,出现了 Nova `Zone` 的概念

  • 一个独立的 Nova 部署被称为一个 Zone。
  • 一个 Zone 允许您将部署划分为逻辑组,以进行负载均衡和实例分布。至少,一个 Zone 需要一个 API 节点、一个调度器节点、一个数据库和 RabbitMQ。Zones 之间不共享任何内容。数据库、队列、用户或项目定义在 Zones 之间不共享。(OpenStack 术语)

Zone 之间的通信被认为是不可信的,Zone 之间的通信将仅使用公共 OpenStack API 进行。在 Diablo 中,随着 Keystone 的添加,Zones 变得无法使用,在 Essex 中它们被完全删除。

介绍 Cells

在 Folsom 设计峰会上,在邮件列表中进行了一些讨论后,Chris Behrens 提出了 'Folsom Compute Cells' 作为替换旧的 'Zone' 概念的新设计。与之前不同,Cell-Cell 通信是可信的,并通过 AQMP 总线进行。

设计

服务实现基于

  • 每个 Cell 一个单独的数据库和消息代理
  • 通过可插拔驱动程序进行 Cell 间通信(RPC 是当前唯一的可用驱动程序)
  • 树形结构,其中
    • nova-API 服务器仅位于“顶级 Cell”中,不在子 Cell 中
    • 支持多个父 Cell
  • 来自子 Cell 推送的信息的 Cell 调度数据库,
    • 基于周期性广播的能力和容量
    • 基于数据库更新(实例更新/销毁/故障创建)

每个 Cell 的服务

一个 API Cell 包含

  • AMQP Broker
  • 数据库
  • nova-cells
  • nova-api

一个子 Cell 包含

  • AMQP Broker
  • 数据库
  • nova-cells
  • nova-scheduler
  • nova-network
  • nova-compute

全局服务

  • Glance
  • Keystone

Cell 路由

待定

配置

为 Cells 添加了新的配置选项,这些选项位于自己的配置组中,称为 'cells'。应该在 nova.conf 中创建一个 [cells] 部分。

选项

  • `enable` # 启用 cells 代码
  • `name` # 当前 Cell 的一个短名称。将其视为一个非完全限定的主机名,例如 'api'
  • `capabilities` # 向邻近 Cell 宣传的任意键/值对。(在第一个实现中未使用)

此外,您还需要在 DEFAULT 部分配置其他选项,例如 `compute_api_class` 和 `quota_driver`

示例 API Cell 配置

[DEFAULT]
# Swap out the compute_api class so actions are proxied to nova-cells service.
compute_api_class=nova.compute.cells_api.ComputeCellsAPI

[cells]
name=api
enable=true


示例子 Cell 配置

[GLOBAL]
# Disable quota checking in child cells.  Let API cell do it exclusively.
quota_driver=nova.quota.NoopQuotaDriver

[cells]
enable=true
name=cell1  # something unique per child cell


在将服务在线之前,您需要告诉每个 Cell 彼此的信息。全局 Cell 需要知道其直接子 Cell。子 Cell 需要知道其直接父 Cell。所需的信息是特定 Cell 的 rabbit 服务器凭据。我们可以在每个 Cell 中通过 nova-manage 添加这些信息。

nova-manage cell create usage


> bin/nova-manage cell create -h
Usage: nova-manage cell create <args> [options]

Options:
  -h, --help            show this help message and exit
  --name=<name>         Name for the new cell
  --cell_type=<parent|child>
                        Whether the cell is a parent or child
  --username=<username>
                        Username for the message broker in this cell
  --password=<password>
                        Password for the message broker in this cell
  --hostname=<hostname>
                        Address of the message broker in this cell
  --port=<number>       Port number of the message broker in this cell
  --virtual_host=<virtual_host>
                        The virtual host of the message broker in this cell
  --woffset=<float>     
  --wscale=<float>


假设我们有一个名为 'api' 的 API Cell 和 2 个子 Cell 'cell1' 和 'cell2'。在 api Cell 中,我们有以下 rabbit 服务器信息

rabbit_host=10.0.0.10 rabbit_port=5672 rabbit_username=api_user rabbit_password=api_passwd rabbit_virtual_host=api_vhost

在名为 'cell1' 的子 Cell 中,我们有以下 rabbit 服务器信息

rabbit_host=10.0.1.10 rabbit_port=5673 rabbit_username=cell1_user rabbit_password=cell1_passwd rabbit_virtual_host=cell1_vhost

在名为 'cell2' 的子 Cell 中,我们有以下 rabbit 服务器信息

rabbit_host=10.0.2.10 rabbit_port=5673 rabbit_username=cell2_user rabbit_password=cell2_passwd rabbit_virtual_host=cell2_vhost

我们将在 API Cell 中运行这些命令,以告诉它其子 Cell


> nova-manage cell create --name=cell1 --cell_type=child --username=cell1_user --password=cell1_passwd --hostname=10.0.1.10 --port=5673 --virtual_host=cell1_vhost --woffset=1.0 --wscale=1.0
> nova-manage cell create --name=cell2 --cell_type=child --username=cell2_user --password=cell2_passwd --hostname=10.0.2.10 --port=5673 --virtual_host=cell2_vhost --woffset=1.0 --wscale=1.0


在两个子 Cell 中,我们将运行此命令,以告诉它们其父 Cell


> nova-manage cell create --name=api --cell_type=parent --username=api1_user --password=api1_passwd --hostname=10.0.0.10 --port=5672 --virtual_host=api_vhost --woffset=1.0 --wscale=1.0


参考文献