maas+juju+openstack,OpenStack Charms Deployment Guide0.0.1.dev191

OpenStack Charms Deployment Guide0.0.1.dev191
OpenStack Charms 部署指南0.0.1.dev191

Overview
概述
The main purpose of the OpenStack Charms Deployment Guide is to demonstrate how to build a multi-node OpenStack cloud with MAAS, Juju, and OpenStack Charms. For accessibility reasons, the cloud will be minimal, while remaining capable of both performing some real work and scaling to fit more ambitious projects.
OpenStack Charms部署指南的主要目的是演示如何使用MAAS、Juju和OpenStack Charms构建多节点的OpenStack云。由于可访问性的原因,云将是最小的,同时保留执行一些实际工作和扩展以适应更雄心勃勃的项目的能力。

Software versions used in this guide are as follows:
本指南中使用的软件版本如下

Ubuntu 18.04 LTS (Bionic) for the MAAS system, its cluster nodes, and all cloud nodes
用于MAAS系统的Ubuntu 18.04 LTS(Bionic),它的集群节点和所有云节点

MAAS 2.6.2

Juju 2.7.6

OpenStack Ussuri(虽然说是ussuri,但是实际版本是train)

Note

For OpenStack Charms project information, development guidelines, release notes, and release schedules, please refer to the OpenStack Charm Guide.
有关OpenStack Charms项目信息、开发指南、发布说明和发布时间表,请参阅OpenStack Charms指南

Install MAAS
安装MAAS

Overview
概述

In the previous section, we gave a summary of the OpenStack cloud we’ll be building and described the approach we’ll take for doing that.
在上一节中,我们总结了将要构建的OpenStack云,并描述了为此采取的方法。

This page will cover the installation of MAAS as well as point out what is required out of MAAS in terms of post-installation tasks. The goal is to achieve a network topology that is both simple yet scalable and functional.
本页将介绍MAAS的安装,并指出MAAS在安装后需要完成哪些任务。我们的目标是实现一个既简单又可伸缩又实用的网络拓扑

Requirements
需求
The entire environment will consist of a single MAAS system with five nodes. This MAAS cluster will contain a single zone, with the MAAS system (region and rack controllers) connected to both the external network and the single zone.
整个环境将由具有五个节点的单个MAAS系统组成。这个MAAS集群将包含单个区域,MAAS系统(区域和机架控制器)连接到外部网络和单个区域。

Here are the hardware requirements:
硬件需求如下:

1 x MAAS system: 8GiB RAM, 2 CPUs, 1 NIC, 1 x 40GiB storage

1 x Juju controller node: 4GiB RAM, 2 CPUs, 1 NIC, 1 x 40GiB storage

4 x cloud nodes: 8GiB RAM, 2 CPUs, 2 NICs, 3 x 80GiB storage

See MAAS requirements in the MAAS documentation for more detailed information on what a MAAS system may require.
关于MAAS系统可能需要什么,请参阅MAAS文档中的MAAS要求以获得更详细的信息。

It is assumed that all six systems are physical in nature. Although not a requirement, the Juju and cloud nodes used here are of the AMD64 architecture type.
假定所有六个系统本质上都是物理的。 尽管不是必需的,但此处使用的Juju和云节点属于AMD64体系结构类型。

MAAS is also considered to be the sole provider of DHCP and DNS for the network hosting the MAAS cluster.
MAAS还被认为是托管MAAS集群的网络的唯一DHCP和DNS提供者。

The MAAS system’s single network interface resides on subnet 10.0.0.0/21 and the system itself has an assigned IP address of 10.0.0.3.
MAAS系统的单个网络接口位于子网10.0.0.0/21上,系统本身具有分配的IP地址10.0.0.3。

Attention
注意

The MAAS-provisioned nodes rely upon Bionic AMD64 images provided by MAAS.
maas提供的节点依赖于MAAS提供的Bionic AMD64 镜像。

Install MAAS
安装MAAS

Here is a concise summary of how to install and initialise MAAS on the designated system but make sure to consult the official MAAS installation instructions for details:
以下是如何在指定系统上安装和初始化MAAS的简要摘要,但请务必参考官方的MAAS安装说明以获得详细信息

sudo apt-add-repository -y ppa:maas/2.6
sudo apt install -y maas
sudo maas init --admin-username admin --admin-password ubuntu \
   --admin-email admin@example.com --admin-ssh-import <username>
sudo maas-region apikey --username=admin > ~/admin-api-key

See maas init --help for details.
详细的细节,请使用 maas init --help 指令

Notes:
注:

MAAS does not currently make use of the email address supplied to the maas init command.
MAAS目前未使用提供给MAAS init命令的电子邮件地址。

The maas init command cannot be invoked a second time.
不能再次调用maas init命令。

The last command puts a copy of the API key for user ‘admin’ in a file. We’ll need this information on the next page.
最后一个命令将用于用户admin的API密钥复制到一个文件中。在后面我们需要这些信息。

Note

See Concepts and terms in the MAAS documentation for clarification on the terminology used within MAAS.
参见MAAS文件中的概念和术语,以确认在MAAS中使用的术语。

Post installation tasks
后续安装工作
There are a number of tasks to complete once the MAAS system is installed.
在安装MAAS系统之后,有许多任务需要完成

Web UI and on-boarding
Based on the previous command invocations, the credentials of the newly created MAAS administrator are:
根据前面的命令调用,新创建的MAAS管理员的凭据为:

Username: admin
Password: ubuntu

In this example, the address of the MAAS system is 10.0.0.3.
在本例中,MAAS系统的地址是10.0.0.3

The web UI URL then becomes:
页面UI URL为:

http://10.0.0.3:5240/MAAS

You will be whisked through an on-boarding process when you access the web UI for the first time. Recall that we require 18.04 LTS AMD64 images.
当您第一次访问web UI时,将迅速完成一个登录过程。回忆一下,我们需要18.04 LTS AMD64镜像。

Enable DHCP
使能DHCP
DHCP must be enabled on the VLAN that affects the subnet where the five nodes reside. See Handling DHCP in the MAAS documentation for guidance.
必须在影响五个节点所在子网的VLAN上启用DHCP。参见MAAS文档中的DHCP处理指南

Verify images
The on-boarding process should have taken care of the image downloads. Verify this by visiting the Images page in the web UI.
验证镜像
加载过程应该已经处理了镜像下载。通过访问web UI中的Images页面来验证这一点。

Check MAAS health
Confirm the health of the MAAS system by visiting the Controllers page in the web UI. Select the controller name and ensure that the resulting page shows a green checkmark alongside items ‘regiond’ through ‘dhcpd’.
检查MAAS运行状况
通过访问web UI中的Controllers页面来确认MAAS系统的运行状况。选择控制器名称,并确保结果页面在通过dhcpd注册的项旁边显示绿色复选标记。

Add nodes
Add the five nodes to the MAAS cluster by “netbooting” them (PXE boot). MAAS will proceed to enlist them. Once the process is complete the nodes will be listed on the Machines page with a status of ‘New’.
新增节点
通过网络引导(PXE引导)将5个节点添加到MAAS集群中。MAAS会继续招募他们。流程完成后,这些节点将以New状态在Machines页面上列出。

Allowing a node to show up in the web UI before booting another one will make it clear which hardware node maps to which MAAS node. Tracking by MAC address will eliminate this concern.
在启动另一个节点之前,允许一个节点在web UI中显示,这样可以清楚地说明哪个硬件节点映射到哪个MAAS节点。通过MAC地址跟踪将消除这种担忧。

Important
重要

A MAAS node should always remain configured to netboot. MAAS will manage the booting of its cluster members.
MAAS节点应该始终配置为netboot。MAAS将管理其集群成员的启动。

Configure node power type
MAAS must have the ability to power cycle each of its nodes. See BMC power types in the MAAS documentation for how to configure your nodes’ power type.
配置节点功率类型
MAAS必须能够远程开关每个节点的电源。有关如何配置节点的电源类型,请参阅MAAS文档中的BMC电源类型

Commission nodes
委托节点
Commission the five nodes by selecting them on the Machines page, using the green Take action button, and choosing ‘Commission’. Successfully commissioned nodes gain a status of ‘Ready’. This will take a few minutes.
通过在机器页面上选择五个节点,使用绿色的“Take action”按钮,并选择“Commission”,来委托它们。成功委托的节点获得Ready状态。这将需要几分钟。

For the full list of node statuses and node actions, see Concepts and terms in the MAAS documentation.
有关节点状态和节点操作的完整列表,请参阅MAAS文档中的概念和术语

Rename nodes
重命名节点
Rename the newly commissioned nodes to something more appealing or meaningful.
将新委托节点重命名为更吸引人或更有意义的名字。

To change the name of a node, select it from the Machines page and use the name field in the top-left. Here we’ve used ‘os-compute01’ through ‘os-compute04’ for the four cloud nodes and ‘os-juju01’ for the Juju controller node.
改变节点的名称,选择它从页面的机器和使用在左上的name字段。在这里,我们使用os-compute01到os-compute04作为四个云节点,使用os-juju01作为Juju控制器节点。

