How to Add or Move a ZFS Storage Pool to an Installed Zone

Ensure that the ZFS storage pool to add or move is created.

Ensure that the storage URI is available on the host system. For more information, see Managing Storage URIs and Shared Storage Resources and the suriadm(8) man page.

Perform this procedure to do either of the following tasks:

  • Add an existing ZFS storage pool to an installed zone.

  • Migrate a ZFS storage pool from one installed zone to another.

  1. Assume the root role.
  2. Shut down the zone.
    global$ pfbash zoneadm -z zonename shutdown
  3. Detach the zone.
    global$ zoneadm -z zonename detach

    The zone moves to the configured state.

  4. Add a new zpool resource and corresponding shared storage resources to the zone configuration.
    global$ zonecfg -z zonename
    zonecfg:zonename> add zpool
    zonecfg:zonename:zpool> add storage URI-string
    zonecfg:zonename:zpool> set name=name-string
    zonecfg:zonename:zpool> end
  5. Reattach the zone.
    global$ zoneadm -z zonename attach

    The Zones framework configures the shared storage resources, imports the existing ZFS storage pool, and assigns it to the installed zone. The zone moves to the installed state.

  6. Boot the zone.
    global$ zoneadm -z zonename boot

    The zone moves to the running state.