How to Export a ZFS Volume as a Full Disk

  1. Create a ZFS volume to use as a full disk.

    The following example shows how to create a ZFS volume, zdisk0, to use as a full 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 result in a 100-Mbyte virtual disk.

  2. From the control domain, export the corresponding device to that ZFS volume.
    primary# ldm add-vdsdev /dev/zvol/dsk/ldoms/domain/test/zdisk0 \
    zdisk0@primary-vds0

    In this example, the slice option is not set so the file is exported as a full disk.

  3. From the control domain, assign the volume to a guest domain.

    The following example shows how to assign the volume, zdisk0, to the 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, verify that the disk is accessible and is a full disk.

    A full disk is a regular disk with eight slices.

    The following example shows how to list the disk, c0d9, and verify that it is accessible and is a full disk:

    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