JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Administration: Oracle Solaris Zones, Oracle Solaris 10 Zones, and Resource Management     Oracle Solaris 11 Information Library
search filter icon
search icon

Document Information


Part I Oracle Solaris Resource Management

1.  Introduction to Resource Management

2.  Projects and Tasks (Overview)

3.  Administering Projects and Tasks

4.  Extended Accounting (Overview)

5.  Administering Extended Accounting (Tasks)

6.  Resource Controls (Overview)

7.  Administering Resource Controls (Tasks)

8.  Fair Share Scheduler (Overview)

9.  Administering the Fair Share Scheduler (Tasks)

10.  Physical Memory Control Using the Resource Capping Daemon (Overview)

11.  Administering the Resource Capping Daemon (Tasks)

12.  Resource Pools (Overview)

13.  Creating and Administering Resource Pools (Tasks)

14.  Resource Management Configuration Example

Part II Oracle Solaris Zones

15.  Introduction to Oracle Solaris Zones

16.  Non-Global Zone Configuration (Overview)

17.  Planning and Configuring Non-Global Zones (Tasks)

18.  About Installing, Shutting Down, Halting, Uninstalling, and Cloning Non-Global Zones (Overview)

19.  Installing, Booting, Shutting Down, Halting, Uninstalling, and Cloning Non-Global Zones (Tasks)

20.  Non-Global Zone Login (Overview)

21.  Logging In to Non-Global Zones (Tasks)

22.  About Zone Migrations and the zonep2vchk Tool

23.  Migrating Oracle Solaris Systems and Migrating Non-Global Zones (Tasks)

Migrating a Non-Global Zone to a Different Machine

About Migrating a Zone

How to Migrate A Non-Global Zone Using ZFS Archives

How to Move the zonepath to a new Host

Migrating a Zone From a Machine That Is not Usable

Migrating an Oracle Solaris System Into a Non-Global Zone

About Migrating an Oracle Solaris 11 System Into a solaris Non-Global Zone

Scanning the Source System With zonep2vchk

How To Create an Archive of the System Image on a Network Device

How to Configure the Zone on the Target System

Installing the Zone on the Target System

24.  About Automatic Installation and Packages on an Oracle Solaris 11 System With Zones Installed

25.  Oracle Solaris Zones Administration (Overview)

26.  Administering Oracle Solaris Zones (Tasks)

27.  Configuring and Administering Immutable Zones

28.  Troubleshooting Miscellaneous Oracle Solaris Zones Problems

Part III Oracle Solaris 10 Zones

29.  Introduction to Oracle Solaris 10 Zones

30.  Assessing an Oracle Solaris 10 System and Creating an Archive

31.  (Optional) Migrating an Oracle Solaris 10 native Non-Global Zone Into an Oracle Solaris 10 Zone

32.  Configuring the solaris10 Branded Zone

33.  Installing the solaris10 Branded Zone

34.  Booting a Zone, Logging in, and Zone Migration



Migrating a Non-Global Zone to a Different Machine

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

How to Migrate A Non-Global Zone Using ZFS Archives

You must be the global administrator or a user with appropriate authorizations in the global zone to perform this procedure.

