Go to main content

Creating and Using Oracle® Solaris Zones

Exit Print View

Updated: April 2019
 
 

Migrating Oracle Solaris Zones Hosted on Shared Storage Resources

Migration of zones hosted on shared storage using storage URIs in the zone configuration is a straightforward and simple process. The only commands required for this process are the zoneadm and zonecfg commands. No additional commands must be run to migrate zones with storage resources or ZFS storage pools.

Example 21  Migrating a Zone Based on iSCSI Shared Storage

This example shows the steps to migrate the zone based on iSCSI shared storage from its current host to a new host.

root@initiator:/# zoneadm list -cp
0:global:running:/::solaris:shared:-:none
-:iscsi:installed:/iscsi:a0a4ba0d-9d6d-cf2c-cc42-f123a5e3ee11:solaris:excl:-:

The first step is to detach the zone on the current host. The zone will move from the installed state into the configured state. All the ZFS storage pools will be exported and the shared storage resources will be unconfigured automatically.

root@initiator:/# zoneadm -z iscsi detach
Exported zone zpool: iscsi_rpool
Unconfigured zone storage resource(s) from:
        iscsi://target/luname.naa.600144F035FF8500000050C884E50001
Exported zone zpool: iscsi_data
Unconfigured zone storage resource(s) from:
        iscsi://target/luname.naa.600144F035FF8500000050C884E80002
        iscsi://target/luname.naa.600144F035FF8500000050C884EC0003

root@initiator:/# zoneadm list -cp
0:global:running:/::solaris:shared:-:none
-:iscsi:configured:/iscsi::solaris:excl:-:

The last step required on the current host is to export the zone configuration with zonecfg export, and transfer the resulting file onto the new host.

root@initiator:/# zonecfg -z iscsi export -f /export/iscsi.cfg

On the new host, instantiate the zone configuration first from the saved file using zonecfg. The zone will be in the configured zone state.

root@newhost:/# zonecfg -z iscsi -f /export/iscsi.cfg

root@newhost:/# zoneadm list -cp
0:global:running:/::solaris:shared:-:none
-:iscsi:configured:/iscsi::solaris:excl:-:

Then, attach the zone on the new host with zoneadm attach. The zone will move into the installed state. All shared storage resources will be configured and the corresponding ZFS storage pools will be imported automatically.

root@newhost:/# zoneadm -z iscsi attach
Configured zone storage resource(s) from:
       iscsi://target/luname.naa.600144F035FF8500000050C884E50001
Imported zone zpool: iscsi_rpool
Configured zone storage resource(s) from:
       iscsi://target/luname.naa.600144F035FF8500000050C884E80002
       iscsi://target/luname.naa.600144F035FF8500000050C884EC0003
Imported zone zpool: iscsi_data
Progress being logged to /var/log/zones/zoneadm.20130214T145001Z.iscsi.attach
    Installing: Using existing zone boot environment
      Zone BE root dataset: iscsi_rpool/rpool/ROOT/solaris
                     Cache: Using /var/pkg/publisher.
  Updating non-global zone: Linking to image /.
Processing linked: 1/1 done
  Updating non-global zone: Auditing packages.
No updates necessary for this image.

  Updating non-global zone: Zone updated.
                    Result: Attach Succeeded.
Log saved in non-global zone as /iscsi/root/var/log/zones/zoneadm.20130214T145001Z.iscsi.attach

root@newhost:/# zoneadm list -cp
0:global:running:/::solaris:shared:-:none
-:iscsi:installed:/iscsi:a19fbb45-4af3-670f-c58e-ee48757c75d6:solaris:excl:-:

The zone has been migrated to the new host and is now ready to be booted with zoneadm boot.

This process is basically the same for the three different types of storage URIs supported in Oracle Solaris. For iSCSI-based or fibre channel-based storage resources, you must also confirm that the new host has access to the same logical unit and target ports.