Xen Project Q&A Forum: First Line Help for Simple Questions
This is your chance to ask questions and provide answers about basic use of the Xen Project software. For debugging problems and for more complex issues, consider using the xen-users mailing list instead. You can find information about xen-users under "HELP | Mailing Lists" in the navigation bar above.
Sharing the same hard disk for read and write with 2 different Virtual Machines
On the high avaliable enviroment, Is it possible to configure Linux RedHat + XEN to share the same hard disk area and delivery it to 2 different Virtual Machines (VM)?
Example: I have two VM´s and both needs to read and write the same disk area.
Accepted AnswerLars KurthOffline0Hi, presumably you are using XM & XEND (as you are targeting RHEL).
If so, you need to change the option "w" (write) to w! in the XEN virtual machine configuration file located at /etc/xen/vm/VM-NAME/vm-name. Then, add the shared disk information into ALL virtual machines configuration files you want to share it with.
In the following example, xvdb disk is the one that will be shared.
Default configuration for a non shared disk
disk=[ 'file:/var/lib/xen/images/vm-name/disk0,xvda,w','file:/var/lib/xen/images/vm-name/disk1,xvdb,w', ]
than, all you need to do is including "!" as shown below:
disk=[ 'file:/var/lib/xen/images/vm-name/disk0,xvda,w','file:/var/lib/xen/images/vm-name/disk1,xvdb,w!', ]
Once you have changed it, you need to refresh that information in the XEN database. You can achieve that running the following command:
xm new -f vm-name
In addition, you can run "xm list -l vm-name |grep -i w!" command after changing it, in case you want to verify wether the virtual machine configuration file was updated in the xen database or not.
xm list -l vm-name |grep -i w! (mode 'w!')
In case you don't see the "!" (exclamation point), review your configuration before starting your XEN virtual machine.
Accepted AnswerLars KurthOffline
Accepted AnswerMartin HarranOffline0Just for info of anyone else doing this.
I did what is described above and got two different VMs - a Win8 and W2012 - reading a common data disk.
When I created a file in one VM, however, it did not appear on the other VM until I rebooted. Eventually figured out that I had to give Read and Write sharing on the disk inside both VMs to see the changes immediately.