sun.com docs.sun.com My Sun Worldwide Sites

Previous Previous     Contents     Index     Next Next

Chapter 23

Moving and Migrating Non-Global Zones (Tasks)

This chapter describes how to:

  • Move an existing non-global zone to a new location on the same machine

  • Validate what will happen in a non-global zone migration before the actual migration is performed.

  • Migrate an existing non-global zone to a new machine

For information on moving and migrating lx branded zones, see Chapter 35, Moving and Migrating lx Branded Zones (Tasks).

Moving a Non-Global Zone

This procedure is used to move the zone to a new location on the same system by changing the zonepath. The zone must be halted. The new zonepath must be on a local file system. The normal zonepath criteria described in Resource and Property Types apply.

ProcedureHow to Move a Zone

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

  1. 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.

  2. Halt the zone to be moved, db-zone in this procedure.

    global# zoneadm -z db-zone halt

  3. Use the zoneadm command with the move subcommand to move the zone to a new zonepath, /export/zones/db-zone.

    global# zoneadm -z db-zone move /export/zones/db-zone

  4. Verify the path.

    ID  NAME     STATUS       PATH                           BRAND 
     0  global   running      /                              native
     -  my-zone  installed    /export/home/my-zone           native
     -  db-zone  installed    /export/zones/db-zone          native

Migrating a Non-Global Zone to a Different Machine

Note that you can do a trial run of a zone migration before you actually move the zone to a different machine. For more information, see About Validating a Zone Migration Before the Migration Is Performed.

About Migrating a Zone

The zonecfg and zoneadm commands can be used to migrate an existing non-global zone from one system to another. The zone is halted and detached from its current host. The zonepath is moved to the target host, where it is attached.

The following requirements apply to zone migration:

  • The global zone on the target system must be running the same Solaris release as the original host.

  • To ensure that the zone will run properly, the target system must have the same versions of the following required operating system packages and patches as those installed on the original host.

    • Packages that deliver files under an inherit-pkg-dir resource

    • Packages where SUNW_PKG_ALLZONES=true

    Other packages and patches, such as those for third-party products, can be different.

  • The host and target systems must have the same machine architecture.

To verify the Solaris release and the machine architecture, type:

uname -m

The zoneadm detach process creates the information necessary to attach the zone on a different system. The zoneadm attach process verifies that the target machine has the correct configuration to host the zone. Because there are several ways to make the zonepath available on the new host, the actual movement of the zonepath from one system to another is a manual process that is performed by the global administrator.

When attached to the new system, the zone is in the installed state.

ProcedureHow to Migrate A Non-Global Zone

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

  1. 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.

  2. Halt the zone to be migrated, my-zone in this procedure.

    host1# zoneadm -z my-zone halt

  3. Detach the zone.

    host1# zoneadm -z my-zone detach

    The detached zone is now in the configured state.

  4. Move the zonepath for my-zone to the new host.

    See How to Move the zonepath to a new Host for more information.

  5. On the new host, configure the zone.

    host2# zonecfg -z my-zone

    You will see the following system message:

    my-zone: No such zone configured
    Use 'create' to begin configuring a new zone.

  6. To create the zone my-zone on the new host, use the zonecfg command with the -a option and the zonepath on the new host.

    zonecfg:my-zone> create -a /export/zones/my-zone

  7. (Optional) View the configuration.

    zonecfg:my-zone> info
    zonename: my-zone
    zonepath: /export/zones/my-zone
    autoboot: false
    pool:
    inherit-pkg-dir:
             dir: /lib
    inherit-pkg-dir:
             dir: /platform
    inherit-pkg-dir:
             dir: /sbin
    inherit-pkg-dir:
             dir: /usr
    net:
             address: 192.168.0.90
             physical: bge0

  8. (Optional) Make any required adjustments to the configuration.

    For example, the network physical device might be different on the new host, or devices that are part of the configuration might have different names on the new host.

    zonecfg:my-zone> select net physical=bge0
    zonecfg:my-zone:net> set physical=e1000g0
    zonecfg:my-zone:net> end

  9. Commit the configuration and exit.

    zonecfg:my-zone> commit
    zonecfg:my-zone> exit

  10. Attach the zone on the new host.

    • Attach the zone with a validation check.

      host2# zoneadm -z my-zone attach

      The system administrator is notified of required actions to be taken if either or both of the following conditions are present:

      • Required packages and patches are not present on the new machine.

      • The software levels are different between machines.

    • Force the attach operation without performing the validation.

      host2# zoneadm -z my-zone attach -F


      Caution Caution - The -F option allows you to force the attach with no validation performed. This is useful in certain cases, such as in a clustered environment or for backup and restore operations, but it does require that the system be properly configured to host the zone. An incorrect configuration could result in undefined behavior later.


Previous Previous     Contents     Index     Next Next
Company Info Contact Terms of Use Privacy Copyright 1994-2007 Sun Microsystems, Inc.