How to Export a ZFS Volume as a Single-Slice Disk

  1. Create a ZFS volume to use as a single-slice disk.

    The following example shows how to create a ZFS volume, zdisk0, to use as a single-slice disk.

    service# zfs create -V 100m ldoms/domain/test/zdisk0

    The size of the volume defines the size of the virtual disk. This example creates a 100-Mbyte volume to get a 100-Mbyte virtual disk.

  2. From the control domain, export the corresponding device to that ZFS volume, and set the slice option so that the volume is exported as a single-slice disk.
    primary# ldm add-vdsdev options=slice /dev/zvol/dsk/ldoms/domain/test/zdisk0 \
    zdisk0@primary-vds0
  3. From the control domain, assign the volume to a guest domain.

    The following shows how to assign the volume, zdisk0, to guest domain ldg1.

    primary# ldm add-vdisk zdisk0 zdisk0@primary-vds0 ldg1
  4. After the guest domain is started and running the Oracle Solaris OS, you can list the disk (c0d9, for example) and see that the disk is accessible and is a single-slice disk (s0).
    ldg1# ls -1 /dev/dsk/c0d9s*
    /dev/dsk/c0d9s0
    /dev/dsk/c0d9s1
    /dev/dsk/c0d9s2
    /dev/dsk/c0d9s3
    /dev/dsk/c0d9s4
    /dev/dsk/c0d9s5
    /dev/dsk/c0d9s6
    /dev/dsk/c0d9s7