Solaris P2V Process

This post is a work-in-progress.  The initial content is taken directly from Oracle’s own knowledge base here.  In time, it is my intention to augment the fundamental steps laid out below with real-world observations, screenshots, modifications and additional steps.

The P2V (Physical Server to Virtual Machine Migration is effectively the technical process of decommissioning a physical SPARC server by relocating its workload to an isolated instance of Solaris, running in software (known as a non-global zone) on a more powerful server, like a T8 or M8 running Solaris 11 and Oracle VM Server for SPARC (known as the global zone).


Obtain the hostname:
# hostname

Obtain the hostid:
# hostid

Also see Host ID Emulation.

Obtain the root password.

View the software being run on the system:
# ps -eaf

Check the networking configuration on the system:
# ifconfig -a

View the storage utilized, for example, by viewing the contents of /etc/vfstab.

View the amount of local disk storage in use, which determines the size of the archive:
# df -k

Determine the packages and patches that are on the system. See pkginfo(1) for more information.
Examine the contents of /etc/system.


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.

Become superuser, or assume the Primary Administrator role.

Log in to the source system to be archived.

Change directories to the root directory.
# cd /

Use flarcreate to create a flash archive image file named s10-system on the source system, and place the archive onto the target 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 4352068650 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.


Note that the only required elements to create a native non-global zone are the zonename and zonepath properties.  Other resources and properties are optional.  Some optional resources also require choices between alternatives, such as the decision to use either the dedicated-cpu resource or the capped-cpu resource.  See Zone Configuration Data for information on available zonecfg properties and resources.

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

Become superuser, or assume the Primary Administrator role.

To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.

Set up a zone configuration with the zone name you have chosen.

The name my-zone is used in this example procedure.
global# zonecfg -z my-zone

If this is the first time you have configured this zone, you will see the following system message:
my-zone: No such zone configured

Use ‘create’ to begin configuring a new zone.
Create the new zone configuration.

This procedure uses the default settings.
zonecfg:my-zone> create

Set the zone path, /export/home/my-zone in this procedure.
zonecfg:my-zone> set zonepath=/export/home/my-zone

Do not place the zonepath on ZFS for releases prior to the Solaris 10 10/08 release.
Set the autoboot value.

If set to true, the zone is automatically booted when the global zone is booted. Note that for the zones to autoboot, the zones service svc:/system/zones:default must also be enabled. The default value is false.
zonecfg:my-zone> set autoboot=true

Set persistent boot arguments for a zone.
zonecfg:my-zone> set bootargs=”-m verbose”

Dedicate one CPU to this zone.
zonecfg:my-zone> add dedicated-cpu

Set the number of CPUs.
zonecfg:my-zone:dedicated-cpu> set ncpus=1-2
(Optional) Set the importance.
zonecfg:my-zone:dedicated-cpu> set importance=10
The default is 1.

End the specification.
zonecfg:my-zone:dedicated-cpu> end

Revise the default set of privileges.
zonecfg:my-zone> set limitpriv=”default,sys_time”

This line adds the ability to set the system clock to the default set of privileges.
Set the scheduling class to FSS.
zonecfg:my-zone> set scheduling-class=FSS

Add a memory cap.
zonecfg:my-zone> add capped-memory

Set the memory cap.
zonecfg:my-zone:capped-memory> set physical=50m

Set the swap memory cap.
zonecfg:my-zone:capped-memory> set swap=100m

Set the locked memory cap.
zonecfg:my-zone:capped-memory> set locked=30m

End the memory cap specification.
zonecfg:my-zone:capped-memory> end

Add a file system.
zonecfg:my-zone> add fs

Set the mount point for the file system, /usr/local in this procedure.
zonecfg:my-zone:fs> set dir=/usr/local

Specify that /opt/zones/my-zone/local in the global zone is to be mounted as /usr/local in the zone being configured.
zonecfg:my-zone:fs> set special=/opt/zones/my-zone/local

In the non-global zone, the /usr/local file system will be readable and writable.
Specify the file system type, lofs in this procedure.
zonecfg:my-zone:fs> set type=lofs

The type indicates how the kernel interacts with the file system.

End the file system specification.
zonecfg:my-zone:fs> end
This step can be performed more than once to add more than one file system.
(Optional) Set the hostid.
zonecfg:my-zone> set hostid=80f0c086

Add a ZFS dataset named sales in the storage pool tank.
zonecfg:my-zone> add dataset

Specify the path to the ZFS dataset sales.
zonecfg:my-zone> set name=tank/sales

End the dataset specification.
zonecfg:my-zone> end

(Sparse Root Zone Only) Add a shared file system that is loopback-mounted from the global zone.

Do not perform this step to create a whole root zone, which does not have any shared file systems. See the discussion for whole root zones in Disk Space Requirements.
zonecfg:my-zone> add inherit-pkg-dir

Specify that /opt/sfw in the global zone is to be mounted in read-only mode in the zone being configured.
zonecfg:my-zone:inherit-pkg-dir> set dir=/opt/sfw
Note – The zone’s packaging database is updated to reflect the packages. These resources cannot be modified or removed after the zone has been installed using zoneadm.

End the inherit-pkg-dir specification.
zonecfg:my-zone:inherit-pkg-dir> end

This step can be performed more than once to add more than one shared file system.

Note –If you want to create a whole root zone but default shared file systems resources have been added by using inherit-pkg-dir, you must remove these default inherit-pkg-dir resources using zonecfg before you install the zone:
zonecfg:my-zone> remove inherit-pkg-dir dir=/lib
zonecfg:my-zone> remove inherit-pkg-dir dir=/platform
zonecfg:my-zone> remove inherit-pkg-dir dir=/sbin
zonecfg:my-zone> remove inherit-pkg-dir dir=/usr
(Optional) If you are creating an exclusive-IP zone, set the ip-type.
zonecfg:my-zone> set ip-type=exclusive

Note –Only the physical device type will be specified in the add net step.

Add a network interface.
zonecfg:my-zone> add net

(shared-IP only) Set the IP address for the network interface, in this procedure.
zonecfg:my-zone:net> set address=

Set the physical device type for the network interface, the hme device in this procedure.
zonecfg:my-zone:net> set physical=hme0

Solaris 10 10/08: (Optional, shared-IP only) Set the default router for the network interface, in this procedure.
zonecfg:my-zone:net> set defrouter=

End the specification.
zonecfg:my-zone:net> end

This step can be performed more than once to add more than one network interface.

Add a device.
zonecfg:my-zone> add device
Set the device match, /dev/sound/* in this procedure.
zonecfg:my-zone:device> set match=/dev/sound/*
End the device specification.
zonecfg:my-zone:device> end
This step can be performed more than once to add more than one device.

Add a zone-wide resource control by using the property name.
zonecfg:my-zone> set max-sem-ids=10485200
This step can be performed more than once to add more than one resource control.

Add a comment by using the attr resource type.
zonecfg:my-zone> add attr
Set the name to comment.
zonecfg:my-zone:attr> set name=comment
Set the type to string.
zonecfg:my-zone:attr> set type=string
Set the value to a comment that describes the zone.
zonecfg:my-zone:attr> set value=”This is my work zone.”
End the attr resource type specification.
zonecfg:my-zone:attr> end

Verify the zone configuration for the zone.
zonecfg:my-zone> verify

Commit the zone configuration for the zone.
zonecfg:my-zone> commit
Exit the zonecfg command.
zonecfg:my-zone> exit
Note that even if you did not explicitly type commit at the prompt, a commit is automatically attempted when you type exit or an EOF occurs.

Using Multiple Subcommands From the Command Line
Tip –The zonecfg command also supports multiple subcommands, quoted and separated by semicolons, from the same shell invocation.
global# zonecfg -z my-zone “create ; set zonepath=/export/home/my-zone”


The zoneadm command described in Part II, Zones and in the zoneadm(1M) man page is the primary tool used to install and administer non-global zones. Operations using the zoneadm command must be run from the global zone on the target system.

In addition to unpacking files from the archive, the install process performs checks, required postprocessing, and other functions to ensure that the zone is optimized to run on the host.

You can use an image of a Solaris system that has been fully configured with all of the software that will be run in the zone. See Creating the Image Used to Directly Migrate A Solaris System Into a Zone.

If you created a Solaris system archive from an existing system and use the -p (preserve sysidcfg) option when you install the zone, the zone will have the same identity as the system used to create the image.

If you use the -u (sys-unconfig) option when you install the zone on the target, the zone produced will not have a hostname or name service configured.

Caution –
You must specify either the -p option or the -u option, or an error results.

Installer options and description

-a archive

Location of archive from which to copy system image. Full flash archive and  cpio, gzip compressed cpio, bzip compressed cpio, and level 0 ufsdump are    supported. Refer to the gzip man page available in the SUNWsfman              package.

-d path

Location of directory from which to copy system image.

-d —

Use the -d option with the dash parameter to direct that the existing directory layout be used in the zonepath. Thus, if the administrator manually sets up the zonepath directory before the installation, the -d — option can be used to indicate that the directory already exists.

-p Preserve system identity.

-s Install silently.

-u sys-unconfig the zone.

-v Verbose output.

-b patchid

One or more -b options can be used to specify a patch ID for a patch installed in the system image. These patches will be backed out during the installation process.

The -a and -d options are mutually exclusive. The -p, -s, -u and -v options are only allowed when either -a or -d is provided.

Become superuser, or assume the Primary Administrator role.

Install the configured zone s-zone by using the zoneadm command with the install -a option and the path to the archive.
global# zoneadm -z s-zone install -u -a /net/machine_name/s-system.flar

You will see various messages as the installation completes. This can take some time.

When the installation completes, use the list subcommand with the -i and -v options to list the installed zones and verify the status.

If an installation fails, review the log file. On success, the log file is in /var/log inside the zone. On failure, the log file is in /var/tmp in the global zone.

If a zone installation is interrupted or fails, the zone is left in the incomplete state. Use uninstall -F to reset the zone to the configured state.

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

If the -u option was used, you must also zlogin to the zone console and perform system configuration as described in Performing the Initial Internal Zone Configuration.

Become superuser, or assume the Primary Administrator role.

Use the zoneadm command with the -z option, the name of the zone, which is s-zone, and the boot subcommand to boot the zone.
global# zoneadm -z s-zone boot

When the boot completes, use the list subcommand with the -v option to verify the status.
global# zoneadm list -v


Leave a Reply

Your email address will not be published. Required fields are marked *