6.1 Exporting Physical Devices as VBDs
One of the simplest configurations is to directly export individual
partitions from domain 0 to other domains. To achieve this use the
phy: specifier in your domain configuration file. For example a
line like
disk = ['phy:hda3,sda1,w']
specifies that the partition
/dev/hda3 in domain 0 should be
exported read-write to the new domain as
/dev/sda1; one could
equally well export it as
/dev/hda or
/dev/sdb5 should
one wish.
In addition to local disks and partitions, it is possible to export
any device that Linux considers to be ``a disk'' in the same manner.
For example, if you have iSCSI disks or GNBD volumes imported into
domain 0 you can export these to other domains using the phy:
disk syntax. E.g.:
disk = ['phy:vg/lvm1,sda2,w']
Block devices should typically only be shared between domains in a
read-only fashion otherwise the Linux kernel's file systems will get
very confused as the file system structure may change underneath
them (having the same ext3 partition mounted rw twice is a
sure fire way to cause irreparable damage)! Xend will attempt to
prevent you from doing this by checking that the device is not
mounted read-write in domain 0, and hasn't already been exported
read-write to another domain. If you want read-write sharing,
export the directory to other domains via NFS from domain 0 (or use
a cluster file system such as GFS or ocfs2).