6. 接下来要挂载存储了, oVirt里面存储分三块:

Data Domain

存储运行的虚拟机, 虚拟机的硬盘存在这个数据域里

ISO Domain

存放 ISO 镜像

Export Domain

用于虚拟机的导出

 

 

 

 

 

其中, Data 域最最重要, 直接影响到运行中的虚拟机的高可用性, 所以这个用 GlusterFS 来做存储, 其他的都可以用 NFS

# 在 oVirt 中使用 gluster 有两种方式, 一种是 ovirt 自己管理 gluster 主机, 另外一种是直接使用外部分享过来的 gluster volume

# 为了统一管理各个平台的存储, 这里使用外部分享的方式, 也就是使用我们之前就做好了的 gluster1.joshua.com:/ovirt

# 首先, 对于 ovirt 使用的卷, 在 gluster 的 Volume 参数里,要将用户更改为 36:36, 不然会因为权限问题导致无法使用

$ gluster volume set ovirt storage.owner-uid=36

$ gluster volume set ovirt storage.owner-gid=36

 

# 然后, 在 host1 和 host2 上写两条短域名的解析, 个人猜测系统访问 glsuter1 的时候不用 gluster1.joshua.com 而是直接使用了 gluster1 这个域名, 然后被 search domain 默认加上了 ovirt.joshua.com, 于是就解析不到了

$ cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.1.201 gluster1

192.168.1.202 gluster2

192.168.1.203 gluster3

# 接着在三个节点上都要看看这三个包有没有安装

$ ansible glsuterfs -m yum -a "name=glusterfs"

$ ansible glsuterfs -m yum -a "name=glusterfs-fuse"

$ ansible glsuterfs -m yum -a "name=glusterfs-cli"

 

# 可以测试一下是否能挂载

$ mount -t glusterfs gluster1.joshua.com:/ovirt /mnt

$ df -hT

$ umount /mnt

 

# 然后去添加 data Domain

# 额外, 挂载参数可以加上:

# backup-volfile-servers=gluster2.joshua.com:gluster3.joshua.com - 高可用

# acl - setfacl支持     _netdev - 对RHEL7以下的系统的兼容

综合云平台 - oVirt - 06

 

# 可以看到 data-gluster 已经挂载到主机上了

综合云平台 - oVirt - 06

 

 

7. 用 NFS 的方式添加 ISO 以及 Export Domain

# 官网参考: https://www.ovirt.org/documentation/admin-guide/chap-Storage/

# 我们这里单独建一个 VG 给 ISO 以及 Export 用

$ lsblk

NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT

sda               8:0    0   40G  0 disk

├─sda1            8:1    0    1G  0 part /boot

└─sda2            8:2    0   39G  0 part

  └─vg_sys-root 253:0    0   39G  0 lvm  /

sdb               8:16   0   20G  0 disk

sdc               8:32   0   40G  0 disk

sdd               8:48   0   60G  0 disk

sr0              11:0    1  792M  0 rom

$ for i in sd{b,c,d}; do pvcreate /dev/$i; done

  Physical volume "/dev/sdb" successfully created.

  Physical volume "/dev/sdc" successfully created.

  Physical volume "/dev/sdd" successfully created.

$ vgcreate vg_ovirt /dev/sdb /dev/sdc /dev/sdd

$ vgdisplay

  Free  PE / Size       30717 / <119.99 GiB

$ lvcreate -l +30717 -n lv_ovirt vg_ovirt

$ lvs

  LV       VG       Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert

  lv_ovirt vg_ovirt -wi-a----- <119.99g 

$ echo "/dev/vg_ovirt/lv_ovirt /exports xfs defaults 0 0" >> /etc/fstab

$ mkfs.xfs -i size=512 /dev/vg_ovirt/lv_ovirt

$ mount -a

 

# 接下来是 NFS 共享, 官网上有, 偷个懒直接 ctrl c 下来

 

$ yum -y install nfs-utils

$ systemctl daemon-reload && systemctl enable rpcbind.service && systemctl enable nfs-server.service

$ systemctl start rpcbind.service nfs-server.service

$ mkdir /exports/{export,iso}

$ vim /etc/exports

/exports/iso          *(rw,async,no_root_squash)

/exports/export    *(rw,async,no_root_squash)

$ exportfs -r

$ systemctl reload nfs-server.service

$ chown -Rv 36:36 /exports/

$ chmod -Rv 0755 /exports/

 

# 最后, 去 GUI 添加

综合云平台 - oVirt - 06

 

综合云平台 - oVirt - 06

 

至此, oVirt 的部署就完成了

相关文章:

  • 2021-07-17
  • 2021-09-04
  • 2021-12-09
  • 2021-04-16
  • 2021-08-26
  • 2021-10-23
  • 2022-12-23
猜你喜欢
  • 2021-08-14
  • 2021-12-05
  • 2021-07-18
  • 2022-01-09
  • 2021-07-23
  • 2021-08-03
  • 2021-12-09
相关资源
相似解决方案