如何在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