2.將創建完的磁盤連接至虛擬機上,注意中文部分“SATA 控制器”,這是一串標識符,如果你的VirtualBox使用英文界面,這裡要調成英文對的控制器名
VBoxManage storageattach rac1 --storagectl "SATA 控制器" --port 1 --device 0 --type hdd --medium D:\VirOS\sharedisks\crs.vdi --mtype shareable
VBoxManage storageattach rac1 --storagectl "SATA 控制器" --port 2 --device 0 --type hdd --medium D:\VirOS\sharedisks\asm1.vdi --mtype shareable
VBoxManage storageattach rac1 --storagectl "SATA 控制器" --port 3 --device 0 --type hdd --medium D:\VirOS\sharedisks\asm2.vdi --mtype shareable
VBoxManage storageattach rac1 --storagectl "SATA 控制器" --port 4 --device 0 --type hdd --medium D:\VirOS\sharedisks\asm3.vdi --mtype shareable
VBoxManage storageattach rac1 --storagectl "SATA 控制器" --port 5 --device 0 --type hdd --medium D:\VirOS\sharedisks\asm4.vdi --mtype shareable
3.讓這些磁盤能夠共享,此信息將被記入到每個虛擬磁盤文件的文件頭中,故其他其他再使用的時候就無需再設置成共享了
VBoxManage modifyhd D:\VirOS\sharedisks\crs.vdi --type shareable
VBoxManage modifyhd D:\VirOS\sharedisks\asm1.vdi --type shareable
VBoxManage modifyhd D:\VirOS\sharedisks\asm2.vdi --type shareable
VBoxManage modifyhd D:\VirOS\sharedisks\asm3.vdi --type shareable
VBoxManage modifyhd D:\VirOS\sharedisks\asm4.vdi --type shareable
4.將這些磁盤用如下命令加入到其他節點,同樣的注意中文部分“SATA 控制器”標識名
VBoxManage storageattach rac2 --storagectl "SATA 控制器" --port 1 --device 0 --type hdd --medium D:\VirOS\sharedisks\crs.vdi --mtype shareable
VBoxManage storageattach rac2 --storagectl "SATA 控制器" --port 2 --device 0 --type hdd --medium D:\VirOS\sharedisks\asm1.vdi --mtype shareable
VBoxManage storageattach rac2 --storagectl "SATA 控制器" --port 3 --device 0 --type hdd --medium D:\VirOS\sharedisks\asm2.vdi --mtype shareable
VBoxManage storageattach rac2 --storagectl "SATA 控制器" --port 4 --device 0 --type hdd --medium D:\VirOS\sharedisks\asm3.vdi --mtype shareable
VBoxManage storageattach rac2 --storagectl "SATA 控制器" --port 5 --device 0 --type hdd --medium D:\VirOS\sharedisks\asm4.vdi --mtype shareable