快盘下载:好资源、好软件、快快下载吧!

快盘排行|快盘最新

当前位置:首页软件教程电脑软件教程 → 虚拟机创建共享磁盘

虚拟机创建共享磁盘

时间:2022-09-24 09:01:03人气:作者:快盘下载我要评论
1.创建共享磁盘柜 在虚拟机软件的安装目录下,有个vmware-vdiskmanager.exe文件(老版本用plainmaker.exe),把它复制到共享磁盘柜目录下,创建共享磁盘(老版本共享磁盘文件的扩展名为.pln) F:虚拟机共享磁盘柜>vmware-vdiskmanager.exe -c -s 200Mb -a lsilogic -t 2 quorum.vmdk F:虚拟机共享磁盘柜>vmware-vdiskmanager.exe -c -s 4Gb -a lsilogic -t 2 sharedisk.vmdk 创建完毕后,目录下有四个新文件 quorum-flat.vmdk quorum.vmdk sharedisk-flat.vmdk sharedisk.vmdk 2.配置虚拟机 在虚拟机器界面选择“Edit virtual machine settings”à添加硬盘,选“Use a existing virtual disk”,分别添加quorum.vmdk、sharedisk.vmdk 双击新加的磁盘,在弹出的磁盘属性窗选“advance”,为新加的硬盘选择虚拟设备节点:quorum.vmdk选订“SCSI 0:1”, sharedisk.vmdk选定“SCSI 1:1”。
分别打开两台虚拟机目录中的vmx文件,在最后一行添加:

disk.locking="FALSE"

scsi0:1.SharedBus="Virtual"

scsi1:1.SharedBus="Virtual"
vmware中设置共享磁盘,需要满足两个条件: 1、硬盘的高级属性中必须设置成1:0,如果增加第二块共享硬盘,也设成1:0,系统就会报错,所以设置成1:1(这种方式本人还没试过,不过在Oracle双机的文章中看到过这样的设置方法)

2、需要在vmware的配置属性文件(如rhel3.vmx)中加入两条属性
scsi[n].sharedBus = "virtual"
disk.locking = "false" 系统启动的时候会锁定磁盘,所以当启动linux1后共享磁盘被锁定了,linux2就起不来了,因此需要加入disk.locking = "false" 。

一般来说,如果是scsi1:0,则n为1,也就是scsi1.sharedBus = "virtual" ,表示所有的bus都共享,vmare推荐这种做法。
如果说是不是所有的bus都共享的话,可以将上述scsi1.sharedBus = "virtual"改成scsi1:1.shared = "true" 。
SCSI reservation must be enabled in a virtual machine before you can share its disks. To enable it, make sure the virtual machine is powered off. Open the configuration file (.vmx file on Windows hosts, .cfg file on Linux hosts) in a text editor and add the line scsi[n].sharedBus = "virtual" anywhere in the file, where [n] is the SCSI bus being shared. 
VMware recommends you set up the shared disks on their own SCSI bus, which is a different bus than the one the guest operating system uses. For example, if your guest operating system is on scsi0:0, you should set up disks to share on scsi1 bus. 
For example, to enable SCSI reservation for devices on the scsi1 bus, add the following line to the virtual machine's configuration file: 
scsi1.sharedBus = "virtual" 
This gives the whole bus the ability to be shared. However, if you would rather not share the whole bus, you can selectively enable SCSI reservation for a specific SCSI disk on the shared bus. This prevents the locking of this specific disk. Add the following line to the configuration file: 
scsi1:1.shared = "true" 
If SCSI reservation is enabled (that is, scsi1.sharedBus is set to "virtual"), then this setting is ignored. 
In addition to enabling SCSI reservation on the bus, you need to allow virtual machines to access the shared disk concurrently. Add the following line to the virtual machine's configuration file: 
disk.locking = "false" 
This setting permits multiple virtual machines to access a disk concurrently. Be careful though; if any virtual machine not configured for SCSI reservation tries to access this disk concurrently, then the shared disk is vulnerable to corruption or data loss. 
When SCSI reservation is enabled, a reservation lock file that contains the shared state of the reservation for the given disk is created. The name of this file consists of the filename of the SCSI disk appended with .RESLCK. 
For example, if the disk scsi1:0.filename is defined in the configuration file as 
scsi1:0.fileName = "//vmSCSI.pln" 
then the reservation lock file for this disk is given the default name 
"//vmSCSI.pln.RESLCK" 
However, you can provide your own lock file name. Add a definition for scsi1:0.reslckname to the configuration file. For example, if 
scsi1:0.reslckname = "/tmp/scsi1-0.reslock" 
is added to the configuration file, it overrides the default lock file name. 

Selecting the Disk
Once SCSI reservation is enabled for a disk — that is, the scsi[n].sharedBus = "virtual" and disk.locking = "false" settings are added to the configuration file for each virtual machine wanting to share this disk, you need to point to this disk for each virtual machine that wants to access it. 

Sharing a Disk on the scsi0 Bus
在vmware中创建共享磁盘
plainmaker已经不用了,现在直接添加磁盘 为一台机器添加一个新的虚拟磁盘,然后再为另一台机器添加一个已存在的虚拟磁盘
然后修改一下两台机器的配置文件,添加如下内容
scsi1.sharedBus = "virtual"
disk.locking = "false"

假定两台机器的虚拟磁盘都在scsi1这个总线上。
注意两台机器中要共享的盘的总线和总线地址应该是一样的,并且最好不要和主机操作系统使用的盘在一个总线上。

相关文章

  • 虚拟机fedora安装教程

    虚拟机fedora安装教程_潜水艇下水器安装图解,2.下载Fedora12 下载地址:http://fedoraproject.org/get-fedora...
  • Vmware虚拟机上CentOS8安装教程

    Vmware虚拟机上CentOS8安装教程,这篇文章介绍如何在Vmware虚拟机上安装CentOS8操作系统,第一章节先介绍了CentOS的特点,第二章节介绍CentOS操作系统下载,虚拟机下载安装,然后开始介绍操作系统的安装过程,配置过程。...

网友评论

快盘下载暂未开通留言功能。

关于我们| 广告联络| 联系我们| 网站帮助| 免责声明| 软件发布

Copyright 2019-2029 【快快下载吧】 版权所有 快快下载吧 | 豫ICP备10006759号公安备案:41010502004165

声明: 快快下载吧上的所有软件和资料来源于互联网,仅供学习和研究使用,请测试后自行销毁,如有侵犯你版权的,请来信指出,本站将立即改正。