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.

Hi All.

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.


Responses (3)
  • Accepted Answer

    Tuesday, August 06 2013, 02:38 PM - #permalink
    Hi, 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.
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, August 06 2013, 02:44 PM - #permalink
    An alternative would be to use symlinks
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, November 16 2014, 03:54 PM - #permalink
    Just 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.
    The reply is currently minimized Show
Your Reply