Note

All nodes will automatically be suffixed with the string ‘.maas’.
所有节点将自动以字符串.maas作为后缀。

注意:各节点必须是ready状态,否则后续的安装juju节点和执行配置openstack命令时,maas无法操作节点。切勿使用maas来acquire或者deploy各节点。如果希望各节点使用静态ip地址,可以先acquire节点后,分配静态ip,再deploy节点,然后release,静态ip会固定在相应节点上。

Tag nodes
标签节点
MAAS tags will be used to help organise and manage the five nodes.
MAAS标签将被用来帮助组织和管理这五个节点。

Tags are added on the Configuration tab of the same individual node page used to rename a node. Add tag ‘compute’ to the four cloud nodes and tag ‘juju’ to the Juju controller node.
在用于重命名节点的同一节点页面的Configuration选项卡上添加标记。将tag compute添加到四个云节点,并将tag juju添加到juju控制器节点。

See MAAS tags in the MAAS documentation for a full understanding of tags.
请参阅MAAS文档中的MAAS标签以获得对标签的完整理解。

Node summary
Here’s a summary of the five MAAS nodes:
以下是五个MAAS节点的概要

节点名标签CPU数网卡数内存数硬盘数硬盘大小
os-compute01.maascompute228380
os-compute02.maascompute228380
os-compute03.maascompute228380
os-compute04.maascompute228380
os-juju01.maasjuju214180

The next step is to create a Juju controller. This will involve deploying Ubuntu and Juju software onto the designated node.
下一步是创建一个Juju控制器。这将包括在指定节点上部署Ubuntu和Juju软件。

Install Juju
安装juju

Overview
概述
In the previous section, we set up the base environment in the form of a MAAS cluster. We are now going to implement Juju as a management solution for that environment. The main goal will be the creation of a Juju controller, the administrative node for a Juju-managed cloud.
在上一节中,我们以MAAS集群的形式设置了基础环境。 现在,我们将Juju作为该环境的管理解决方案来实施。 主要目标是创建Juju控制器,这是Juju管理的云的管理节点。

Install Juju
安装juju(在maas服务器上使用相应的用户操作)
To install Juju:
去安装juju:

sudo snap install juju --classic

Add MAAS to Juju
加MASAS到Juju
Add the MAAS cluster so Juju will be able to manage it as a cloud. We’ll do this via a cloud definition file, such as maas-cloud.yaml:
添加MAAS群集,以便Juju能够将其作为云进行管理。 我们将通过云定义文件(例如maas-cloud.yaml)进行此操作:

vim maas-cloud.yaml

clouds:
  mymaas:
    type: maas
    auth-types: [oauth1]
    endpoint: http://10.0.0.3:5240/MAAS

We’ve called the cloud ‘mymaas’ and its endpoint is based on the IP address of the MAAS system.
我们称云为“ mymaas”,其端点基于MAAS系统的IP地址。

The cloud is added in this way:
使用下列方法增加云:

juju add-cloud --client -f maas-cloud.yaml mymaas

View the updated list of clouds known to the current Juju client with the juju clouds --client command.
使用juju cloud --client`命令查看当前Juju客户端已知的更新的云列表。

# juju clouds --client
Only clouds with registered credentials are shown.
There are more clouds, use --all to see them.
You can bootstrap a new controller using one of these clouds...

Clouds available on the client:
Cloud      Regions  Default    Type  Credentials  Source    Description
localhost  1        localhost  lxd   0            built-in  LXD Container Hypervisor
mymaas     1        default    maas  1            local     Metal As A Service

Add the MAAS credentials
添加MAAS凭证
Add the MAAS credentials so Juju can interact with the newly added cloud. We’ll again use a file to import our information, such as maas-creds.yaml:

添加MAAS凭据,以便Juju可以与新添加的云进行交互。 我们将再次使用文件来导入我们的信息,例如maas-creds.yaml:

vim maas-creds.yaml
credentials:
  mymaas:
    anyuser:
      auth-type: oauth1
      maas-oauth: LGJ8svffZZ5kSdeA8E:9kVM7jJpHGG6J9apk3:KE65tLnjpPuqVHZ6vb97T8VWfVB9tM3j

We’ve included the name of the cloud ‘mymaas’ and a new user ‘anyuser’. The long key is the MAAS API key for the MAAS ‘admin’ user. This key was placed in file ~/admin-api-key on the MAAS system during the Install MAAS step on the previous page. It can also be obtained from the ‘admin’ user’s profile in the web UI.
我们添加了云“ mymaas”的名称和新用户“ anyuser”的名称。 长键是MAAS“管理员”用户的MAAS API密钥。 在上一页的“安装MAAS”步骤期间,将此密钥放置在MAAS系统上的〜/ admin-api-key文件中。 也可以从网络用户界面中的“管理员”用户个人资料中获取。

The credentials are added in this way:
凭证以这种方式添加

juju add-credential --client -f maas-creds.yaml mymaas

View the updated list of credentials known to the current Juju client with the juju credentials --client --show-secrets --format yaml command.
使用juju credentials --client --show-secrets --format yaml命令查看当前Juju客户端更新后的凭据列表

# juju credentials --client --show-secrets --format yaml
client-credentials:
  mymaas:
    anyuser:
      auth-type: oauth1
      maas-oauth: LGJ8svffZZ5kSdeA8E:9kVM7jJpHGG6J9apk3:KE65tLnjpPuqVHZ6vb97T8VWfVB9tM3j

Create the Juju controller
创建Juju控制器
We can now create the controller for the ‘mymaas’ cloud, and have called it ‘maas-controller’:
现在,我们可以为“ mymaas”云创建控制器,并将其称为“ maas-controller”:

juju bootstrap --constraints tags=juju mymaas maas-controller

注意:为了观察问题产生原因,可以在命令结尾增加–debug,以记录执行详情。

The --constraints option allows us to effectively select a node in the MAAS cluster. Recall that we attached a tag of ‘juju’ to the lower-resourced MAAS node during the Tag nodes step on the previous page.
–constraints选项使我们能够有效地选择MAAS集群中的一个节点。 回想一下,在上一页的“标记节点”步骤中,我们在资源较少的MAAS节点上附加了“ juju”标记。
The MAAS web UI will show the node being deployed. The whole process will take about five minutes.
MAAS Web UI将显示正在部署的节点。 整个过程大约需要五分钟。(由于网络原因,国内部署大概需要1小时左右)

View the updated list of controllers known to the current Juju client with the juju controllers command.
使用’ Juju controllers '命令查看当前Juju客户端已知的已更新的控制器列表。

# juju controllers
Use --refresh option with this command to see the latest information.

Controller        Model      User   Access     Cloud/Region    Models  Nodes    HA  Version
maas-controller*  openstack  admin  superuser  mymaas/default       3      1  none  2.8.5

Create the model
创建模型
The OpenStack deployment will be placed in its own Juju model for organisational purposes. It will be called ‘openstack’. Create the model, and switch to it, with this one command:
出于组织目的,OpenStack部署将被放在自己的Juju模型中。它将被称为openstack。用这个命令创建模型,并切换到它

juju add-model openstack

The output of the juju status command summarises the Juju aspect of the environment. It should now look very similar to this:
juju status命令的输出概述了环境的Juju方面。 现在看起来应该与此类似:

Model      Controller       Cloud/Region    Version  SLA          Timestamp
openstack  maas-controller  mymaas/default  2.7.0    unsupported  04:28:49Z
Model "admin/openstack" is empty

Next steps
下一步:
The next step is to use Juju to deploy OpenStack. This will involve deploying the OpenStack applications and adding relations between them.
下一步是使用Juju部署OpenStack。这将涉及部署OpenStack应用程序并在它们之间添加关系。

安装Oenstack
在上一节中,我们安装了Juju并创建了一个Juju控制器和模型。现在我们将使用Juju来安装OpenStack本身。有两种方法可供选择:
1 By individual “charm”. This method provides a solid understanding of how Juju works and of how OpenStack is put together. Choose this option if you have never installed OpenStack with Juju.
1 使用个人“charm”。这种方法使您对Juju的工作方式以及OpenStack是如何组合在一起的有了更深入的了解。如果您从未使用Juju安装过OpenStack,请选择此选项。

2 By charm bundle. This method provides an automated means to install OpenStack. Choose this option if you are familiar with how OpenStack is built with Juju.
2 使用charm bundle。这种方法提供了一种自动安装OpenStack的方法。如果您熟悉如何使用Juju构建OpenStack,请选择此选项。
当前页面专门用于方法#1。方法#2参见从bundle部署OpenStack

重要:
不管安装方法如何,一旦部署了云,建议采用以下与charm版本和machine系列相关的管理实践
1 在对云进行任何重大更改(例如迁移到新的charm、升级云服务、升级machine系列)之前,用于管理云的整个charm套件必须升级到最新的稳定charm版本。有关详细信息,请参阅[charm升级](https://docs.openstack.org/project-deploy-guide/charm-deployment-guide/ussuri/app-upgrade-openstack#charm-upgrades)。
2 构成云的Juju机器应该运行相同的系列(例如xenial或bionic,但不能混合使用两者)。有关详细信息,请参阅[系列升级](https://docs.openstack.org/project-deploy-guide/charm-deployment-guide/ussuri/app-series-upgrade)。

尽管这个页面很长,但是只有三个不同的Juju命令将被使用:Juju deploy, Juju add-unit,和Juju add-relation。在继续之前,您可能需要查看一下Juju文档中的这些相关部分
部署应用Deploying applications

部署特定的机器Deploying to specific machines

管理依赖关系Managing relations

此页将展示如何安装最小的非HA OpenStack云。请参阅OpenStack高可用性以获得有关该主题的指导。

Openstack版本
正如指南概述部分所述,OpenStack Train将部署在Ubuntu 18.04 LTS(bionic)云节点上。为了实现这一点,在安装每个OpenStack应用程序期间将使用cloud的云存档包:bionic-train。注意,有些应用程序本身不是OpenStack项目的一部分,因此不适用(例外的是,Ceph应用程序使用这种方法)。不以这种方式使用更近期的OpenStack版本将导致Queens部署(也就是说,Queens在Bionic的Ubuntu包存档中)。

有关云存档包以及在升级OpenStack时如何使用它的详细信息,请参阅OpenStack升级附录中的“执行升级”。

重要提示:选择的OpenStack版本可能会影响安装和配置说明。本指南假设正在部署OpenStack Train。

安装过程
在使用charm的OpenStack安装中,涉及到许多移动的部分。在这个过程的大部分时间里,会有一些组件没有得到满足,这将导致在juju status命令的输出中显示类似错误的消息。不要惊慌。实际上,这是了解不同软件之间相互依赖关系的机会。一旦添加和处理了适当的应用程序和关系,诸如丢失关系Missing relation 和被阻止 blocked的消息就会消失。

窍门:
监视安装进度的一种方便方法是在单独的终端上运行命令watch -n 5 -c juju status -color。

部署OpenStack
假设您准确地按照安装Juju页面上的说明操作,现在应该有一个名为maas-controller的Juju控制器和一个名为openstack的空Juju模型。现在让我们切换到这个环境:

juju switch maas-controller:openstack

在下面的部分中,各种OpenStack组件将被添加到OpenStack模型中。每个应用程序都将从在线charm store安装,并且每个应用程序通常都有通过自己的YAML文件指定的配置选项。

注意:
您不需要等待 Juju 命令完成后才发出进一步的命令。但是,了解一个命令对云的当前状态的影响是非常有益的。

Ceph OSD
Ceph-osd 应用程序使用 ceph-osd charm部署到四个节点。支持 osd 的块设备的名称取决于节点上的硬件。在这里,我们将在每个云节点上使用相同的第二个驱动器:/dev/sdb。文件 ceph-osd.yaml 包含了配置。如果您的设备在节点之间不是完全相同的,那么您将需要单独的文件(或者在命令行上规定它们) :

vim   ceph-osd.yaml
ceph-osd:
  osd-devices: /dev/sdb
  source: cloud:bionic-train

要部署这个应用程序,我们将使用我们在 Install MAAS 章节上提到的每个节点上放置的“ compute”tag。

juju deploy --constraints tags=compute --config ceph-osd.yaml -n 4 ceph-osd

如果来自 ceph-osd 单元(如“检测到非原始设备”)的消息出现在 juju 状态的输出中,则需要使用“ ceph-osd”符号附带的操作 zap-disk 和 add-disk。Zap-disk 操作本质上是破坏性的。仅当您想清除磁盘中供 Ceph 使用的所有数据和签名时才使用它。

注:
由于 ceph-osd 部署在四个节点上,并且在这个环境中只有四个节点可用,因此严格来说不需要使用“ compute”标记。(不过,千万不要把compute拼写成其他单词,我开始就是拼写成了computer而失败了,废了很大劲才发现是多了个r)
这条命令会自动分配节点机器号1,2,3,4

Nova 计算
Nova-compute 应用程序使用 nova-compute charm 部署到一个节点。然后我们将扩展应用程序到另外两台机器上。文件 compute.yaml 包含以下配置:

vim compute.yaml
nova-compute:
  enable-live-migration: true
  enable-resize: true
  migration-auth-type: ssh
  openstack-origin: cloud:bionic-train

由于没有更多的空闲juju机器 Juju machines(MAAS 节点)可用,所以初始节点必须机器machine定位。这意味着我们在节点上放置了多个服务。我们选择了机器1:

juju deploy --to 1 --config compute.yaml nova-compute

现在扩展到机器2和机器3:

juju add-unit --to 2 nova-compute
juju add-unit --to 3 nova-compute

“Nove计算”的charm是设计来支持一个image格式类型的每个应用程序在任何给定的时间。当现有实例使用先前的格式时,更改格式(请参阅 charm 选项 libvirt-image-backend)将需要为每个实例手动进行image转换。见 bug LP # 1826888

Swift存储
swift存储应用程序以swift storage的charm部署到一个节点(计算机0) ,然后扩展到其他三台计算机。文件swift-storage.yaml 包含以下配置:

vim swift-storage.yaml
swift-storage:
  block-device: sdc
  overwrite: "true"
  openstack-origin: cloud:bionic-train

此配置指向块设备/dev/sdc。根据可用的硬件进行调整。在生产环境中,避免使用looback设备。
以下是这四台机器的四个部署命令:

juju deploy --to 0 --config swift-storage.yaml swift-storage
juju add-unit --to 1 swift-storage
juju add-unit --to 2 swift-storage
juju add-unit --to 3 swift-storage

Neutron网络
Neutron网络有三种应用:

  1. neutron-gateway
  2. neutron-api
  3. neutron-openvswitch

文件 neutron.yaml 包含其中两个的配置:

vim neutron.yaml 
neutron-gateway:
  data-port: br-ex:eth1
  bridge-mappings: physnet1:br-ex
  openstack-origin: cloud:bionic-train
neutron-api:
  neutron-security-groups: true
  flat-network-providers: physnet1
  openstack-origin: cloud:bionic-train
注意:
neutron-openvswitch charm不支持选项 openstack-origin,因为它是nova 计算charm的附属charm,而nova 计算charm支持它。

data-port 设置指的是neutron-gateway将绑定到的网络接口。在上面的例子中,它是‘ eth1’ ,它应该是一个未使用的接口。在 MAAS 中,这个接口必须具有“未配置”的 IP 模式(见 MAAS 文档中的后委托配置)。以这种方式设置所有四个节点,以确保任何节点都能够容纳neutron-gateway。
flat-network-providers设置允许本示例场景中使用的neutron flat-network-providers,并给它命名为“ physnet1”。当我们在下一页设置公共网络时,将引用flat-network-providers及其名称。
bridge-mapping设置将数据端口接口映射到flat-network-providers程序。
neutron-gateway程序将直接部署在机器0上:

juju deploy --to 0 --config neutron.yaml neutron-gateway

neutron-api应用程序将作为一个容器部署在机器1上:

juju deploy --to lxd:1 --config neutron.yaml neutron-api

neutron-openvswitch程序将通过一个附属charm(一旦增加了它的关系,它将被安装在机器上)部署:

juju deploy neutron-openvswitch

需要增加三个关系:

juju add-relation neutron-api:neutron-plugin-api neutron-gateway:neutron-plugin-api
juju add-relation neutron-api:neutron-plugin-api neutron-openvswitch:neutron-plugin-api
juju add-relation neutron-openvswitch:neutron-plugin nova-compute:neutron-plugin
`

