#冲刺创作新星#OLVM使用教程 原创
OLVM简介
简介
Oracle Linux Virtualization Manager是一个服务器虚拟化管理平台,可以轻松地部署以配置,监视和管理具有企业级性能和Oracle支持的基于Oracle Linux内核的虚拟机(KVM)环境。
Oracle Linux 7安装
以下将在Cloudlab上进行安装
新增虚拟机
输入名称等信息,并选择映像文件
配置CPU:2 core,Mem:8GB,Storage:50GB
系统安装
开机后,选择“Install Oracle Linux 7.9”,Enter进行安装
语言选择,默认:US English,单击Next
时区选择“Asis/Hong Kong”,最小化安装
配置网络信息
设置Host name
设置root密码
安装完成,单击Reboot
OLVM安装
配置yum仓库
Enable the ol7_latest yum repository
yum-config-manager --enable ol7_latest
Install the Oracle Linux Virtualization Manager Release 4.3.6 package
yum install oracle-ovirt-release-el7
Verify that the required repositories are enabled
yum clean all
yum repolist all | grep enabled
The following repositories must be enabled:
• ol7_latest
• ol7_optional_latest
• ol7_kvm-utils
• ol7_gluster6
• ol7_UEKR5
• ovirt-4.3
• ovirt-4.3-extra
disable the 4.2 repositories using yum
yum-config-manager --disable ovirt-4.2
yum-config-manager --disable ovirt-4.2-extra
Install the Manager
yum install ovirt-engine
Configuring the Engine
当前使用默认配置
engine-setup --accept-defaults
SSO Setup
配置FQDNS
# cat /etc/ovirt-engine/engine.conf.d/99-custom-sso-setup.conf
SSO_ALTERNATE_ENGINE_FQDNS="ol7-olvm ol7-olvm.sample.com"
# systemctl restart ovirt-engine
Logging in
因主机未配置正确FQDN,默认配置使用主机hostname
https://ol7-olvm/ovirt-engine
Username:admin
Password:P@ss0lvm
本机windows添加hosts记录:“172.16.94.29 ol7-olvm”
Reset User Password
SSH to the Oracle Linux Virtualization Manager
# ovirt-aaa-jdbc-tool user password-reset admin
KVM Host安装
参照Oracle Linux 7安装,进行Oracle Linux 7 minimal安装
磁盘分区如下:
配置yum仓库
Enable the ol7_latest yum repository
yum-config-manager --enable ol7_latest
Install the Oracle Linux Virtualization Manager Release 4.3.6 package
yum install oracle-ovirt-release-el7
Verify that the required repositories are enabled
yum clean all
yum repolist all | grep enabled
The following repositories must be enabled:
• ol7_latest
• ol7_optional_latest
• ol7_kvm-utils
• ol7_gluster6
• ol7_UEKR5
• ovirt-4.3
• ovirt-4.3-extra
disable the 4.2 repositories using yum
yum-config-manager --disable ovirt-4.2
yum-config-manager --disable ovirt-4.2-extra
(Optional) Open the Cockpit port
firewall-cmd --zone=public --add-port=9090/tcp
OLVM配置
添加KVM Host
输入相关信息进行添加
添加完成,InstallFailed,查看日志提示主机不支持虚拟化
解决方案:
开启ol7-kvm01 CPU虚拟化
安装完成,状态为“Up”
Power Management配置
iDRAC配置
启用LAN上的IPMI
新建Read only角色用户
Username:fence_ovirt
Password:OviP@ss
LAN权限级别为:管理员
Fence agent配置
Kdump integration配置
KVM Host修改/etc/kdump.conf配置,增加以下两行
fence_kdump_nodes ol7-olvm.sample.com
fence_kdump_args -p 7410 -i 5
Restart kdump service
# systemctl restart kdump
Storage Domains
创建iSCSI卷
在openfiler服务器中创建,详看openfiler文档
添加Storage Domains
输入相关信息,发现Target – login – Add
添加成功,状态为Active
上传ISO文件到Data Domain
在engine主机上,检查ovirt-image-proxy服务状态
systemctl status ovirt-imageio-proxy.service
在engine主机上,将Engine证书作为证书的可信证书
scp /etc/pki/ovirt-engine/ca.pem /etc/pki/ca-trust/source/anchors/ovirt.ca.pem
在KVM主机上,检查ovirt-image-proxy服务状态
systemctl status ovirt-imageio-daemon
登录Administration Portal
选择ISO镜像文件,并填写相关信息,点击“Test Connection”
点击“Ok”,进行上传
Logical Network
创建Virtual Machine Network
点击“Network”-“Networks”-“New”
输入网络名称
分配VM Network给KVM Host
点击“Compute”-“Hosts”,点击KVM Host “ol7-kvm01”
打开“Network Interfaces”,点击“Setup Host Networks”
目前并无多余Interfaces可供分配,需在Cloudlab添加网卡给kvm host
Cloudlab为kvm host添加网卡
将VM Net拉到对应新增的网卡的Logical Networks中
配置完成
创建Virtual Machine
管控独立KVM Host
当遇到使用local disk的kvm host需要加入到olvm时可采用新建存储为local类型的Data Center
Preparing Local Storage for KVM Hosts
mkdir -p /data/images
chown 36:36 /data /data/images
chmod 0755 /data /data/images
Create New Data Center
“Compute”-“Data Centers”-“New”
Configure Cluster
Configure Host
Create New Domain
“Compute”-“Storage”-“Domains” -“New Domain”
Check the status
Upgrade KVM Host
“Compute”-“Hosts”-“Installation”-“Upgrade”
Reboot host after upgrade
Upgrade Completed
Install Guest Agent
https://support.oracle.com/knowledge/Oracle%20Linux%20and%20Virtualization/2560639_1.html
Guest VMs显示需安装guest agent并启动
For Oracle Linux 7 guest VMs
# yum install qemu-guest-agent -y
# systemctl enable --now qemu-guest-agent
For Microsoft Windows VMs
Upload the ovirt-tools-setup.iso to a storage domain in the olvmadm
# yum install ovirt-guest-tools-iso -y
# ovirt-iso-uploader upload -i ISO /usr/share/ovirt-guest-tools-iso/ovirt-tools-setup.iso
“Compute”-“Virtual Machines”-“Change CD”
Select ovirt-tools-setup.iso
Install ovirt-guest-tools-setup.exe
Install Oracle Windows VirtIO Drivers
将winvirtio.iso上传到Storage Domains
参照guest agent安装进行。
Backup OLVM Engine
Create a script called /root/tools/scripts/backup_housekeep.sh with the following below contents
#!/bin/bash
engine-backup --scope=all --mode=backup
find /var/lib/ovirt-engine-backup -mtime +30 -user root -exec rm {} \;
find /var/log/ovirt-engine-backup -mtime +30 -user root -exec rm {} \;
Make /root/tools/scripts/backup_housekeep.sh executable
# chmod +x /root/tools/scripts/backup_housekeep.sh
Edit crontab file
# crontab -e
Add the below contents
0 0 * * * /root/tools/scripts/backup_housekeep.sh >/dev/null 2>&1
The daily backups will be automatically taken at 12:00 am every day at /var/lib/ovirt-engine-backup/
Regenerate All Certificates in OLVM
put the environment into global maintenance mode.
# hosted-engine --set-maintenance --mode=global
Manager:
# engine-backup --mode=backup --scope=all --file="/var/lib/ovirt-engine/backups/engine-backup-$(date +%Y%m%d%H%M%S).tar.bz2" --log=/var/log/ovirt-engine-backups.log
# tar cJpf /root/pki.tar.xz /etc/pki
KVM Host:
# tar cJpf /root/pki.tar.xz /etc/pki
Stop all guest VMs and put KVM hosts into maintenance mode.
Create new CA with following command :
# /usr/share/ovirt-engine/bin/pki-create-ca.sh --subject="/C=US/O=<example.org>/CN=<CN_name>" --keystore-password=mypass
Make sure you have latest Setup packages i.e ovirt-engine-setup ovirt-engine-setup-plugin-websocket-proxy
# yum update ovirt-engine-setup ovirt-engine-setup-plugin-websocket-proxy
Run engine-setup, this will recreate all the remaining certs of the manager.
# engine-setup
Restart services
# systemctl restart httpd ovirt-engine ovirt-engine-dwhd ovirt-websocket-proxy ovirt-imageio-proxy
In OLVM GUI, Enroll certificate for KVM host.
Compute -> Hosts -> Select the host -> Installation -> Enroll Certificate