Ovirt学习第1篇-超融合部署4.4.3

1、硬件规划

这里我们使用workstation来进行代替,三个节点

node cpu ram disk 网卡
node1 2c 8G 100G系统盘 200G数据盘 网卡1 桥接
node2 2c 2G 100G系统盘 200G数据盘 网卡1 桥接
node3 2c 2G 100G系统盘 200G数据盘 网卡1 桥接

2、网络规划

hostname ip 网关 掩码
linuxwt50.com 192.168.0.50 192.168.0.1 255.255.255.0
linuxwt51.com 192.168.0.51 192.168.0.1 255.255.255.0
linuxwt52.com 192.168.0.52 192.168.0.1 255.255.255.0
linuxwt53.com 192.168.0.53 192.168.0.1 255.255.255.0

linuxwt50~52.com这几个节点是物理节点,53是管理物理节点的虚拟机,部署在node1

ps1:主机名不能是已存在的域名
ps2:如果是管理网络和存储网络分开,那么需要给每台主机分配两个ip,两个域名,同时处于不同的网段

3、系统安装及配置

下载虚拟化镜像oVirt Node ISO

按照上面的规划,采用workstation新建一台虚拟机,配置相关参数模块,有一点很重要,新建的虚拟机需要打开
03bu-huo

完成系统安装后,还需要部署oVirt Engine Appliance

下载包oVirt Engine Appliance

上传oVirt Engine Appliance到node1

三台节点设置host

192.168.0.50 linuxwt50.com
192.168.0.51 linuxwt51.com
192.168.0.52 linuxwt52.com

node1上设置对自身及另外两台节点的免密登录

ssh-copy-id -i id_rsa.pub  linuxwt50.com
ssh-copy-id -i id_rsa.pub  linuxwt51.com
ssh-copy-id -i id_rsa.pub  linuxwt52.com

scp /etc/hosts linuxwt51.com:/etc
scp /etc/hosts linuxwt52.com:/etc

rpm -ivh ovirt-engine-appliance-4.4-20201110154142.1.el8.x86_64.rpm

这样就将ovirt engine安装在node1上,登录node1的管理页面
https://192.168.0.50:9090
03ovirt1

进入HostedEngine页面,点击“Hyperconverged”向导的“Start”按钮,开始部署过程,会先部署Gluster再部署HostedEngine
03ovirt2
选择“Run Gluster Wizard”向导
选中“Use same hostname for Storage and Public Network”,表示为存储网和管理网使用同一个网络,因为我们只配置了一个网卡,然后下面分别输入node1~3的域名
03ovirt4

Packages这一步不用配置,直接下一步即可
03ovirt5

数据盘只有200GiB,所以只保留engine和data两个卷即可,删除掉vmstore卷,engine卷对应着后续的engine存储域,用于存放HostedEngine的虚机镜像,data卷对应着后续的data存储域,用于存放普通虚机的虚机镜像,如果数据盘足够大的话可以划分多个卷对应着多个存储域,其中engine卷是必须要保留

03ovirt6

Raid Type这里我们选择“JBOD”,因为我们每台主机上的数据盘是单独的一块盘,如果实际环境中是多块盘做的Raid,那么就根据实际情况选择,LV Size累加起来不能超过sdb的实际大小,如果有SSD盘的话,可以使用下面的“Configuer LV Cache”配置缓存盘,本次实验环境中没有SSD

037

该步骤报错

failed: [linuxwt52.com] (item={'key': 'gluster_vg_sdb', 'value': [{'vgname': 'gluster_vg_sdb', 'pvname': '/dev/sdb'}]}) => {"ansible_loop_var": "item", "changed": false, "err": " Device /dev/sdb excluded by a filter.\n", "item": {"key": "gluster_vg_sdb", "value": [{"pvname": "/dev/sdb", "vgname": "gluster_vg_sdb"}]}, "msg": "Creating physical volume '/dev/sdb' failed", "rc": 5}