注意:``
Co-locating units of neutron-openvswitch and neutron-gateway will cause APT package incompatibility between the two charms on the underlying host. The result is that packages for these services will be removed: neutron-metadata-agent, neutron-dhcp-agent, and neutron-l3-agent.
neutron-openvswitch和neutron-gateway的共管(Co-locating)单元会导致下位主机上两个charm之间的 APT 包不兼容。结果是,这些服务的包将被移除: neutron-metadata-agent, neutron-dhcp-agent, 和 neutron-l3-agent。

The alternative is to run the neutron-gateway unit on a LXD container or on a different host entirely. Another option is to run neutron-openvswitch in DVR mode.

另一种方法是在 LXD 容器或完全不同的主机上运行neutron-gateway单元。另一个选择是在 DVR 模式下运行neutron-openvswitch。

Recall that neutron-openvswitch is a subordinate charm; its host is determined via a relation between it and a principle charm (e.g. nova-compute).

回想一下,neutron-openvswitch是一个从属charm; 它的主机是通过它与主charm之间的关系来决定的(例如, nova-compute)。

Percona cluster Percona集群
Percona XtraDB 集群是 OpenStack 数据库的首选。Percona-cluster 应用程序作为单个 LXD 容器部署在机器0上,使用 percona-cluster charm。文件 mysql.yaml 包含以下配置:

