基于KVM虚拟化的管理工具--oVirt搭建(一)

首先,需要准备两台内核在3.10以上的Linux服务器,这里以CentOS 7.4为例。两台服务器的IP地址和主机名分别为:
node1.test.com—->192.168.10.10—-oVirt管理端
node2.test.com—->192.168.10.11—-KVM虚拟化物理机

1
2
3
4
5
6
7
8
[root@node1 ~]# hostname
node1.test.com
[root@node1 ~]# uname -a
Linux node1.test.com 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@node1 ~]# ifconfig |head -n 3
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.10.10 netmask 255.255.255.0 broadcast 192.168.10.255
inet6 fe80::87e3:3b58:665:5b96 prefixlen 64 scopeid 0x20<link>

服务器配置好后,需要将SELinux、firewalld关闭,并且配置好yum源,建议采用aliyun的yum源。

Ovirt介绍

目前oVirt的最新版本为oVirt 4.1,这里以安装4.1为例


Install oVirt using package manager
oVirt 4.1 is intended for production use and is available for the following platforms:

Fedora 24
Red Hat Enterprise Linux 7.4 or later
CentOS Linux 7.4 or later
Scientific Linux 7.4 or later
Our recommended method of installing oVirt is to use the pre-built packages for Fedora or a supported Enterprise Linux 7 distribution, such as CentOS Linux or Red Hat Enterprise Linux. This makes installing oVirt very easy.

Important: Please note you can not skip a version. If you are updating from e.g. 3.6, you first need to update to 4.0 and then to 4.1. If you’re upgrading from a previous version, please update ovirt-release40 and verify you have the correct repositories enabled by running the following commands before upgrading with the usual procedure.
[root@test ~]yum install http://resources.ovirt.org/pub/yum-repo/ovirt-release41.rpm

You should also read the Release Notes for oVirt 4.1.6.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
[root@node1 ~]# yum install http://resources.ovirt.org/pub/yum-repo/ovirt-release41.rpm
Loaded plugins: fastestmirror, langpacks
ovirt-release41.rpm | 15 kB 00:00:00
Examining /var/tmp/yum-root-DiNHCq/ovirt-release41.rpm: ovirt-release41-4.1.6-1.el7.centos.noarch
Marking /var/tmp/yum-root-DiNHCq/ovirt-release41.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package ovirt-release41.noarch 0:4.1.6-1.el7.centos will be installed
--> Finished Dependency Resolution
base/7/x86_64 | 3.6 kB 00:00:00
base/7/x86_64/group_gz | 156 kB 00:00:00
base/7/x86_64/primary_db | 5.7 MB 00:00:00
centosplus/7/x86_64 | 3.4 kB 00:00:00
centosplus/7/x86_64/primary_db | 1.8 MB 00:00:00
extras/7/x86_64 | 3.4 kB 00:00:00
extras/7/x86_64/primary_db | 129 kB 00:00:00
updates/7/x86_64 | 3.4 kB 00:00:00
updates/7/x86_64/primary_db | 3.6 MB 00:00:00
Dependencies Resolved
============================================================================================================
Package Arch Version Repository Size
============================================================================================================
Installing:
ovirt-release41 noarch 4.1.6-1.el7.centos /ovirt-release41 10 k
Transaction Summary
============================================================================================================
Install 1 Package
Total size: 10 k
Installed size: 10 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : ovirt-release41-4.1.6-1.el7.centos.noarch 1/1
Verifying : ovirt-release41-4.1.6-1.el7.centos.noarch 1/1
Installed:
ovirt-release41.noarch 0:4.1.6-1.el7.centos
Complete!
[root@node1 ~]#

ovirt 4.1安装好之后,需要在node1(oVirt管理端)上安装oVirt-engine,安装oVirt-engine有100多个包需要安装,耗费的时间就会稍微久一点。

1
[root@node1 ~]# yum install ovirt-engine

等ovirt-engine相关的包安装完成之后则,运行engine-setup开始安装配置oVirt

1
[root@node1 ~]# engine-setup

