primary# ldm add-vdsdev mpgroup=mpgroup1 backend-path1 volume@primary-vds0
backend-path1 is the path to the virtual disk back end from the primary domain.
primary# ldm add-vdsdev mpgroup=mpgroup1 backend-path2 volume@alternate-vds0
backend-path2 is the path to the virtual disk back end from the alternate domain.
primary# ldm add-vdisk disk-name volume@primary-vds0 domain-name
The following shows how to create a LUN and add it to the virtual disk service for both primary and alternate domains by using the same mpgroup:
To determine which domain to use first when accessing the LUN, specify the associated path when adding the disk to the domain.
Create the virtual disk devices:
primary# ldm add-vdsdev mpgroup=ha lun1@primary-vds0 primary# ldm add-vdsdev mpgroup=ha lun1@alternate-vds0
To use the LUN from primary-vds0 first, perform the following command:
primary# ldm add-vdisk disk1 lun1@primary-vds0 gd0
To use the LUN from alternate-vds0 first, perform the following command:
primary# ldm add-vdisk disk1 lun1@alternate-vds0 gd0
After you configure the virtual disk with multipathing and start the guest domain, the virtual disk accesses its back end through one of the service domains it has been associated with. If this service domain becomes unavailable, the virtual disk attempts to access its back end through another service domain that is part of the same multipathing group.
Caution - When defining a multipathing group (mpgroup), ensure that the virtual disk back ends that are part of the same mpgroup are effectively the same virtual disk back end. If you add different back ends into the same mpgroup, you might see some unexpected behavior, and you can potentially lose or corrupt data stored on the back ends.