This example describes how to create an archive of a zone and then attach that archive to another system. It assumes that the administrator on the source and target hosts are able to access a shared NFS server for temporary file storage. In the event that shared temporary space is not available, other means, such as scp secure copy, a remote file copy program, can be used to copy the files between the source and target machines. The scp program requests passwords or passphrases if they are needed for authentication.

  1. Become an administrator.
  2. Shut down the zone to be migrated, my-zone in this procedure.
    host1# zoneadm -z my-zone shutdown
  3. (Optional) Detach the zone.
    host1# zoneadm -z my-zone detach

    The detached zone is now in the configured state. The zone will not automatically boot when the global zone next boots.

  4. Export the zone configuration.
    host1# mkdir /net/server/zonearchives/my-zone
    host1# zonecfg -z my-zone export > /net/nserver/zonearchives/my-zone/my-zone.zonecfg
  5. Create a gzip ZFS archive.
    host1# zfs list -H -o name /zones/my-zone
    host1# zfs snapshot -r rpool/zones/my-zone@v2v
    host1# zfs send -rc rpool/zones/my-zone@v2v | gzip > /net/server/zonearchives/my-zone/my-zone.zfs.gz

    Use of compression is optional, but it is generally faster because less I/O is performed while writing and subsequently reading the archive. For more information, see Oracle Solaris Administration: ZFS File Systems.

  6. On the new host, configure the zone.
    host2# zonecfg -z my-zone -f /net/server/zonearchives/my-zone/my-zone.zonecfg

    You will see the following system message:

    my-zone: No such zone configured
    Use 'create' to begin configuring a new zone.
  7. 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 /zones/my-zone
  8. (Optional) View the configuration.
    zonecfg:my-zone> info
    zonename: my-zone
    zonepath: /zones/my-zone
    autoboot: false
             physical: bge0
  9. Make any required adjustments to the configuration.

    For example, the network physical device is 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
  10. Commit the configuration and exit.
    zonecfg:my-zone> commit
    zonecfg:my-zone> exit
  11. Attach the zone to the new host by using one of the following methods.
    • Attach the zone without updating any software.
      host2# zoneadm -z my-zone attach -a /net/server/zonearchives/my-zone/my-zone.zfs.gz
    • Attach the zone, performing the minimum updates required to allow the attach to succeed:
      host2# zoneadm -z my-zone attach -u -a /net/server/zonearchives/my-zone/my-zone.zfs.gz
    • Attach the zone, updating all the software in the zone to the latest version that is compatible with the global zone.
      host2# zoneadm -z my-zone attach -U -a /net/server/zonearchives/my-zone/my-zone.zfs.gz

How to Move the zonepath to a new Host

There are many ways to create an archive of the zonepath. For example, you can use the zfs send, cpio, or pax commands described in the cpio(1), pax(1) and zfs(1M) man pages.

There are also several ways to transfer the archive to the new host. The mechanism used to transfer the zonepath from the source host to the target destination host depends on the local configuration. In some cases, such as a SAN, the zonepath data might not actually move. The SAN can simply be reconfigured to make the zonepath visible on the new host. In other cases, the zonepath might be written to tape, and the tape mailed to a new site.

For these reasons, this step is not automated. The system administrator must choose the most appropriate technique to move the zonepath to the new host.

  1. Become an administrator.
  2. Move the zonepath to the new host. You can use the method described in this procedure, or use another method of your choice.

Example 23-1 Archiving and Moving the zonepath Using the tar Command, and Attaching the Zone

  1. Create a tar file of the zonepath on host1 and transfer it to host2 by using the sftp command.

    host1# cd /zones
    host1# tar cf my-zone.tar my-zone
    host1# sftp host2
    Connecting to host2...
    sftp> cd /zones
    sftp> put my-zone.tar
    Uploading my-zone.tar to /zones/my-zone.tar
    sftp> quit
  2. On host2, attach the zone:

    host2# zoneadm -z my-zone attach -a /zones/my-zone.tar -u

For more information, see sftp(1) and tar(1).

Example 23-2 Archiving the zonepath Using cpio and Compressing the Archive Using gzip

This is an alternative to using the tar command as shown in Example 23-1.

host1# zoneadm -z my-zone halt
host1# find my-zone -print | cpio -oP@/ | gzip > my-zone.cpio.gz

Next Steps

If you have used the -a option instead of reconfiguring a SAN, then the zonepath data will still be visible on the source host even though the zone is now in the configured state. You can either manually remove the zonepath from the source host after you have finished moving the data to the new host, or you can reattach the zone to the source host and use the zoneadm uninstall command to remove the zonepath.