如何在OpenStack和KVM上安装ManageIQ / CloudForms

今天的指南将重点介绍如何在OpenStack和KVM虚拟化环境中安装ManageIQ / CloudForms。 ManageIQ是Red Hat CloudForms的上游项目。它是一个基础架构管理平台,旨在帮助IT部门控制用户自助服务功能,以在整个虚拟化和私有云环境中配置,管理和确保合规性。

本指南适用于具有小型虚拟化基础架构的简单设置。您可能需要查阅HA设置的官方文档,这些文档可以随着基础架构的增长而扩展。该配置将安装主数据库虚拟管理(VMDB)实例,该实例还可以用作CloudForms Appliance。

ManageIQ / CloudForms Appliance是在基于Red Hat Enterprise Linux的操作系统上运行的虚拟机映像。以下是设置步骤。

步骤1:下载CloudForms / ManageIQ Appliance

首先,为您的环境下载CloudForms / ManageIQ设备作为虚拟机映像模板。

红帽CloudForms

如果您使用Red Hat CloudForms Management Engine设备,请通过以下方式获取设备:

  1. 进入access.redhat.com并使用您的客户帐户详细信息登录到Red Hat客户门户。
  2. 请点击 资料下载 在菜单栏中。
  3. 请点击 AZ 按字母顺序对产品下载进行排序。
  4. 请点击 红帽CloudForms 访问产品下载页面。
  5. 从安装程序和映像列表中,单击 立即下载 友情链接 CFME OpenStack虚拟设备

请参见下面的屏幕截图。

如何在OpenStack和KVM上安装ManageIQ / CloudForms

ManageIQ

转到ManageIQ下载页面以获取适用于OpenStack / KVM环境的最新映像模板。

curl -O -L http://releases.manageiq.org/manageiq-openstack-hammer-11.qc2

检查文件格式:

# ManageIQ
$ file manageiq-openstack-hammer-11.qc2 
manageiq-openstack-hammer-11.qc2: QEMU QCOW Image (v2), 70866960384 bytes
$  du -sh manageiq-openstack-hammer-11.qc2 
2.1G    manageiq-openstack-hammer-11.qc2

# RedHat CloudForms
$ file ~/Downloads/cfme-rhevm-5.10.8.0-1.x86_64.qcow2
/home/jmutai/Downloads/cfme-rhevm-5.10.8.0-1.x86_64.qcow2: QEMU QCOW2 Image (v2), 42949672960 bytes
$ du -sh ~/Downloads/cfme-rhevm-5.10.8.0-1.x86_64.qcow2
1.2G /home/jmutai/Downloads/cfme-rhevm-5.10.8.0-1.x86_64.qcow2

步骤2:将ManageIQ / CloudForms设备上传到OpenStack

将ManageIQ / CloudForms管理引擎上传到OpenStack。

# ManageIQ 
openstack image create --container-format=bare 
   --disk-format qcow2 
   --file manageiq-openstack-hammer-11.qc2 
   manageiq


# CloudForms
openstack image create --container-format=bare 
   --disk-format qcow2 
   --file cfme-rhevm-5.10.8.0-1.x86_64.qcow2 
   cloudforms

获取Glance中可用的VM映像的更新列表。

$ openstack image list
+--------------------------------------+-----------+--------+
| ID                                   | Name      | Status |
+--------------------------------------+-----------+--------+
| b8d75f31-fb6b-428b-8b83-f3904b0bd114 | CentOS-7  | active |
| fbcf16a0-c7cc-42c1-b836-a39bc34c9666 | Cirros    | active |
| d900bcad-047a-4d01-bcbc-42426bb4315d | CoreOS    | active |
| f0ac705b-ee73-4de8-95f7-4e06569f0f5c | Debian-10 | active |
| 01e6f07b-ca99-439d-9cd0-ab28c2573abf | Fedora-30 | active |
| 7bd462ad-cc11-4d89-8b85-9aab0cfe114b | Ubuntu-18 | active |
| 3a56d733-de76-490a-9dac-1419219b5803 | manageiq  | active |
| 6b3dc49b-a53f-4cfc-98e0-9eb6925219de | rhel-7    | active |
| 965cb833-b97e-4488-9bc6-84495b9a9b7b | rhel-8    | active |
+--------------------------------------+-----------+--------+

步骤3:为CloudForms / ManageIQ VMDB创建Cinder卷

对于数据库实例,需要一个辅助原始磁盘来存储数据库数据。使用下表作为准则来计算数据库的最低要求。

如何在OpenStack和KVM上安装ManageIQ / CloudForms

为数据库设备添加10GB辅助磁盘。

