了解為何 OpenStack 為何沒有 disk by-id

2017-01-08 OpenStack

此篇是前篇在查虛擬機真實性的延伸閱讀;

 

在一般的 Virtual Machine 都會在 /dev/disk/by-id 替 disk 產生一個 UUID link 到實際硬碟位置 (sda、sda1、sdb … etc)

$ ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root  9 Jan  2 00:33 ata-u02-Ubuntu-0_SSD_H27AXNE0H76MV18T13AG -> ../../sda
lrwxrwxrwx 1 root root 10 Jan  2 00:33 ata-u02-Ubuntu-0_SSD_H27AXNE0H76MV18T13AG-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jan  2 00:33 ata-u02-Ubuntu-0_SSD_H27AXNE0H76MV18T13AG-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jan  2 00:33 ata-u02-Ubuntu-0_SSD_H27AXNE0H76MV18T13AG-part5 -> ../../sda5
..
..
etc

 

 

但是在 OpenStack 在新增 disk 的時候就會自動生成 UUID 了,所以不會在 /dev/disk/by-id 裡面產生 UUID link,這個在 Cinder bugs 有提到是 VMWare 的 default 設定

The work around given is to set disk.EnableUUID to True for the Linux VM. In case of Openstack volumes, as the uuid of virtual disk/VMDK disk is autogenerated, if user tries to enable this property the /dev/disk/by-id shows the autogenerated uuids for the VMDK disks. Due to this the user/application has no means to identify the Openstack volume. Instead if the uuid of VMDK disk is same as the Openstack volume ID, it helps in identifying the Openstack created volumes.

但是他也可以透過修改 vmx 啟動啦,不過通常沒有這個必要。

disk.EnableUUID = True

 

 

參考資料:

Cinder VMDK driver : uuid of VMDK disk file needs to be the same as of corresponding Cinder volume ID

 

給 Mr. 沙先生一點建議

彙整

分類

展開全部 | 收合全部

License

訂閱 Mr. 沙先生 的文章

輸入你的 email 用於訂閱