Go to main content

Creating and Using Oracle® Solaris Zones

Exit Print View

Updated: August 2019
 
 

How to Move a Zone to Different Shared Storage

Perform this procedure to move a zone to different shared storage. The zone configuration remains otherwise the same.

Before You Begin

Ensure that the shared storage to move the zone to already exists and contains a zpool.

  1. Become a zone administrator.

    For more information, see Using Rights Profiles to Install and Manage Zones.

  2. Verify that the zone is in the installed state.
    global$ pfbash zoneadm list -cv
      ID NAME             STATUS      PATH                      BRAND    IP
       0 global           running     /                         solaris  shared
       - zonename         installed  /system/zones/zonename    solaris  excl
  3. If the zone you want to move is in the running state, halt the zone.

    After the zone is halted, verify that it is now in the installed state.

    global$ zoneadm -z zonename halt
    global$ zoneadm list -cv
  4. Change the location of the shared storage that the zone uses.
    global$ zoneadm -z zonename move -p URI [-p URI ...] \
    -x remove-rootzpool [-x extended-option ...]
    
    -p URI

    Specifies a storage URI. Use a separate –p option for each additional URI to specify. For more information about storage URIs, see the suri(7) man page.

    -x {remove-rootzpool | force-zpool-destroy=rpool | force-storage-destroy-all}

    Specifies extended options to process the rootzpool resource of the zone after moving the zone out of shared storage. The –x option can take only one extended option per operation, but you can specify more than –x option in a single command.

    remove-rootzpool

    Required to move a zone from shared storage. Specifies removing the rootzpool resource from the zone configuration.

    force-zpool-destroy=rpool

    Specifies exporting the ZFS storage pool that is specified by the rootzpool resource.

    force-storage-destroy-all

    Specifies destroying the storage objects in the ZFS storage pool that is specified by the rootzpool resource.