System Administration Guide: Virtualization Using the Solaris Operating System
Previous Next

Creating Guest Domain Environments Using File Systems

Prior to installing guest domains (domain Us), you must decide how to create the guest domain environment. The following methods using file systems are available:

Solaris ZFS

Uses the Solaris ZFS file system and volume datasets to enable the rapid provisioning of guest domains.

Uses normal files to store guest domain disk images. Live migrations are done using Network File System (NFS).

How to Configure ZFS for Use With Solaris xVM

First, create a new storage pool using the zpool command described in zpool(1M). The name of the disk can be specified as a full device path, such as /dev/dsk/c0t0d0s0 , or as a disk name, such as c1t0d0. Multiple disks can be specified by using disk names separated by a space, to use disk striping.

Then, create a Solaris ZFS volume to store the guest domain master image. Note that the Solaris ZFS volume is a dataset, however, it represents a block device and can be used like traditional UNIX block devices.

  1. Become superuser, or assume the Primary Administrator role.
  2. Create a new storage pool named xpool that includes the disk c1t0d0.
    # zpool create xpool c1t0d0

    The -f option can be used to force the action.

  3. Verify that the storage pool is created:
    # zpool list
    NAME    SIZE USED  AVAIL CAP HEALTH ALTROOT
    xpool   34G  156K  34.0G 0%  ONLINE -L

    You can use the zpool iostat command to view information about the I/O throughput of the newly created storage pool.

  4. Create an 8–Gbyte Solaris ZFS volume to store the guest domain master image.
    # zfs create -V 8gb xpool/domU-master
  5. List the Solaris ZFS volume block device nodes, which are identified as devices in the /dev/zvol/dsk and /dev/zvol/rdsk directories.
    # ls -l /dev/zvol/dsk/xpool
    total 2
    lrwxrwxrwx 1 root 35 Apr 19 10:24 domu.master ->../../ll/ll/devices/pseudo/zfs@0:1c

How to Use Files to Store Guest Domain Disk Images

A files based approach uses normal files to store guest domain disk images, and enables live migrations through NFS. A guest domain disk image is created using the mkfile command described in mkfile(1M). The following example creates a 10–Gbyte file for use by the Solaris Operating System guest domain disk image. Note that disk blocks are not allocated until data is written even though a size is specified.

If executing the mkfile command as a non-root user, be sure to manually set the sticky bit with the chmod command.

  1. Become superuser, or assume the Primary Administrator role.
  2. Create the disk image.
    $ mkfile -n 10g solaris-pv.img
  3. Check the size of the disk image using the ls command.
    $ ls -l solaris-pv.img
    -rw------T 1 root root 10737418240 May 17 13:43 solaris-pv.imgo
Previous Next