Go to main content

Creating and Using Oracle® Solaris Kernel Zones

Exit Print View

Updated: August 2019
 
 

Using Live Migration to Migrate a Kernel Zone

Live migration enables you to migrate a kernel zone in the running state to a new kernel zone host. Because the memory state of a kernel zone is copied to the migrated zone, a live migration results in a brief outage time that is not noticeable to most applications or to most end users. Network connections are maintained.

You can use live migration for any applications that require a minimum of downtime and where applications must continue providing service without interruption.

How to Migrate a Kernel Zone By Using Live Migration

Before You Begin

  1. Become an administrator who is assigned rights to migrate kernel zones.

    For more information, see Rights Required to Perform Kernel Zone Migrations.

  2. On the source host, confirm that the zone to migrate is in the running state.
    source-host$ zoneadm list -cv
      ID NAME             STATUS      PATH      BRAND            IP
       0 global           running      /        solaris          shared
       1 kzone            running      -        solaris-kz       excl
  3. On the source host, initiate a dry run.

    This operation tests the kernel zone configuration before performing the live migration. Output is similar to the following:

    source-host$ zoneadm -z kzone migrate -n rad-uri:user@target-host
    zoneadm: zone 'kzone': Importing zone configuration.
    zoneadm: zone 'kzone': Attaching zone.
    zoneadm: zone 'kzone': Booting zone in 'migrating-in' mode.
    zoneadm: zone 'kzone': Checking migration compatibility.
    zoneadm: zone 'kzone': Cleaning up.
    zoneadm: zone 'kzone': Dry-run migration successful.
  4. Migrate the kernel zone.
    source-host$ zoneadm -z kzone migrate rad-uri:user@target-host
    zoneadm: zone 'kzone': Importing zone configuration.
    zoneadm: zone 'kzone': Attaching zone.
    zoneadm: zone 'kzone': Booting zone in 'migrating-in' mode.
    …
    zoneadm: zone 'kzone1': Halting and detaching zone on source host.
    zoneadm: zone 'kzone': Migration successful.
  5. Confirm that the zone has migrated on the target host.
    target-host:$ zoneadm list -cv
      ID NAME             STATUS      PATH        BRAND         IP
       0 global           running     /           solaris       shared
    1754 kzone            running     -           solaris-kz    excl
    …
Example 45  Using Live Migration to Migrate a Kernel Zone to a New Host

The following example demonstrates a live migration of the kernel zone kzone1 from the source host global to the target host global2. The configuration was created in advance on the target host.

global$ zoneadm -z kzone1 migrate ssh://global2
zoneadm: zone 'kzone1': Using zone configuration on destination.
zoneadm: zone 'kzone1': Attaching zone.
zoneadm: zone 'kzone1': Booting zone in 'migrating-in' mode.
zoneadm: zone 'kzone1': Checking migration compatibility.
zoneadm: zone 'kzone1': Starting migration.
zoneadm: zone 'kzone1': Waiting for migration to complete.
zoneadm: zone 'kzone1': Migration successful.
zoneadm: zone 'kzone1': Halting and detaching zone.
Example 46  Live Migration Dry Run Failure

This example demonstrates a failed dry-run migration between the source host global1 and the target host global2. The virtual-cpu resource is inconsistent between both hosts. See Oracle Solaris Zones Configuration Resources for further information about zone configuration.

global1$ zoneadm -z kzone1 migrate -n ssh://global2
zoneadm: zone 'kzone1': Using existing zone configuration on destination.
zoneadm: zone 'kzone1': Attaching zone.
zoneadm: zone 'kzone1': Booting zone in 'migrating-in' mode.
zoneadm: zone 'kzone1': boot failed:
zone 'kzone1': error: Suspended zone has 8 active VCPUs, more than the configured
zone 'kzone1': virtual-cpu maximum of 4.
zone 'kzone1': error: Correct errors, or delete the configuration, using zonecfg(8) on the
zone 'kzone1': destination host.
zoneadm: zone kzone1: call to zoneadmd(8) failed: zoneadmd(8) returned an error 9 (zone state change failed)
Example 47  Live Migration Between Hosts With Different anet Configurations

The following example demonstrates live migration between hosts with different anet configurations. See Oracle Solaris Zones Configuration Resources for additional information regarding anet resources.

The zone configuration is created on the target host and the anet resource is modified before the migration. A dry run is performed to test.

global1$ zonecfg -z kzone1 -r export | ssh root@global2 zonecfg -z kzone1 -f -
global1$ ssh root@global2 zonecfg -z kzone1 'select anet 0; set lower-link=net1;end'
global1$ zoneadm -z kzone1 migrate -n ssh://global2