綜合雲平台 - oVirt - 06


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以下的系統的兼容

Manage Domain 
Data Center 
Domain Function 
Storage Type 
Host to Use 
Joshua-DC (V4) 
Data (Master) 
Glu sterF S 
host2.ovirt.joshua.com 
Name 
Description 
Comment 
data-gluster 
For data integrity make sure that the server is configured with Quorum (both client and server Quorum) 
Use managed gluster 
volume 
Path 
VFS Type 
Mount Options 
Advanced Parameters 
glusterlJoshua.com:/ovid 
glusteffs 
OK 
Cancel

 

# 可以看到 data-gluster 已經掛載到主機上了

Networks Storage Virtual Machines Irnport Domain Manage Domain Remove System All Colapse A" System e Data Centers Joshua-DC Storage O data-gluster -SJletworks Templates V O Clusters 0 cluo Hosts O host2.ovi1t.joshu VMS a External Providers O ovirt-image-repository Errata Active User Sessions Hosts New Dornain General Size. Available: Used: Allocated: Templates Domain Name data-gluster Data Center Comment Virtual Machines 34 34 < 1 GB < 1 GB 0% Domain Type Data (Master) Templates Storage Type GiusterFS Disk Snapshots Format Leases Cross Data Center Status Active Remote Data Sync Setup Total Space 34 Permissions Free Space 34 GB Disks Disk Profiles Events Description Events Over Allocation Ratio: 300kmarks ast Message: Warning Low Space Indicator: Critical Space Action Blocker: Dec 6, 2017 10:12:46 AM User admin@intemal-authz logged in.

 

 

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 添加

Manage Domain 
Data Center 
Domain Function 
Storage Type 
Host to Use 
Export Path 
Joshua-DC (V4) 
ISO 
NFS 
host2.ovirt.joshua.com 
ovi1tjoshua.com:Jexpons/iso 
Name 
Description 
Comment 
iso-nfs 
Custom Connection Parameters 
Advanced Parameters

 

New Domain 
Data Center 
Domain Function 
Storage Type 
Host to Use 
Export Path 
Joshua-DC (V4) 
Export 
hostl.ovirt.joshua.com 
Name 
Description 
Comment 
export-nfs 
ovift_joshua.conujexpons/export 
E g.: myserver.mydomain.com:/my/local/path 
Custom Connection Parameters 
Advanced Parameters

 

至此, oVirt 的部署就完成了


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM