Lvm
OpenNebula LVM 數據儲存使用場景問題
我已經嘗試在測試環境中配置 OpenNebula,由兩台主機組成:
- 帶有太陽石的星雲(前置機)
- 已配置 VG的 kvm-node-1主機
星雲機包含以下內容:
root@nebula:/var/lib/one/datastores# onedatastore list ID NAME SIZE AVAIL CLUSTERS IMAGES TYPE DS TM STAT 0 system - - 0 0 sys - ssh on 1 default 39.1G 70% 0 4 img fs ssh on 2 files 39.1G 70% 0 0 fil fs ssh on 100 images_shared 39.1G 70% 0 2 img fs shared on 104 lvm_system 39.1G 76% 0 0 sys - fs_lvm on 105 lvm_images 39.1G 70% 0 1 img fs fs_lvm on 106 lvm_system2 39.1G 76% 0 0 sys - fs_lvm on root@nebula:/var/lib/one/datastores# ls /var/lib/one/datastores/ 0 1 100 101 105 2 root@nebula:/var/lib/one/datastores# showmount -e Export list for nebula: /var/lib/one/datastores/105 192.168.122.0/24 /var/lib/one/datastores/100 192.168.122.0/24
kvm-node-1機器包含以下內容:
root@kvm-node-1:/var/lib/one/datastores# ls /var/lib/one/datastores/ 0 100 104 105 106 root@kvm-node-1:/var/lib/one/datastores# mount|grep nfs nfsd on /proc/fs/nfsd type nfsd (rw,relatime) 192.168.122.240:/var/lib/one/datastores/100 on /var/lib/one/datastores/100 type nfs4 (rw,relatime,vers=4.2,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.122.74,local_lock=none,addr=192.168.122.240) 192.168.122.240:/var/lib/one/datastores/105 on /var/lib/one/datastores/105 type nfs4 (rw,relatime,vers=4.2,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.122.74,local_lock=none,addr=192.168.122.240) root@kvm-node-1:/var/lib/one/datastores# vgs VG #PV #LV #SN Attr VSize VFree vg-one-0 1 1 0 wz--n- <10,00g <9,98g
我可以通過 Sunstone 將帶有映像的 VM 部署到虛擬機管理程序。此映像已成功啟動。但由於錯誤,我無法終止 VM:
Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 Command execution failed (exit code: 5): /var/lib/one/remotes/tm/fs_lvm/delete nebula:/var/lib/one//datastores/0/29/disk.0 29 105 Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG E 29 delete: Command " set -x Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 DEV=$(readlink /var/lib/one/datastores/0/29/disk.0) Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 if [ -d "/var/lib/one/datastores/0/29/disk.0" ]; then Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 rm -rf "/var/lib/one/datastores/0/29/disk.0" Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 else Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 rm -f /var/lib/one/datastores/0/29/disk.0 Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 if [ -z "$DEV" ]; then Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 exit 0 Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 fi Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 if echo "$DEV" | grep "^/dev/" &>/dev/null; then Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 sudo lvremove -f $DEV Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 fi Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 fi" failed: ++ readlink /var/lib/one/datastores/0/29/disk.0 Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 + DEV=/dev/vg-one-0/lv-one-29-0 Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 + '[' -d /var/lib/one/datastores/0/29/disk.0 ']' Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 + rm -f /var/lib/one/datastores/0/29/disk.0 Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 + '[' -z /dev/vg-one-0/lv-one-29-0 ']' Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 + echo /dev/vg-one-0/lv-one-29-0 Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 + grep '^/dev/' Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 + sudo lvremove -f /dev/vg-one-0/lv-one-29-0 Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 Volume group "vg-one-0" not found Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG I 29 Cannot process volume group vg-one-0 Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: LOG E 29 Error deleting /var/lib/one/datastores/0/29/disk.0 Fri Nov 9 16:04:55 2018 [Z0][TM][D]: Message received: TRANSFER FAILURE 29 Error deleting /var/lib/one/datastores/0/29/disk.0
我應該如何使用 LVM 數據儲存組織前端機器和管理程序機器之間的交換來解決這個問題?
我已經在 OpenNebula 論壇中解決了這個問題。
簡而言之:
我已經解決了我的問題,特別是通過刪除 id 為 0 的預設系統數據儲存。現在,VM 實例正在正確的 VG 中創建(vg-one-104 而不是 vg-one-0)。我不知道這是否是正確的行為(刪除預設系統數據儲存),但它現在對我有用。因此,VM 實例也正確終止。我將此主題設置為已解決。
所有主題都位於此連結。