System Administration Guide: Oracle Solaris Containers-Resource Management and Oracle Solaris Zones

Creating the Image Used to Directly Migrate A Solaris System Into a Zone

You can use the Flash Archiving tools to create an image of an installed system that can be migrated into a zone.

The system can be fully configured with all of the software that will be run in the zone before the image is created. This image is then used by the installation program when the zone is installed.

Caution – Caution –

If you create a Solaris Flash archive, or flar, of a Solaris 10 system that has a ZFS root, then by default, the flar will actually be a ZFS send stream, which can be used to recreate the root pool. This image cannot be used to install a zone. You must create the flar with an explicit cpio or pax archive when the system has a ZFS root.

Use the flarcreate command with the -L archiver option, specifying cpio or pax as the method to archive the files. See Step 4 in the next procedure.

ProcedureHow to Use flarcreate to Create the Image

Use the flarcreate command described in the flarcreate(1M) man page to create the system image. This example procedure uses NFS to place the flash archive on the target Solaris system, but you could use any method to move the file.

You must be the global administrator in the global zone to perform this procedure.

  1. Become superuser, or assume the Primary Administrator role.

  2. Log in to the source system to be archived.

  3. Change directories to the root directory.

    # cd /
  4. Use flarcreate to create a flash archive image file named s10-system on the source system, and place the archive onto the target system:

    source-system # flarcreate -S -n s10-system -L cpio /net/target/export/s10-system.flar
    Determining which filesystems will be included in the archive...
    Creating the archive...
    cpio: File size of "etc/mnttab" has
    increased by 435
    2068650 blocks
    1 error(s)
    Archive creation complete.

    The target machine will require root write access to the /export file system. Depending on the size of the file system on the host system, the archive might be several gigabytes in size, so enough space should be available in the target filesystem.

    Tip –

    In some cases, flarcreate can display errors from the cpio command. Most commonly, these are messages such as File size of etc/mnttab has increased by 435. When these messages pertain to log files or files that reflect system state, they can be ignored. Be sure to review all error messages thoroughly.

Other Archive Creation Methods

You can use alternate methods for creating the archive. The installer can accept the following archive formats:

Note that the installer can only accept a directory of files created by using an archiving utility that saves and restores file permissions, ownership, and links.

For more information, see the cpio(1), pax(1), bzip2(1), gzip(1), and ufsdump(1M) man pages.

Note –

If you use a method other than flash archive for creating an archive for P2V, you must unmount the processor-dependent lofs-mounted hardware capabilities (hwcap) library on the source system before you create the archive. Otherwise, the zone installed with the archive might not boot on the target system. After you have created the archive, you can remount the proper hardware capabilities library on top of /lib/ by using lofs and the mount -O option.

source-system# unmount /lib/
source-system# mount -O -F lofs /lib/