具体的配置如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
[root@node1 ~]# engine-setup
[ INFO ] Stage: Initializing
[ INFO ] Stage: Environment setup
Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging-jboss.conf', '/etc/ovirt-engine-setup.conf.d/10-packaging.conf']
Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20171030000600-sb0rsz.log
Version: otopi-1.6.2 (otopi-1.6.2-1.el7.centos)
[ INFO ] Stage: Environment packages setup
[ INFO ] Yum Downloading: ovirt-4.1/7 (0%)
[ INFO ] Stage: Programs detection
[ INFO ] Stage: Environment setup
[ INFO ] Stage: Environment customization
--== PRODUCT OPTIONS ==--
Configure Engine on this host (Yes, No) [Yes]: yes
Configure Image I/O Proxy on this host? (Yes, No) [Yes]: yes
Configure WebSocket Proxy on this host (Yes, No) [Yes]: yes
Please note: Data Warehouse is required for the engine. If you choose to not configure it on this host, you have to configure it on a remote host, and then configure the engine on this host so that it can access the database of the remote Data Warehouse host.
Configure Data Warehouse on this host (Yes, No) [Yes]: yes
Configure VM Console Proxy on this host (Yes, No) [Yes]: yes
--== PACKAGES ==--
[ INFO ] Checking for product updates...
[ INFO ] No product updates found
--== NETWORK CONFIGURATION ==--
Host fully qualified DNS name of this server [node1.test.com]:
Setup can automatically configure the firewall on this system.
Note: automatic configuration of the firewall may overwrite current settings.
Do you want Setup to configure the firewall? (Yes, No) [Yes]: yes
The following firewall managers were detected on this system: firewalld
Firewall manager to configure (firewalld): firewalld
[ INFO ] firewalld will be configured as firewall manager.
--== DATABASE CONFIGURATION ==--
Where is the DWH database located? (Local, Remote) [Local]:
Setup can configure the local postgresql server automatically for the DWH to run. This may conflict with existing applications.
Would you like Setup to automatically configure postgresql and create DWH database, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
Where is the Engine database located? (Local, Remote) [Local]:
Setup can configure the local postgresql server automatically for the engine to run. This may conflict with existing applications.
Would you like Setup to automatically configure postgresql and create Engine database, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
--== OVIRT ENGINE CONFIGURATION ==--
Engine admin password:
Confirm engine admin password:
[WARNING] Password is weak: it is too short
Use weak password? (Yes, No) [No]: yes
Application mode (Virt, Gluster, Both) [Both]:
--== STORAGE CONFIGURATION ==--
Default SAN wipe after delete (Yes, No) [No]:
--== PKI CONFIGURATION ==--
Organization name for certificate [test.com]:
--== APACHE CONFIGURATION ==--
Setup can configure the default page of the web server to present the application home page. This may conflict with existing applications.
Do you wish to set the application as the default page of the web server? (Yes, No) [Yes]:
Setup can configure apache to use SSL using a certificate issued from the internal CA.
Do you wish Setup to configure that, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
--== SYSTEM CONFIGURATION ==--
Configure an NFS share on this server to be used as an ISO Domain? (Yes, No) [No]:
--== MISC CONFIGURATION ==--
Please choose Data Warehouse sampling scale:
(1) Basic
(2) Full
(1, 2)[1]:
--== END OF CONFIGURATION ==--
[ INFO ] Stage: Setup validation
[WARNING] Cannot validate host name settings, reason: resolved host does not match any of the local addresses
[WARNING] Less than 16384MB of memory is available
--== CONFIGURATION PREVIEW ==--
Application mode : both
Default SAN wipe after delete : False
Firewall manager : firewalld
Update Firewall : True
Host FQDN : node1.test.com
Configure local Engine database : True
Set application as default page : True
Configure Apache SSL : True
Engine database secured connection : False
Engine database user name : engine
Engine database name : engine
Engine database host : localhost
Engine database port : 5432
Engine database host name validation : False
Engine installation : True
PKI organization : test.com
DWH installation : True
DWH database secured connection : False
DWH database host : localhost
DWH database user name : ovirt_engine_history
DWH database name : ovirt_engine_history
DWH database port : 5432
DWH database host name validation : False
Configure local DWH database : True
Configure Image I/O Proxy : True
Configure VMConsole Proxy : True
Configure WebSocket Proxy : True
Please confirm installation settings (OK, Cancel) [OK]:
[ INFO ] Stage: Transaction setup
[ INFO ] Stopping engine service
[ INFO ] Stopping ovirt-fence-kdump-listener service
[ INFO ] Stopping dwh service
[ INFO ] Stopping Image I/O Proxy service
[ INFO ] Stopping vmconsole-proxy service
[ INFO ] Stopping websocket-proxy service
[ INFO ] Stage: Misc configuration
[ INFO ] Stage: Package installation
[ INFO ] Stage: Misc configuration
[ INFO ] Upgrading CA
[ INFO ] Initializing PostgreSQL
[ INFO ] Creating PostgreSQL 'engine' database
[ INFO ] Configuring PostgreSQL
[ INFO ] Creating PostgreSQL 'ovirt_engine_history' database
[ INFO ] Configuring PostgreSQL
[ INFO ] Creating CA
[ INFO ] Creating/refreshing Engine database schema
[ INFO ] Creating/refreshing DWH database schema
[ INFO ] Configuring Image I/O Proxy
[ INFO ] Setting up ovirt-vmconsole proxy helper PKI artifacts
[ INFO ] Setting up ovirt-vmconsole SSH PKI artifacts
[ INFO ] Configuring WebSocket Proxy
[ INFO ] Creating/refreshing Engine 'internal' domain database schema
[ INFO ] Generating post install configuration file '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf'
[ INFO ] Stage: Transaction commit
[ INFO ] Stage: Closing up
[ INFO ] Starting engine service
[ INFO ] Starting dwh service
[ INFO ] Restarting ovirt-vmconsole proxy service
--== SUMMARY ==--
[ INFO ] Restarting httpd
Please use the user 'admin@internal' and password specified in order to login
Web access is enabled at:
http://node1.test.com:80/ovirt-engine
https://node1.test.com:443/ovirt-engine
Internal CA C0:3E:00:3D:58:19:12:59:F2:B2:F8:DE:0A:1F:E7:BD:40:D4:21:38
SSH fingerprint: SHA256:CZZ7FrwMob5cwQJHyMVbQ5EoGujq1oV3cTr9pWRQ8Lw
[WARNING] Less than 16384MB of memory is available
--== END OF SUMMARY ==--
[ INFO ] Stage: Clean up
Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20171030000600-sb0rsz.log
[ INFO ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20171030001057-setup.conf'
[ INFO ] Stage: Pre-termination
[ INFO ] Stage: Termination
[ INFO ] Execution of setup completed successfully
[root@node1 ~]#


至此,oVirt已经安装完成,需要打开浏览器,输入下面的网址打开oVirt的控制台界面,然后输入账号和密码登陆即可。
http://node1.test.com:80/ovirt-engine
https://node1.test.com:443/ovirt-engine

----本文结束感谢您的阅读----
0%