Disk Space Requirements
If your planning on using VBD-based Solaris guest domains, you will need to allocate sufficient disk space at the time the dom0 system is installed. A full Solaris install (SUNWcxall) consumes approximately 4 Gb of disk space. The dom0 root partition must have at least 10 Gb of space allocated, while 20 Gb is preferable. Plan on reserving at least 5 Gb per client image, as well as 5 Gb for each guest prototype image. In addition you'll need space for the flar archive.
Solaris supports both file-backed and device-backed VBD images. File-backed images are files files containing the UFS filesystem image and are accessed by mounting the file using the loopback file driver lofi(7d). Device-backed images can be stored in a disk partition or a Solaris Volume Manager device. Solaris Volume Manager soft partitions are the recommended method for storing domU images for the flexibility and performance advantages they have over physical disk partitions and file-backed images.
The domU prototype and client images are by default stored under /export/xc. If your planning on using file-backed prototypes or domU images, you must have sufficient disk space allocated to /export/xc, either as part of the root partition or as a secondary mount point.
domU prototype images
Once you have installed Solaris as dom0, you will need to create a prototype image from which client domU images are created. A prototype image is a copy of a flash archived which has been modified to run as a Solaris domU. You will first create a flash archive image of the dom0 which is then processing by vbdcfg to produce the prototype.
# flar create -n {flarname} -x /sys.flar /sys.flar
Do not use the -S
option: this will not work due to a known bug. It is recommended that the flash archive be created immediately after the system has been installed to minimize the number of changes to the dom0 configuration before a prototype is constructed. You can also reduce the size of the dom0 images by removing packages from the dom0 system which are not needed prior to creating the flash archive.
Prototype images are created by invoking vbdcfg with the subcommand 'mkproto' to create either file-backed or device-backed images.
Example: Creating SVM-backed prototype image
$ metadb -a -f /dev/dsk/c1t1d0s5
$ metainit myproto -p /dev/dsk/c1t1d0s5 5g
$ vbdcfg mkproto -d /dev/md/dsk/myproto -a /sys.flar myproto
$ vbdcfg lsproto
/export/xc/proto domU images
myproto: phy:/dev/md/dsk/myproto 10485760 blks
Note: metadb only needs to be executed once for each device being to create SVM partitions.
Example: Creating file-backed prototype image
$ vbdcfg mkproto -f -a /sys.flar fileproto
$ vbdcfg lsproto
/export/xc/proto domU images
fileproto: file:/export/xc/proto/fileproto/root.file 8346763 blks
myproto: phy:/dev/md/dsk/myproto 10485760 blks
Creating Solaris domU guest VBD images
domU images are configured using the mkdomU subcommand. The process involves copying the protototype image into a client-specific root and makes client-specific customizations.
Example: Creating device-backed domUs
$ metainit mydomU -p /dev/dsk/c1t1d0s5 10485760b
$ vbdcfg mkdomU -d /dev/md/dsk/mydomU -e aa:04:03:35:a8:44 myproto mydomU
Example: Creating file-backed domUs
$ vbdcfg mkdomU -f -e aa:04:03:35:a8:44 fileproto mydomU
Booting Solaris domU VBD images
vbdcfg creates the xm python script for booting the domU guest under /export/xc/xvm/{domU}/{domU}.py and /export/xc/xvm/{domU}/{domU}-64.py.
Example
$ pwd
/export/xc/xvm/mydomU
$ ls
platform root.dev mydomU-64.py mydomU.py vmnt
$ xm create -c mydomU.py
Using config file "mydomU.py".
Started domain mydomU
SunOS Release 5.11 Version matrix-build-2006-08-15 32-bit
Copyright 1983-2006 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
DEBUG enabled
Hostname: mydomU
NIS domain name is mpklab.sfbay.sun.com