VirtualBox虚拟机添加共享磁盘

 

 使用VirtualBox工具在个人电脑上搭建RAC测试环境,共享存储设计方法如下:
1.利用VirtualBox中的VBoxManage工具创建磁盘,此工具在VirtualBox安装目录中可以找到
VBoxManage createhd --filename D:\rac\sharedisk\ocrvotdisk.vdi --size 3048 --format VDI --variant Fixed
VBoxManage createhd --filename D:\rac\sharedisk\data1.vdi --size 5000 --format VDI --variant Fixed
VBoxManage createhd --filename D:\rac\sharedisk\data2.vdi --size 5000 --format VDI --variant Fixed
VBoxManage createhd --filename D:\rac\sharedisk\arch1.vdi --size 5000 --format VDI --variant Fixed
VBoxManage createhd --filename D:\rac\sharedisk\arch2.vdi --size 5000 --format VDI --variant Fixed
 
2.将创建完的磁盘连接至虚拟机上,注意中文部分“SATA 控制器”,这是一串标识符,如果你的VirtualBox使用英文界面,这里要调成英文对的控制器名
VBoxManage storageattach node1 --storagectl "SATA 控制器" --port 1 --device 0 --type hdd --medium D:\rac\sharedisk\ocrvotdisk.vdi --mtype shareable
VBoxManage storageattach node1 --storagectl "SATA 控制器" --port 2 --device 0 --type hdd --medium D:\rac\sharedisk\data1.vdi --mtype shareable
VBoxManage storageattach node1 --storagectl "SATA 控制器" --port 3 --device 0 --type hdd --medium D:\rac\sharedisk\data2.vdi --mtype shareable
VBoxManage storageattach node1 --storagectl "SATA 控制器" --port 4 --device 0 --type hdd --medium D:\rac\sharedisk\arch1.vdi --mtype shareable
VBoxManage storageattach node1 --storagectl "SATA 控制器" --port 5 --device 0 --type hdd --medium D:\rac\sharedisk\arch2.vdi --mtype shareable
 
3.让这些磁盘能够共享,此信息将被记入到每个虚拟磁盘文件的文件头中,故其他其他再使用的时候就无需再设置成共享了
VBoxManage modifyhd D:\rac\sharedisk\ocrvotdisk.vdi --type shareable
VBoxManage modifyhd D:\rac\sharedisk\data1.vdi --type shareable
VBoxManage modifyhd D:\rac\sharedisk\data2.vdi --type shareable
VBoxManage modifyhd D:\rac\sharedisk\arch1.vdi --type shareable
VBoxManage modifyhd D:\rac\sharedisk\arch2.vdi --type shareable
 
4.将这些磁盘用如下命令加入到其他节点,同样的注意中文部分“SATA 控制器”标识名
VBoxManage storageattach node2 --storagectl "SATA 控制器" --port 1 --device 0 --type hdd --medium D:\rac\sharedisk\ocrvotdisk.vdi --mtype shareable
VBoxManage storageattach node2 --storagectl "SATA 控制器" --port 2 --device 0 --type hdd --medium D:\rac\sharedisk\data1.vdi --mtype shareable
VBoxManage storageattach node2 --storagectl "SATA 控制器" --port 3 --device 0 --type hdd --medium D:\rac\sharedisk\data2.vdi --mtype shareable
VBoxManage storageattach node2 --storagectl "SATA 控制器" --port 4 --device 0 --type hdd --medium D:\rac\sharedisk\arch1.vdi --mtype shareable
VBoxManage storageattach node2 --storagectl "SATA 控制器" --port 5 --device 0 --type hdd --medium D:\rac\sharedisk\arch2.vdi --mtype shareable

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14661773/viewspace-732706/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/14661773/viewspace-732706/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值