$ openstack volume  create --size 10 manageiq-vmdb
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| attachments         | []                                   |
| availability_zone   | nova                                 |
| bootable            | false                                |
| consistencygroup_id | None                                 |
| created_at          | 2019-09-10T12:54:29.000000           |
| description         | None                                 |
| encrypted           | False                                |
| id                  | 000c39d8-127a-4d9a-b9ef-db2d78a74e06 |
| migration_status    | None                                 |
| multiattach         | False                                |
| name                | manageiq-vmdb                        |
| properties          |                                      |
| replication_status  | None                                 |
| size                | 10                                   |
| snapshot_id         | None                                 |
| source_volid        | None                                 |
| status              | creating                             |
| type                | None                                 |
| updated_at          | None                                 |
| user_id             | 336acbb7421f47f8be4891eabf0c9cc8     |
+---------------------+--------------------------------------+

$ openstack volume  list
+--------------------------------------+---------------------+----------------+------+--------------------------------------------+
| ID                                   | Name                | Status         | Size | Attached to                                |
+--------------------------------------+---------------------+----------------+------+--------------------------------------------+
| 000c39d8-127a-4d9a-b9ef-db2d78a74e06 | manageiq-vmdb       | available      |   10 |                                            |
+--------------------------------------+---------------------+----------------+------+--------------------------------------------+

步骤4:创建VMDB和辅助VM

从下载的OpenStack或KVM模板创建VM。我的VM创建是使用OpenStack命令管理工具在OpenStack环境中完成的。

首先,创建一种可与CloudForms结合使用的风格– 8GB RAM, 4vcps 80GB 磁盘空间。味道的名字是 m1.cfme

$ openstack flavor create  --ram 8192  --vcpus  4   --disk 80    m1.cfme
+----------------------------+---------+
| Field                      | Value   |
+----------------------------+---------+
| OS-FLV-DISABLED:disabled   | False   |
| OS-FLV-EXT-DATA:ephemeral  | 0       |
| disk                       | 80      |
| id                         | 5       |
| name                       | m1.cfme |
| os-flavor-access:is_public | True    |
| properties                 |         |
| ram                        | 8192    |
| rxtx_factor                | 1.0     |
| swap                       |         |
| vcpus                      | 4       |
+----------------------------+---------+

从添加的模板和风格创建虚拟机。

IMAGE="manageiq"
FLAVOR="m1.cfme"
SG_ID="7fffea2a-b756-473a-a13a-219dd0f1913a"
NETWORK="private"
SSH_KEY="jmutai"

openstack server create 
  --image ${IMAGE} 
  --flavor ${FLAVOR} 
  --security-group ${SG_ID} 
  --key-name ${SSH_KEY} 
  --network ${NETWORK} 
  manageiq

也可以在OpenStack Horizo​​n仪表板上执行创建VM。

项目>计算>实例>启动实例

如何在OpenStack和KVM上安装ManageIQ / CloudForms

执行以下命令,确认创建虚拟机。

$ openstack server list
+--------------------------------------+-------------------+---------+-----------------------------------+-----------+-----------+
| ID                                   | Name              | Status  | Networks                          | Image     | Flavor    |
+--------------------------------------+-------------------+---------+-----------------------------------+-----------+-----------+
| 2d492aea-b830-413f-bb9a-ded0a3f787df | manageiq          | ACTIVE  | private=10.10.1.109               | manageiq  | m1.cfme   |
+--------------------------------------+-------------------+---------+-----------------------------------+-----------+-----------+

将Cinder卷附加到实例。

$ openstack volume list
$ openstack server list
$ openstack server add volume manageiq manageiq-vmdb

$ openstack volume list
+--------------------------------------+---------------------+----------------+------+--------------------------------------------+
| ID                                   | Name                | Status         | Size | Attached to                                |
+--------------------------------------+---------------------+----------------+------+--------------------------------------------+
| 3809ef59-1f7b-471b-90dc-d93be3e90c03 | manageiq-vmdb       | in-use         |   10 | Attached to manageiq on /dev/vdb           |
+--------------------------------------+---------------------+----------------+------+--------------------------------------------+

步骤5:配置ManageIQ / CloudForms

通过ssh访问创建的实例。如果您未使用SSH密钥,则默认登录名是 路线/smartvm

$ ssh [email protected]
Warning: Permanently added '10.10.1.88' (ECDSA) to the list of known hosts.
Enter passphrase for key '/home/centos/.ssh/id_rsa': 
Welcome to the Appliance Console

For a menu, please type: appliance_console

确保您有原始块设备。

# lsblk
 NAME                           MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
 vda                            252:0    0   80G  0 disk 
 ├─vda1                         252:1    0    1G  0 part /boot
 ├─vda2                         252:2    0   42G  0 part 
 │ ├─vg_system-lv_os            253:0    0 10.5G  0 lvm  /
 │ ├─vg_system-lv_swap          253:1    0    6G  0 lvm  [SWAP]
 │ ├─vg_system-lv_home          253:3    0    1G  0 lvm  /home
 │ ├─vg_system-lv_tmp           253:4    0    1G  0 lvm  /tmp
 │ ├─vg_system-lv_var_log_audit 253:5    0  512M  0 lvm  /var/log/audit
 │ ├─vg_system-lv_var_log       253:6    0   11G  0 lvm  /var/log
 │ └─vg_system-lv_var           253:7    0   12G  0 lvm  /var
 ├─vda3                         252:3    0   10G  0 part /var/www/miq_tmp
 ├─vda4                         252:4    0    1K  0 part 
 └─vda5                         252:5    0   13G  0 part 
   └─vg_data-lv_pg              253:2    0   13G  0 lvm  /var/opt/rh/rh-postgresql95/lib/pgsql
 vdb                            252:16   0   10G  0 disk 

