Go to main content

Creating and Using Oracle® Solaris Kernel Zones

Exit Print View

Updated: August 2019
 
 

Using Cold Migration to Migrate a Kernel Zone

In a cold migration, a non-running zone is detached, and attached on another host where you can reboot it.

For more information about cold migration, see About Kernel Zone Migration and Determining a Migration Method to Use.

How to Migrate a Kernel Zone Using Cold Migration

Before You Begin

Ensure that the source and target hosts meet requirements described in Kernel Zone Migration Requirements.

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

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

  2. If the zone to migrate is running, shut it down.
    source-host$ zoneadm -z kzone shutdown
  3. (Optional) Verify that the state is installed.

    Output is similar to the following:

    source-host$ zoneadm -z kzone list -v
      ID NAME             STATUS      PATH      BRAND            IP
       - kzone           installed    -        solaris-kz       excl
  4. (Optional) If you plan to use the ssh:// URI to connect to the target host, test SSH promptless authentication.

    Execute a command such as date through ssh on the target host.

    source-host$ ssh target-host date
    Tue Oct  4 17:07:55 MDT 2016

    If you are prompted for a password, you have not configured your key pairs to enable login without interactive authentication.

    See How to Generate a Public/Private Key Pair for Use With Secure Shell in Managing Secure Shell Access in Oracle Solaris 11.4.

  5. (Optional) Perform a dry run of the migration to verify that conditions are set appropriately.

    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.
  6. Perform the migration.

    Output is similar to the following:

    source-host$ zoneadm -z kzone migrate ssh://user@target-host
    zoneadm: zone 'kzone': Importing zone configuration.
    zoneadm: zone 'kzone': Attaching zone.
    zoneadm: zone 'kzone': Migration successful.
  7. (Optional) Boot the zone on the target host.
    target-host$ zoneadm -z kzone boot
Example 41  Dry Run Fails for Cold Migration Due to Local Storage

The following example shows verification that a kernel zone is not running, and then a cold migration dry run that fails because of local storage being used in the kernel zone z3kz.

root@global3 $ zoneadm list -cv
  ID NAME             STATUS      PATH                         BRAND      IP
   0 global           running     /                            solaris    shared
   - z3kz             installed   -                            solaris-kz excl
root@global3 $ zoneadm -z z3kz migrate -n ssh://global5 
zoneadm: zone 'z3kz': configuration check failed: The storage property
dev:/dev/zvol/dsk/rpool/VARSHARE/zones/z3kz/disk0  is not a shared storage URI.
Example 42  Successful Cold Migration After Configuration Change

The following example shows removal of a non-booting local storage device from the zone configuration for zone z3kz, and then a successful migration. The zone configuration that is used comes from the migrating zone and is imported on the target host.

root@global3 $ zonecfg -z z3kz 'remove device id=1;commit;exit' 
root@global3 $ zoneadm -z z3kz migrate ssh://global5 
zoneadm: zone 'z3kz': Importing zone configuration.
zoneadm: zone 'z3kz': Attaching zone.
zoneadm: zone 'z3kz': Migration successful.

See Also

If you are migrating to an earlier version of Oracle Solaris, see Example 9, Clearing the pagesize-policy Property Before Migrating a Kernel Zone to an Earlier Oracle Solaris Release.