解决方式
三台节点上注释掉文件/etc/lvm/lvm.conf第357行
#filter = ["a|^/dev/disk/by-id/lvm-pv-uuid-TtffqM-aE1l-O7wL-TjkZ-8FNO-wfrr-Kej8Lt$|", "r|.*|"]

清楚历史后重新deploy
038

继续部署engine vm
HostedEngine的内存最小4GiB
03ovirt9
输入要设置的Web管理页面admin帐号的密码
03ovirt10
报错

[ ERROR ] fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["virt-install", "-n", "HostedEngineLocal", "--os-variant", "rhel8.0", "--virt-type", "kvm", "--memory", "4096", "--vcpus", "1", "--network", "network=default,mac=00:16:3e:31:ff:6b,model=virtio", "--disk", "/var/tmp/localvmn49ngat8/images/6d1ea50f-eecf-4077-bcd2-2e14035c39b5/e412657a-5448-49e4-9b6a-d1b35f5d9892", "--import", "--disk", "path=/var/tmp/localvmn49ngat8/seed.iso,device=cdrom", "--noautoconsole", "--rng", "/dev/random", "--graphics", "vnc", "--video", "vga", "--sound", "none", "--controller", "usb,model=none", "--memballoon", "none", "--boot", "hd,menu=off", "--clock", "kvmclock_present=yes"], "delta": "0:00:10.272799", "end": "2021-03-02 15:23:22.160109", "msg": "non-zero return code", "rc": 1, "start": "2021-03-02 15:23:11.887310", "stderr": "ERROR internal error: process exited while connecting to monitor: 2021-03-02T07:23:19.862671Z qemu-kvm: error: failed to set MSR 0xe1 to 0x0\nqemu-kvm: /builddir/build/BUILD/qemu-4.2.0/target/i386/kvm.c:2695: kvm_buf_set_msrs: Assertion ret == cpu->kvm_msr_buf->nmsrs' failed.\nDomain installation does not appear to have been successful.\nIf it was, you can restart your domain by running:\n virsh --connect qemu:///system start HostedEngineLocal\notherwise, please restart your installation.", "stderr_lines": ["ERROR internal error: process exited while connecting to monitor: 2021-03-02T07:23:19.862671Z qemu-kvm: error: failed to set MSR 0xe1 to 0x0", "qemu-kvm: /builddir/build/BUILD/qemu-4.2.0/target/i386/kvm.c:2695: kvm_buf_set_msrs: Assertion ret == cpu->kvm_msr_buf->nmsrs' failed.", "Domain installation does not appear to have been successful.", "If it was, you can restart your domain by running:", " virsh --connect qemu:///system start HostedEngineLocal", "otherwise, please restart your installation."], "stdout": "\nStarting install...", "stdout_lines":

解决方式

退出安装进程,并在退出的时候选择清理
0311

tee /etc/modprobe.d/qemu-system-x86.conf << EOF
options kvm ignore_msrs=1
EOF 

重启node1节点,再次安装

03ovirt12
03ovirt13
03ovirt14

下面需要用浏览器访问地址https://linuxwt53.com,因为目前没有搭建dns,所以暂时需要在客户机上做一个hosts解析
192.168.0.53 linuxwt53.com

同时需要在engine上添加需要添加进集群的节点node2、node3的解析

192.168.0.51 linuxwt51.com
192.168.0.52 linuxwt52.com

03ovirt20
输入安装engine时设置的用户名密码登录
03ovirt21
从图中可以看到目前集群中只有一台主机就是node1节点,同时只有一台虚拟机就是engine,部署在node1上的,所以相关显示的数据均是该节点目前的情况,下面把node2、node3添加进来
03ovirt22
新建--常规
03ovirt23
承载引擎
03ovirt24
03ovirt25

添加完主机后
03ovirt26

有时候重启机器后主机节点和卷的状态不对,处于异常状态,但是服务器始可以连接并且通过命令的方式查看各个卷的状态也是正常的,这个时候需要通过engine做一下处理
03ds9

03ds10