配置ManageIQ / CloudForms设备

执行Appliance_console命令以配置CloudForms / ManageIQ。

# appliance_console

1 –设置主机名

Advanced Setting
 1) Configure Network
 2) Set Timezone
 3) Set Date and Time
 4) Create Database Backup
 5) Create Database Dump
 6) Restore Database From Backup
 7) Configure Database
 8) Configure Database Replication
 9) Logfile Configuration
 10) Configure Application Database Failover Monitor
 11) Configure External Authentication (httpd)
 12) Update External Authentication Options
 13) Generate Custom Encryption Key
 14) Stop EVM Server Processes
 15) Start EVM Server Processes
 16) Restart Appliance
 17) Shut Down Appliance
 18) Summary Information
 19) Quit

 Choose the advanced setting: 1
 Network Configuration
 1) Set DHCP Network Configuration
 2) Set IPv4 Static Network Configuration
 3) Set IPv6 Static Network Configuration
 4) Test Network Configuration
 5) Set Hostname
 Choose the network configuration: 5

Hostname Configuration
 Enter the new hostname: |cfme.computingforgeeks.com| cfme.computingforgeeks.com

2-配置本地数据库

移至 配置数据库 > 创建一个内部数据库 > 选择一个数据库磁盘

选择 ñ 在同一节点上运行辅助服务器和数据库。

Should this appliance run as a standalone database server?

NOTE:
* The ManageIQ application will not be running.
* This is required when using highly available database deployments.
* CAUTION: This is not reversible.

? (Y/N): |N| N

输入您的数据库区域代码和数据库密码

Each database region number must be unique.
Enter the database region number: 1
Enter the database password on localhost: ********
Enter the database password again: ********
Create region starting
Create region complete
Database reset successfully
Start the server processes via 'Start EVM Server Processes'.

3 –启动CloudForms服务器进程

Advanced Setting

1) Configure Network
2) Set Timezone
3) Set Date and Time
4) Create Database Backup
5) Create Database Dump
6) Restore Database From Backup
7) Configure Database
8) Configure Database Replication
9) Logfile Configuration
10) Configure Application Database Failover Monitor
11) Configure External Authentication (httpd)
12) Update External Authentication Options
13) Generate Custom Encryption Key
14) Stop EVM Server Processes
15) Start EVM Server Processes
16) Restart Appliance
17) Shut Down Appliance
18) Summary Information
19) Quit

Choose the advanced setting: 15

Start EVM Server Processes
Start ManageIQ? (Y/N): y
Starting ManageIQ Server...

配置的基本设置如下:

Hostname:                cfme.computingforgeeks.com
IPv4 Address:            10.10.1.88/255.255.255.0
IPv4 Gateway:            10.10.1.1
Primary DNS:             213.133.98.98
Secondary DNS:           8.8.8.8
Search Order:            openstacklocal
MAC Address:             fa:16:3e:6b:38:e5
Timezone:                America/New_York
Local Database Server:   running (primary)
ManageIQ Server:         running
ManageIQ Database:       localhost
Database/Region:         vmdb_production / 1
External Auth:           not configured
ManageIQ Version:        hammer-11

步骤6:访问CloudForms / ManageIQ仪表板

访问ManageIQ仪表板可能需要公用网络上的浮动IP地址。有关说明,请参见下面的指南。

如何为OpenStack实例分配浮动IP地址

用于引用CloudForms设备IP或主机名 https

如何在OpenStack和KVM上安装ManageIQ / CloudForms

登入管理员/smartvm”。

如何在OpenStack和KVM上安装ManageIQ / CloudForms

在下面更改管理员用户密码 管理员>配置

如何在OpenStack和KVM上安装ManageIQ / CloudForms

访问控制>用户>管理员>设置>编辑用户 更改保存的密码

如何在OpenStack和KVM上安装ManageIQ / CloudForms

设置新密码。

如何在OpenStack和KVM上安装ManageIQ / CloudForms

步骤7:添加用户和提供商

将用户添加到CloudForms并配置团队访问控制。完成后,请查看有关添加其他提供程序的指南。

自动化详细信息:

学习Docker和Ansible自动化的最佳书

学习OpenStack Cloud Platform的完美书

如何在CentOS 8 / RHEL 8上设置Chef Infra Server

如何导出和导入Docker映像/容器

Sidebar