If a virtual disk backend is accessible through different service domains, then you can configure virtual disk multipathing so that the virtual disk in a guest domain remains accessible if a service domain goes down. An example of a virtual disk backend accessible through different service domains is a file on a network file system (NFS) server or a shared physical disk connected to several service domains.
To enable virtual disk multipathing, you must export a virtual disk backend from the different service domains and add it to the same multipathing group (mpgroup). The mpgroup is identified by a name and is configured when the virtual disk backend is exported.
The following figure illustrates how to configure virtual disk multipathing. In this example, a multipathing group named foo is used to create a virtual disk, whose backend is accessible from two service domains: primary and alternate.
Export the virtual backend from the primary service domain.
# ldm add-vdsdev mpgroup=foo backend-path1 volume@primary-vds0
Where backend-path1 is the path to the virtual disk backend from the primary domain.
Export the same virtual backend from the alternate service domain.
# ldm add-vdsdev mpgroup=foo backend-path2 volume@alternate-vds0
Where backend-path2 is the path to the virtual disk backend from the alternate domain.
backend-path1 and backend-path2 are paths to the same virtual disk backend, but from two different domains (primary and alternate). These paths might be the same or might be different depending on the configuration of the primary and alternate domains. The volume name is a user choice. It might be the same or different for both commands.
Export the virtual disk to the guest domain.
# ldm add-vdisk disk-name volume@primary-vds0 ldom
Although the virtual disk backend is exported several times through different service domains, you assign only one virtual disk to the guest domain and associate it with the virtual disk backend through any of the service domains.
Once you configure the virtual disk with multipathing and start the guest domain, the virtual disk accesses its backend through the service domain it has been associated with (the primary domain in this example). If this service domain becomes unavailable, then the virtual disk tries to access its backend through a difference service domain that is part of the same multipathing group.
When defining a multipathing group (mpgroup), ensure that the virtual disk backends that are part of the same mpgroup are effectively the same virtual disk backend. If you add different virtual disks' backends into the same mpgroup, you might see some unexpected behavior, and you can potentially lose or corrupt data stored on the backends.