How to Migrate a Kernel Zone by Using Warm Migration

  1. Become an administrator who is assigned rights to migrate kernel zones.
  2. Ensure that the kernel zone to be migrated has a suspend resource with shared storage configured.

    Output is similar to the following:

    source-host$ zonecfg -z kzone info suspend
    suspend:
             storage: iscsi://system/luname.naa.501337600144f0dbf8af1900

    The target host must have access to this location using the same URI. If the suspend resource is not configured, see Configuring the suspend Resource Type.

  3. On the global zone of the source host, suspend the kernel zone to be migrated.
    source-host$ zoneadm -z kzone suspend

    Note:

    The suspend process can be time-consuming, as it writes the zone state including memory to disk.
  4. Perform a dry run of the migration and verify that shared storage is accessible.

    Output is similar to the following:

    source-host$ zoneadm -z kzone migrate -n ssh://user@target-host
    zoneadm: zone 'kzone': Importing zone configuration.
    zoneadm: zone 'kzone': Attaching zone.
    zoneadm: zone 'kzone': Dry-run migration successful.
    zoneadm: zone 'kzone': Cleaning up.

    If the dry run reveals problems with the shared storage accessibility, correct them before proceeding. See Chapter 13, Oracle Solaris Zones on Shared Storage in Creating and Using Oracle Solaris Zones.

  5. Migrate the zone to the target host.

    This step configures a zone on the target host system using the same zone configuration on the source host, and attaches the zone on the target host.

    source-host$ zoneadm -z kzone migrate rad-uri:user@target-host
    • Use ssh to migrate:

      source-host$ zoneadm -z kzone migrate ssh://root@target-host
      zoneadm: zone 'kzone': Importing zone configuration.
      zoneadm: zone 'kzone': Attaching zone.
      zoneadm: zone 'kzone': Migration successful.
    • Use rads to migrate:

      source-host$ zoneadm -z kzone migrate rads://root@target-host:12302
  6. Boot the kernel zone on the new host to resume the migrated zone.
    target-host$ zoneadm -z kzone boot

Example 5-13 Failed Configuration Check on Warm Migration

This example shows a migration attempt with the suspend resource on a local path.

global3$ zoneadm -z z1kz migrate ssh://global5
zoneadm: zone 'z1kz': configuration check failed: suspend path resource must be an NFS path 

Example 5-14 Suspending the Kernel Zone and Warm Migrating

This example shows the commands for displaying the suspend resource, suspending the zone, listing the zones to include the kernel zone auxiliary state which is suspended for z2kz, and then the successful migration of the suspended kernel zone. Issuing the uptime command on the migrated zone on the target host shows how long it has been running, which includes time since it was booted on the source host.

global3$ zonecfg -z z2kz info suspend
suspend:
         storage: iscsi://system/luname.naa.501337600144f0dbf8af1900
global3$ zoneadm -z z2kz suspend

global3$ zoneadm list -cp
0:global:running:/::solaris:shared:-:none:
-:z2kz:installed:/system/volatile/zones/z2kz/zonepath:890d94b7-23c7-48c8-922e-ede10c3d1ac6:solaris-kz:excl:-:solaris-kz:suspended

global3$ zoneadm -z z2kz migrate ssh://global5 
zoneadm: zone 'z2kz': Importing zone configuration.
zoneadm: zone 'z2kz': Attaching zone.
zoneadm: zone 'z2kz': Migration successful.

global3$ ssh global5 zlogin z2kz uptime
12:02pm  up 2 day(s),  2:55,  0 users,  load average: 0.04, 0.04, 0.03