ovirt 前言
oVirt是一个开源分布式虚拟化解决方案,旨在管理您的整个企业基础设施。oVirt使用可信的KVM管理程序,并基于其他几个社区项目构建,包括libvirt、Gluster、PatternFly和Ansible。
Ovirt仅支持系统Centos / Redhat
ovirt download
ovirt | ovirt repo | 文档 |
download | download | 参考 |
Linux 各系统下载使用参考
Red Hat | Rocky Linux | Oracle Linux | AlmaLinux | ubuntu | suselinux | esxi | RHEL标准安装 | 系统安装参考 | YUM参考 | MobaXterm 远程连接工具 | Red Hat Enterprise 9.0 文档 | Kickstart 生成器 | |||||
download | download | download | download | download | download | download | 参考 | 参考 | 配置参考 | download | 参考 | Kickstart | |||||
版本兼容性 |
ovirt 一键自动化部署编写
- 最终实现在线repo 方式安装ovirt,初始化ovirt,ovirt自动化配置文件配置。
- 用户密码 admin/Report@123
- /answer-file.conf 自动化部署配置文件
- /etc/ovirt-engine/engine.conf.d/11-setup-sso.conf ovirt修改portal域名或IP地址
- /var/lib/ovirt-engine/setup/answers/ 默认ovirt 配置文件目录
vi ovirt_install.sh
#!/bin/bash
# -*- coding: utf-8 -*-
# Author: CIASM
# update 2023/06/19
# install ovirt 4.4
# ovirt Only Redhat and Centos are supported
<<!
# ovirt official website
https://www.ovirt.org/
# repo ovirt
https://resources.ovirt.org/pub/yum-repo/
# download ovirt
https://resources.ovirt.org/
# ovirt installation parameter
engine-setup --hlep
# ovirt automates file generation to this directory by default
/var/lib/ovirt-engine/setup/answers/
# ovirt Change the portal domain name or IP address
/etc/ovirt-engine/engine.conf.d/11-setup-sso.conf
# ovirt user password
admin/Report@123
!
ovirt_password=Report@123
ovirt_conf=/answer-file.conf
ovirt_sso_conf=/etc/ovirt-engine/engine.conf.d/11-setup-sso.conf
install_basics() {
# Check if the script is being run as root
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root."
exit 1
fi
# Check the CentOS/Red Hat version
if [[ -f /etc/redhat-release ]]; then
OS=$(cat /etc/*release* | grep "^NAME=" | cut -d'=' -f2- | tr -d '"')
VERSION=$(cat /etc/*release* | grep -oE '[0-9]+\.[0-9]+' | head -n1)
else
echo -e "\033[31m This script only supports $OS $VERSION...\033[0m"
exit 1
fi
# Check the ovirt version
if ! rpm -q ovirt-engine &> /dev/null; then
echo -e "\033[32m ovirt for $OS $VERSION...\033[0m"
case $VERSION in
# CentOS/RedHat 7 install
7.?)
echo "install ovirt"
install_ovirt
;;
# CentOS/RedHat 8 install
8.?)
echo "install ovirt"
install_ovirt
;;
# CentOS/RedHat 9 install
9.?)
echo "install ovirt"
install_ovirt
;;
*)
echo -e "\033[31m Unsupported $OS $VERSION...\033[0m"
exit 1
;;
esac
echo -e "\033[32m ovirt for $OS $VERSION successfully installed...\033[0m"
else
echo -e "\033[33m ovirt for $OS $VERSION already installed...\033[0m"
fi
}
install_ovirt() {
echo "install cockpit"
yum install -y cockpit
systemctl enable --now cockpit.socket
echo "ovirt Online repo added"
yum install -y https://resources.ovirt.org/pub/yum-repo/ovirt-release44.rpm
echo "enable javapackages-tools,pki-deps,postgresql:12,mod_auth_openidc:2.3,nodejs:14"
dnf module -y enable javapackages-tools
dnf module -y enable pki-deps
dnf module -y enable postgresql:12
dnf module -y enable mod_auth_openidc:2.3
dnf module -y enable nodejs:14
echo "install ovirt-engine automation"
yum install -y vim tmux
yum install -y ovirt-engine
echo "Create an ovirt-engine automation script"
cat >>$ovirt_conf<<EOF
# OTOPI answer file, generated by human dialog
[environment:default]
QUESTION/1/DWH_VACUUM_FULL=str:yes
QUESTION/1/ENGINE_VACUUM_FULL=str:yes
QUESTION/1/GRAFANA_USE_ENGINE_ADMIN_PASSWORD=str:yes
QUESTION/1/OVESETUP_APACHE_CONFIG_ROOT_REDIRECTION=str:yes
QUESTION/1/OVESETUP_APACHE_CONFIG_SSL=str:automatic
QUESTION/1/OVESETUP_CONFIG_ADMIN_SETUP=str:${ovirt_password}
QUESTION/1/OVESETUP_CONFIG_APPLICATION_MODE=str:both
QUESTION/1/OVESETUP_CONFIG_SAN_WIPE_AFTER_DELETE=str:no
QUESTION/1/OVESETUP_CONFIG_VMCONSOLE_PROXY=str:yes
QUESTION/1/OVESETUP_CONFIG_WEBSOCKET_PROXY=str:yes
QUESTION/1/OVESETUP_CORE_ENGINE_STOP=str:ok
QUESTION/1/OVESETUP_DIALOG_CONFIRM_SETTINGS=str:ok
QUESTION/1/OVESETUP_DWH_ENABLE=str:yes
QUESTION/1/OVESETUP_DWH_PERFORM_BACKUP=str:yes
QUESTION/1/OVESETUP_DWH_PROVISIONING_POSTGRES_ENABLED=str:automatic
QUESTION/1/OVESETUP_DWH_PROVISIONING_POSTGRES_LOCATION=str:local
QUESTION/1/OVESETUP_DWH_SCALE=str:2
QUESTION/1/OVESETUP_ENGINE_ENABLE=str:yes
QUESTION/1/OVESETUP_GRAFANA_ENABLE=str:yes
QUESTION/1/OVESETUP_NETWORK_FQDN_this=str:localhost.localdomain
QUESTION/1/OVESETUP_PKI_ORG=str:localdomain
QUESTION/1/OVESETUP_PROVISIONING_POSTGRES_ENABLED=str:automatic
QUESTION/1/OVESETUP_PROVISIONING_POSTGRES_LOCATION=str:local
QUESTION/1/OVESETUP_PROVISIONING__CL_POSTGRES_ENABLED=str:automatic
QUESTION/1/OVESETUP_UPDATE_FIREWALL=str:yes
QUESTION/1/ovirt-cinderlib-enable=str:yes
QUESTION/1/ovirt-provider-ovn-default-credentials=str:yes
QUESTION/1/ovirt-provider-ovn=str:yes
QUESTION/1/queryEnvKey_warnverify_OVESETUP_CONFIG/fqdn=str:yes
QUESTION/2/OVESETUP_CONFIG_ADMIN_SETUP=str:${ovirt_password}
QUESTION/2/OVESETUP_PROVISIONING_POSTGRES_LOCATION=str:local
EOF
echo "Example Initialize the ovirt-engine"
engine-setup --offline --config-append=$ovirt_conf
echo "SSO ALTERNATE ENGINE FQDNS name ip"
host_IP=`ifconfig -a | grep inet | grep -v '127.0.0.1' | awk '{ print $2}' | awk 'NR==1'`
sed -i "s#SSO_ALTERNATE_ENGINE_FQDNS=\"\"#SSO_ALTERNATE_ENGINE_FQDNS=\"${host_IP}\"#" $ovirt_sso_conf
echo "Restart engine service"
systemctl restart ovirt-engine
echo "check ovirt-engine version"
rpm -q ovirt-engine | awk -F '-' '{print $3}'
echo "rm ovirt conf"
rm -rf $ovirt_conf
}
main (){
install_basics
}
main
执行安装ovirt
ovirt_install.sh
访问ovirt
https://192.168.12.241/
- admin/Report@123