vim mysql.yaml
mysql:
  max-connections: 20000

在部署 Percona 的同时给它一个名为 mysql 的应用程序:

juju deploy --to lxd:0 --config mysql.yaml percona-cluster mysql

只需要一个关系:

juju add-relation neutron-api:shared-db mysql:shared-db

Keystone
keystone应用程序被部署为机器3上的单个LXD容器。文件keystone.yaml包含配置

vim keystone.yaml
keystone:
  openstack-origin: cloud:bionic-train

部署:

juju deploy --to lxd:3 --config keystone.yaml keystone

然后加上这两个关系:

juju add-relation keystone:shared-db mysql:shared-db
juju add-relation keystone:identity-service neutron-api:identity-service

RabbitMQ
Rabbitmq-server 应用程序以 rabbitmq-server 的charm作为单个 LXD 容器部署在机器0上。不需要额外的配置。部署:

juju deploy --to lxd:0 rabbitmq-server

我们需要四种关系:

juju add-relation rabbitmq-server:amqp neutron-api:amqp
juju add-relation rabbitmq-server:amqp neutron-openvswitch:amqp
juju add-relation rabbitmq-server:amqp nova-compute:amqp
juju add-relation rabbitmq-server:amqp neutron-gateway:amqp

Nova cloud controller Nova 云控制器
Nova-cloud-controller 应用程序,包括 nova-scheduler、 nova-api 和 nova-conductor 服务,使用 nova-cloud-controller charm 作为单个 LXD 容器部署在计算机2上。文件 controller.yaml 包含以下配置:

