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-megabyte volume to get a 100-megabyte virtual disk.
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 |
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 |
After the guest domain is started and running the 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 |