System Administration Guide: Virtualization Using the Solaris Operating System

Chapter 38 Booting and Running the Sun xVM Hypervisor

This chapter discusses booting and running the hypervisor.

x86 Boot Architecture

The open source GNU GRand Unified Bootloader (GRUB) is implemented on x86 based systems that are running the Solaris Operating System. GRUB is the boot loader that is responsible for loading a boot archive into a system's memory. The boot archive contains the kernel modules and configuration files that are required to boot the system.

The GRUB main menu is based on the /boot/grub/menu.lst configuration file. For more information on GRUB, see Chapter 11, Modifying Solaris Boot Behavior (Tasks), in System Administration Guide: Basic Administration and grub(5).

Whether to run Solaris as a virtualized control domain or as a standalone operating system is a boot-time decision. To run the Solaris operating system as a standalone system, continue to use the same GRUB menu entries that you use currently.

In the Solaris xVM entry for booting Solaris as a control domain with the hypervisor, the kernel$ line refers to the hypervisor, and there are two module$ lines. The first module$ line must list the path to unix twice, with any arguments. The second module$ line lists the path to the boot archive.

In some situations, the GRUB menu.lst file might not reside in /boot/grub. To determine the location of the active GRUB menu.lst file, use the bootadm command with the list-menu subcommand.

For more information on the GNU GRand Unified Bootloader (GRUB) boot menu and its components, see System Administration Guide: Basic Administration.

Domain 0 Procedures

How to Set up OpenSolaris 2009.06 as a Sun xVM dom0

Use this procedure to set up the OpenSolaris 2008.11 or 2009.06 release as an xVM dom0.

  1. Create a separate boot environment, if needed.

    # pfexec beadm create -a -d xvm xvm
  2. If you're running a recent version of OpenSolaris, you can install the xvm-gui cluster instead of the individual packages.

    Otherwise, install the required packages.

    # pfexec beadm mount xvm /tmp/xvm-be 
    # pfexec pkg -R /tmp/xvm-be install SUNWvirt-manager SUNWxvm SUNWvdisk SUNWvncviewer 
    # pfexec beadm umount xvm
  3. Run the following AWK script over the menu.1st file that controls the GRUB menu. This step is necessary for beadm to reboot into xVM. The menu.1st file is typically located in the /pool-name/boot/grub directory on systems with a ZFS root. The correct menu.1st file is shown in Step 4 of this procedure.

    $ awk '
    /^title/ { xvm=0; }
    /^title.xvm$/ { xvm=1; }
    /^(splashimage|foreground|background)/ {
        if (xvm == 1) next
    /^kernel\$/ {
        if (xvm == 1) {
           print("kernel\$ /boot/\$ISADIR/xen.gz")
           sub("^kernel\\$", "module$")
           gsub("console=graphics", "console=text")
           gsub("i86pc", "i86xpv")
           $2=$2 " " $2
    { print }' /rpool/boot/grub/menu.lst >/var/tmp/menu.lst.xvm
  4. Verify that the AWK script worked properly.

    $ tail /var/tmp/menu.lst.xvm 
    #============ End of LIBBE entry =============
    title xvm
    findroot (pool_rpool,0,a)
    bootfs rpool/ROOT/xvm
    kernel$ /boot/$ISADIR/xen.gz
    module$ /platform/i86xpv/kernel/$ISADIR/unix /platform/i86xpv/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=text
    module$ /platform/i86pc/$ISADIR/boot_archive
    #============ End of LIBBE entry =============
  5. Create a new GRUB entry in /rpool/boot/grub/menu.1st.xvm and then reboot.

  6. Enable the xVM services.

    # svcadm enable -r xvm/virtd ; svcadm enable -r xvm/domains

You should now be able to install guest domains.

ProcedureHow to View Domains on the System

Run the virsh list, xm list or the xm top commands to view the domains on the system. These commands provide details of running domains. The display from any of these commands should show the single control domain, called Domain-0.

  1. Become superuser, or assume the appropriate role.

  2. Run virsh list.

    # virsh list Id Name                 State
      0 Domain-0             running
See Also

See the xentop(1M) man page.

Creating Guest Domain Environments by Using File Systems

Prior to installing guest domains (domain Us), you must decide how to create the guest domain environment.

ProcedureHow 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 appropriate 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
    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

ProcedureHow to Enable Migration to This Machine

This procedure is used to allow migration to this machine from all other control domains.

  1. Become superuser, or assume the appropriate role.

  2. Edit the xend-relocation-address, xend-relocation-hosts-allow, and xend-relocation-server properties of xvm/xend.

See Also

See dom0 configuration for admins