vim controller.yaml
nova-cloud-controller:
  network-manager: Neutron
  openstack-origin: cloud:bionic-train

部署:

juju deploy --to lxd:2 --config controller.yaml nova-cloud-controller

需要为以下六种情况增加关系:

juju add-relation nova-cloud-controller:shared-db mysql:shared-db
juju add-relation nova-cloud-controller:identity-service keystone:identity-service
juju add-relation nova-cloud-controller:amqp rabbitmq-server:amqp
juju add-relation nova-cloud-controller:quantum-network-service neutron-gateway:quantum-network-service
juju add-relation nova-cloud-controller:neutron-api neutron-api:neutron-api
juju add-relation nova-cloud-controller:cloud-compute nova-compute:cloud-compute

Placement
placement程序是使用placement charm作为一个单一的 LXD 容器部署在机器2。文件placement.yaml 包含以下配置:

vim  placement.yaml
placement:
  openstack-origin: cloud:bionic-train

部署:

juju deploy --to lxd:2 --config placement.yaml placement

有三种程序需要增加关系:

juju add-relation placement:shared-db mysql:shared-db
juju add-relation placement:identity-service keystone:identity-service
juju add-relation placement:placement nova-cloud-controller:placement

OpenStack dashboard
Openstack-dashboard 应用程序(Horizon)使用openstack-dashboard charm作为单个 LXD 容器部署在机器3上。文件 dashboard.yaml 包含以下配置:

vim dashboard.yaml
openstack-dashboard:
  openstack-origin: cloud:bionic-train

部署:

juju deploy --to lxd:3 --config dashboard.yaml openstack-dashboard

只需要一个关系:

juju add-relation openstack-dashboard:identity-service keystone:identity-service

Glance
glance的应用程序使用glance charm作为一个单一的容器部署在机器2。文件 glance.yaml 包含以下配置:

vim glance.yaml
glance:
  openstack-origin: cloud:bionic-train

部署:

juju deploy --to lxd:2 --config glance.yaml glance

我们需要五种关系:

juju add-relation glance:image-service nova-cloud-controller:image-service
juju add-relation glance:image-service nova-compute:image-service
juju add-relation glance:shared-db mysql:shared-db
juju add-relation glance:identity-service keystone:identity-service
juju add-relation glance:amqp rabbitmq-server:amqp

Ceph monitor
eph-mon 应用程序使用 ceph-mon charm部署在的计算机1、2和3上的容器上。文件 ceph-mon.yaml 包含以下配置:

vim ceph-mon.yaml
ceph-mon:
  source: cloud:bionic-train

部署:

juju deploy --to lxd:1 --config ceph-mon.yaml ceph-mon
juju add-unit --to lxd:2 ceph-mon
juju add-unit --to lxd:3 ceph-mon

我们需要三种关系:

juju add-relation ceph-mon:osd ceph-osd:mon
juju add-relation ceph-mon:client nova-compute:ceph
juju add-relation ceph-mon:client glance:ceph

最后一个关系使 Ceph 成为 Glance 的后端。

Cinder
cinder应用程序以cinder charm部署到1号机器上的一个容器中:

vim cinder.yaml
cinder:
  glance-api-version: 2
  block-device: None
  openstack-origin: cloud:bionic-train

部署:

juju deploy --to lxd:1 --config cinder.yaml cinder

有五种情况需要增加关系:

juju add-relation cinder:cinder-volume-service nova-cloud-controller:cinder-volume-service
juju add-relation cinder:shared-db mysql:shared-db
juju add-relation cinder:identity-service keystone:identity-service
juju add-relation cinder:amqp rabbitmq-server:amqp
juju add-relation cinder:image-service glance:image-service

此外,像glance一样,cinder将使用 Ceph 作为其后端。这将通过cinder从属charm来实现:

juju deploy cinder-ceph

cinder和 Ceph 都需要一个关系:
注意:原文中缺少第三条关系,根据OpenStack Charms Deployment Guide版本0.0.1dev221内容增加第三条关系。

juju add-relation cinder-ceph:storage-backend cinder:storage-backend
juju add-relation cinder-ceph:ceph ceph-mon:client
juju add-relation cinder-ceph:ceph-access nova-compute:ceph-access

Swift proxy
Swift-proxy 应用程序以 swift-proxy charm 部署到0计算机上的一个容器中:

vim swift-proxy.yaml
swift-proxy:
  zone-assignment: auto
  swift-hash: "<uuid>"

Swift proxy 需要提供一个唯一标识符/代理(UUID)。使用 uuid -v 4命令生成 一个(可能需要首先安装 uuid deb 包)并将其插入文件。

部署:

juju deploy --to lxd:0 --config swift-proxy.yaml swift-proxy

我们需要两种关系:

juju add-relation swift-proxy:swift-storage swift-storage:swift-storage
juju add-relation swift-proxy:identity-service keystone:identity-service

NTP
最后一个组件需要一个 NTP 客户端来保持一切同步,这是通过ntp下属charm来完成的:

juju deploy ntp

这个关系将在四个 ceph-osd 单元的旁边各添加一个 ntp 单元:

juju add-relation ceph-osd:juju-info ntp:juju-info

最终结果和dashboard访问
一旦所有的应用都部署完毕,并且加入了它们之间的关系,我们就需要等待charm状态的输出来解决。最终的结果应该没有任何类似错误的消息。如果您的终端支持颜色,那么您应该只看到绿色(不琥珀色或红色)。这里给出了一个成功的云部署的示例(单色)输出。
在这里插入图片描述
在这里插入图片描述

OpenStack 部署中的一个里程碑是第一次登录 Horizon 仪表板。您将需要其 IP 地址和管理员密码。
以这种方式取得地址:

juju status --format=yaml openstack-dashboard | grep public-address | awk '{print $2}'

密码是从 Keystone 查询的:

juju run --unit keystone/0 leader-get admin_passwd

在这个例子中,地址是‘10.0.0.14’ ,密码是‘ kohy6shoh3diWav5’。
然后,仪表板的 URL 变成:

http://10.0.0.14/horizon
这些证书是:
Domain: 领域:admin_domain 域名
User Name: 用户名称:admin 管理员
Password: 密码:kohy6shoh3diWav5 6shoh3diwav5
一旦登录,你应该会看到这样的东西:
在这里插入图片描述

Horizon dashboard

注:建议参看OpenStack Charms 部署指南0.0.1.dev222,并在一步一步部署熟悉架构后,按Install OpenStack from a bundle部署openstack,如根据本文部署完毕时,使用cinder service-list查看cinder状时,可能会出现类似如下状态:

±-----------------±------------------------±-----±--------±------±---------------------------±--------±----------------±--------------+
| Binary | Host | Zone | Status | State | Updated_at | Cluster | Disabled Reason | Backend State |
±-----------------±------------------------±-----±--------±------±---------------------------±--------±----------------±--------------+
| cinder-scheduler | cinder                  | nova | enabled | up   | 2020-10-16T03:09:53.000000 | - | - | |
| cinder-scheduler | juju-b38b07-1-lxd-2     | nova | enabled | down | 2020-10-14T08:31:18.000000 | - | - | |
| cinder-volume    | cinder@cinder-ceph      | nova | enabled | up   | 2020-10-16T03:09:52.000000 | - | - | up |
| cinder-volume    | juju-b38b07-1-lxd-2@LVM | nova | enabled | down | 2020-10-14T08:32:15.000000 | - | - | - |
±-----------------±------------------------±-----±--------±------±---------------------------±--------±----------------±--------------+
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 14
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值