Oracle Solaris ZFS Administration Guide

Using Oracle Solaris Live Upgrade to Migrate or Upgrade a System With Zones (at Least Solaris 10 5/09)

You can use the Oracle Solaris Live Upgrade feature to migrate or upgrade a system with zones starting in the Solaris 10 10/08 release. Additional sparse—root and whole—root zone configurations are supported by Live Upgrade starting in the Solaris 10 5/09 release.

This section describes how to configure a system with zones so that it can be upgraded and patched with Oracle Solaris Live Upgrade starting in the Solaris 10 5/09 release. If you are migrating to a ZFS root file system without zones, see Using Oracle Solaris Live Upgrade to Migrate to a ZFS Root File System (Without Zones).

Consider the following points when using Oracle Solaris Live Upgrade with ZFS and zones starting in at least the Solaris 10 5/09 release:

If you are migrating or configuring a system with zones starting in the Solaris 10 5/09 release, review the following information:

Supported ZFS with Zone Root Configuration Information (at Least Solaris 10 5/09)

Review the supported zone configurations before using Oracle Solaris Live Upgrade to migrate or upgrade a system with zones.

ProcedureHow to Create a ZFS BE With a ZFS Root File System and a Zone Root (at Least Solaris 10 5/09)

Use this procedure after you have performed an initial installation of at least the Solaris 10 5/09 release to create a ZFS root file system. Also use this procedure after you have used the luupgrade feature to upgrade a ZFS root file system to at least the Solaris 10 5/09 release. A ZFS BE that is created using this procedure can then be upgraded or patched.

In the steps that follow, the example Oracle Solaris 10 9/10 system has a ZFS root file system and a zone root dataset in /rpool/zones. A ZFS BE named zfs2BE is created and can then be upgraded or patched.

  1. Review the existing ZFS file systems.


    # zfs list
    NAME                   USED  AVAIL  REFER  MOUNTPOINT
    rpool                 7.26G  59.7G    98K  /rpool
    rpool/ROOT            4.64G  59.7G    21K  legacy
    rpool/ROOT/zfsBE      4.64G  59.7G  4.64G  /
    rpool/dump            1.00G  59.7G  1.00G  -
    rpool/export            44K  59.7G    23K  /export
    rpool/export/home       21K  59.7G    21K  /export/home
    rpool/swap               1G  60.7G    16K  -
    rpool/zones            633M  59.7G   633M  /rpool/zones
  2. Ensure that the zones are installed and booted.


    # zoneadm list -cv
      ID NAME             STATUS     PATH                           BRAND    IP    
       0 global           running    /                              native   shared
       2 zfszone          running    /rpool/zones                   native   shared
  3. Create the ZFS BE.


    # lucreate -n zfs2BE
    Analyzing system configuration.
    No name for current boot environment.
    INFORMATION: The current boot environment is not named - assigning name <zfsBE>.
    Current boot environment is named <zfsBE>.
    Creating initial configuration for primary boot environment <zfsBE>.
    The device </dev/dsk/c1t0d0s0> is not a root device for any boot environment; cannot get BE ID.
    PBE configuration successful: PBE name <zfsBE> PBE Boot Device </dev/dsk/c1t0d0s0>.
    Comparing source boot environment <zfsBE> file systems with the file 
    system(s) you specified for the new boot environment. Determining which 
    file systems should be in the new boot environment.
    Updating boot environment description database on all BEs.
    Updating system configuration files.
    Creating configuration for boot environment <zfs2BE>.
    Source boot environment is <zfsBE>.
    Creating boot environment <zfs2BE>.
    Cloning file systems from boot environment <zfsBE> to create boot environment <zfs2BE>.
    Creating snapshot for <rpool/ROOT/zfsBE> on <rpool/ROOT/zfsBE@zfs2BE>.
    Creating clone for <rpool/ROOT/zfsBE@zfs2BE> on <rpool/ROOT/zfs2BE>.
    Setting canmount=noauto for </> in zone <global> on <rpool/ROOT/zfs2BE>.
    Population of boot environment <zfs2BE> successful.
    Creation of boot environment <zfs2BE> successful.
  4. Activate the ZFS BE.


    # lustatus
    Boot Environment           Is       Active Active    Can    Copy      
    Name                       Complete Now    On Reboot Delete Status    
    -------------------------- -------- ------ --------- ------ ----------
    zfsBE                      yes      yes    yes       no     -         
    zfs2BE                     yes      no     no        yes    -         
    # luactivate zfs2BE
    A Live Upgrade Sync operation will be performed on startup of boot environment <zfs2BE>.
    .
    .
    .
    # init 6
    
  5. Confirm that the ZFS file systems and zones are created in the new BE.


    # zfs list
    NAME                               USED  AVAIL  REFER  MOUNTPOINT
    rpool                             7.38G  59.6G    98K  /rpool
    rpool/ROOT                        4.72G  59.6G    21K  legacy
    rpool/ROOT/zfs2BE                 4.72G  59.6G  4.64G  /
    rpool/ROOT/zfs2BE@zfs2BE          74.0M      -  4.64G  -
    rpool/ROOT/zfsBE                  5.45M  59.6G  4.64G  /.alt.zfsBE
    rpool/dump                        1.00G  59.6G  1.00G  -
    rpool/export                        44K  59.6G    23K  /export
    rpool/export/home                   21K  59.6G    21K  /export/home
    rpool/swap                           1G  60.6G    16K  -
    rpool/zones                       17.2M  59.6G   633M  /rpool/zones
    rpool/zones-zfsBE                  653M  59.6G   633M  /rpool/zones-zfsBE
    rpool/zones-zfsBE@zfs2BE          19.9M      -   633M  -
    # zoneadm list -cv
      ID NAME             STATUS     PATH                           BRAND    IP    
       0 global           running    /                              native   shared
       - zfszone          installed  /rpool/zones                   native   shared

ProcedureHow to Upgrade or Patch a ZFS Root File System With Zone Roots (at Least Solaris 10 5/09)

Use this procedure when you need to upgrade or patch a ZFS root file system with zone roots in at least the Solaris 10 5/09 release. These updates can either be a system upgrade or the application of patches.

In the steps that follow, zfs2BE, is the example name of the boot environment that is upgraded or patched.

  1. Review the existing ZFS file systems.


    # zfs list
    NAME                               USED  AVAIL  REFER  MOUNTPOINT
    rpool                             7.38G  59.6G   100K  /rpool
    rpool/ROOT                        4.72G  59.6G    21K  legacy
    rpool/ROOT/zfs2BE                 4.72G  59.6G  4.64G  /
    rpool/ROOT/zfs2BE@zfs2BE          75.0M      -  4.64G  -
    rpool/ROOT/zfsBE                  5.46M  59.6G  4.64G  /
    rpool/dump                        1.00G  59.6G  1.00G  -
    rpool/export                        44K  59.6G    23K  /export
    rpool/export/home                   21K  59.6G    21K  /export/home
    rpool/swap                           1G  60.6G    16K  -
    rpool/zones                       22.9M  59.6G   637M  /rpool/zones
    rpool/zones-zfsBE                  653M  59.6G   633M  /rpool/zones-zfsBE
    rpool/zones-zfsBE@zfs2BE          20.0M      -   633M  -
  2. Ensure that the zones are installed and booted.


    # zoneadm list -cv
      ID NAME             STATUS     PATH                           BRAND    IP    
       0 global           running    /                              native   shared
       5 zfszone          running    /rpool/zones                   native   shared
  3. Create the ZFS BE to upgrade or patch.


    # lucreate -n zfs2BE
    Analyzing system configuration.
    Comparing source boot environment <zfsBE> file systems with the file 
    system(s) you specified for the new boot environment. Determining which 
    file systems should be in the new boot environment.
    Updating boot environment description database on all BEs.
    Updating system configuration files.
    Creating configuration for boot environment <zfs2BE>.
    Source boot environment is <zfsBE>.
    Creating boot environment <zfs2BE>.
    Cloning file systems from boot environment <zfsBE> to create boot environment <zfs2BE>.
    Creating snapshot for <rpool/ROOT/zfsBE> on <rpool/ROOT/zfsBE@zfs2BE>.
    Creating clone for <rpool/ROOT/zfsBE@zfs2BE> on <rpool/ROOT/zfs2BE>.
    Setting canmount=noauto for </> in zone <global> on <rpool/ROOT/zfs2BE>.
    Creating snapshot for <rpool/zones> on <rpool/zones@zfs10092BE>.
    Creating clone for <rpool/zones@zfs2BE> on <rpool/zones-zfs2BE>.
    Population of boot environment <zfs2BE> successful.
    Creation of boot environment <zfs2BE> successful.
  4. Select one of the following to upgrade the system or apply patches to the new boot environment:

    • Upgrade the system.


      # luupgrade -u -n zfs2BE -s /net/install/export/s10up/latest
      

      where the -s option specifies the location of the Solaris installation medium.

      This process can take a very long time.

      For a complete example of the luupgrade process, see Example 5–6.

    • Apply patches to the new boot environment.


      # luupgrade -t -n zfs2BE -t -s /patchdir patch-id-02 patch-id-04
      
  5. Activate the new boot environment.


    # lustatus
    Boot Environment           Is       Active Active    Can    Copy      
    Name                       Complete Now    On Reboot Delete Status    
    -------------------------- -------- ------ --------- ------ ----------
    zfsBE                      yes      yes    yes       no     -         
    zfs2BE                     yes      no     no        yes    -    
    # luactivate zfs2BE
    A Live Upgrade Sync operation will be performed on startup of boot environment <zfs2BE>.
    .
    .
    .
  6. Boot from the newly activated boot environment.


    # init 6
    

Example 5–6 Upgrading a ZFS Root File System With a Zone Root to a Oracle Solaris 10 9/10 ZFS Root File System

In this example, a ZFS BE (zfsBE), which was created on a Solaris 10 10/09 system with a ZFS root file system and zone root in a non root pool, is upgraded to the Oracle Solaris 10 9/10 release. This process can take a long time. Then, the upgraded BE (zfs2BE) is activated. Ensure that the zones are installed and booted before attempting the upgrade.

In this example, the zonepool pool, the /zonepool/zones dataset, and the zfszone zone are created as follows:


# zpool create zonepool mirror c2t1d0 c2t5d0
# zfs create zonepool/zones
# chmod 700 zonepool/zones
# zonecfg -z zfszone
zfszone: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zfszone> create
zonecfg:zfszone> set zonepath=/zonepool/zones
zonecfg:zfszone> verify
zonecfg:zfszone> exit
# zoneadm -z zfszone install
cannot create ZFS dataset zonepool/zones: dataset already exists
Preparing to install zone <zfszone>.
Creating list of files to copy from the global zone.
Copying <8960> files to the zone.
.
.
.

# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP    
   0 global           running    /                              native   shared
   2 zfszone          running    /zonepool/zones                native   shared

# lucreate -n zfsBE
.
.
.
# luupgrade -u -n zfsBE -s /net/install/export/s10up/latest
40410 blocks
miniroot filesystem is <lofs>
Mounting miniroot at </net/system/export/s10up/latest/Solaris_10/Tools/Boot>
Validating the contents of the media </net/system/export/s10up/latest>.
The media is a standard Solaris media.
The media contains an operating system upgrade image.
The media contains <Solaris> version <10>.
Constructing upgrade profile to use.
Locating the operating system upgrade program.
Checking for existence of previously scheduled Live Upgrade requests.
Creating upgrade profile for BE <zfsBE>.
Determining packages to install or upgrade for BE <zfsBE>.
Performing the operating system upgrade of the BE <zfsBE>.
CAUTION: Interrupting this process may leave the boot environment unstable 
or unbootable.
Upgrading Solaris: 100% completed
Installation of the packages from this media is complete.
Updating package information on boot environment <zfsBE>.
Package information successfully updated on boot environment <zfsBE>.
Adding operating system patches to the BE <zfsBE>.
The operating system patch installation is complete.
INFORMATION: The file </var/sadm/system/logs/upgrade_log> on boot 
environment <zfsBE> contains a log of the upgrade operation.
INFORMATION: The file </var/sadm/system/data/upgrade_cleanup> on boot 
environment <zfsBE> contains a log of cleanup operations required.
INFORMATION: Review the files listed above. Remember that all of the files 
are located on boot environment <zfsBE>. Before you activate boot 
environment <zfsBE>, determine if any additional system maintenance is 
required or if additional media of the software distribution must be 
installed.
The Solaris upgrade of the boot environment <zfsBE> is complete.
Installing failsafe
Failsafe install is complete.
# luactivate zfsBE
# init 6
# lustatus
Boot Environment           Is       Active Active    Can    Copy      
Name                       Complete Now    On Reboot Delete Status    
-------------------------- -------- ------ --------- ------ ----------
zfsBE                      yes      no     no        yes    -         
zfs2BE                     yes      yes    yes       no     -         
# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP    
   0 global           running    /                              native   shared
   - zfszone          installed  /zonepool/zones                native   shared

ProcedureHow to Migrate a UFS Root File System With a Zone Root to a ZFS Root File System (at Least Solaris 10 5/09)

Use this procedure to migrate a system with a UFS root file system and a zone root to at least the Solaris 10 5/09 release. Then, use Oracle Solaris Live Upgrade to create a ZFS BE.

In the steps that follow, the example UFS BE name is c0t1d0s0, the UFS zone root is zonepool/zfszone, and the ZFS root BE is zfsBE.

  1. Upgrade the system to at least the Solaris 10 5/09 release if it is running a previous Solaris 10 release.

    For information about upgrading a system that is running the Solaris 10 release, see Oracle Solaris 10 9/10 Installation Guide: Solaris Live Upgrade and Upgrade Planning.

  2. Create the root pool.

    For information about the root pool requirements, see Oracle Solaris Installation and Oracle Solaris Live Upgrade Requirements for ZFS Support.

  3. Confirm that the zones from the UFS environment are booted.


    # zoneadm list -cv
      ID NAME             STATUS     PATH                           BRAND    IP    
       0 global           running    /                              native   shared
       2 zfszone          running    /zonepool/zones                native   shared
  4. Create the new ZFS boot environment.


    # lucreate -c c1t1d0s0 -n zfsBE -p rpool
    

    This command establishes datasets in the root pool for the new boot environment and copies the current boot environment (including the zones) to those datasets.

  5. Activate the new ZFS boot environment.


    # lustatus
    Boot Environment           Is       Active Active    Can    Copy      
    Name                       Complete Now    On Reboot Delete Status    
    -------------------------- -------- ------ --------- ------ ----------
    c1t1d0s0                   yes      no     no        yes    -         
    zfsBE                      yes      yes    yes       no     -         #
    luactivate zfsBE       
    A Live Upgrade Sync operation will be performed on startup of boot environment <zfsBE>.
    .
    .
    .
  6. Reboot the system.


    # init 6
    
  7. Confirm that the ZFS file systems and zones are created in the new BE.


    # zfs list
    NAME                                USED  AVAIL  REFER  MOUNTPOINT
    rpool                              6.17G  60.8G    98K  /rpool
    rpool/ROOT                         4.67G  60.8G    21K  /rpool/ROOT
    rpool/ROOT/zfsBE                   4.67G  60.8G  4.67G  /
    rpool/dump                         1.00G  60.8G  1.00G  -
    rpool/swap                          517M  61.3G    16K  -
    zonepool                            634M  7.62G    24K  /zonepool
    zonepool/zones                      270K  7.62G   633M  /zonepool/zones
    zonepool/zones-c1t1d0s0             634M  7.62G   633M  /zonepool/zones-c1t1d0s0
    zonepool/zones-c1t1d0s0@zfsBE       262K      -   633M  -
    # zoneadm list -cv
      ID NAME             STATUS     PATH                           BRAND    IP    
       0 global           running    /                              native   shared
       - zfszone          installed  /zonepool/zones                native   shared

Example 5–7 Migrating a UFS Root File System With a Zone Root to a ZFS Root File System

In this example, a Oracle Solaris 10 9/10 system with a UFS root file system and a zone root (/uzone/ufszone), as well as a ZFS non-root pool (pool) and a zone root (/pool/zfszone), is migrated to a ZFS root file system. Ensure that the ZFS root pool is created and that the zones are installed and booted before attempting the migration.


# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP    
   0 global           running    /                              native   shared
   2 ufszone          running    /uzone/ufszone                 native   shared
   3 zfszone          running    /pool/zones/zfszone            native   shared

# lucreate -c ufsBE -n zfsBE -p rpool
Analyzing system configuration.
No name for current boot environment.
Current boot environment is named <zfsBE>.
Creating initial configuration for primary boot environment <zfsBE>.
The device </dev/dsk/c1t0d0s0> is not a root device for any boot environment; cannot get BE ID.
PBE configuration successful: PBE name <ufsBE> PBE Boot Device </dev/dsk/c1t0d0s0>.
Comparing source boot environment <ufsBE> file systems with the file 
system(s) you specified for the new boot environment. Determining which 
file systems should be in the new boot environment.
Updating boot environment description database on all BEs.
Updating system configuration files.
The device </dev/dsk/c1t1d0s0> is not a root device for any boot environment; cannot get BE ID.
Creating configuration for boot environment <zfsBE>.
Source boot environment is <ufsBE>.
Creating boot environment <zfsBE>.
Creating file systems on boot environment <zfsBE>.
Creating <zfs> file system for </> in zone <global> on <rpool/ROOT/zfsBE>.
Populating file systems on boot environment <zfsBE>.
Checking selection integrity.
Integrity check OK.
Populating contents of mount point </>.
Copying.
Creating shared file system mount points.
Copying root of zone <ufszone> to </.alt.tmp.b-EYd.mnt/uzone/ufszone>.
Creating snapshot for <pool/zones/zfszone> on <pool/zones/zfszone@zfsBE>.
Creating clone for <pool/zones/zfszone@zfsBE> on <pool/zones/zfszone-zfsBE>.
Creating compare databases for boot environment <zfsBE>.
Creating compare database for file system </rpool/ROOT>.
Creating compare database for file system </>.
Updating compare databases on boot environment <zfsBE>.
Making boot environment <zfsBE> bootable.
Creating boot_archive for /.alt.tmp.b-DLd.mnt
updating /.alt.tmp.b-DLd.mnt/platform/sun4u/boot_archive
Population of boot environment <zfsBE> successful.
Creation of boot environment <zfsBE> successful.
# lustatus
Boot Environment           Is       Active Active    Can    Copy      
Name                       Complete Now    On Reboot Delete Status    
-------------------------- -------- ------ --------- ------ ----------
ufsBE                      yes      yes    yes       no     -         
zfsBE                      yes      no     no        yes    -         
# luactivate zfsBE    
.
.
.
# init 6
.
.
.
# zfs list
NAME                                    USED  AVAIL  REFER  MOUNTPOINT
pool                                    628M  66.3G    19K  /pool
pool/zones                              628M  66.3G    20K  /pool/zones
pool/zones/zfszone                     75.5K  66.3G   627M  /pool/zones/zfszone
pool/zones/zfszone-ufsBE                628M  66.3G   627M  /pool/zones/zfszone-ufsBE
pool/zones/zfszone-ufsBE@zfsBE           98K      -   627M  -
rpool                                  7.76G  59.2G    95K  /rpool
rpool/ROOT                             5.25G  59.2G    18K  /rpool/ROOT
rpool/ROOT/zfsBE                       5.25G  59.2G  5.25G  /
rpool/dump                             2.00G  59.2G  2.00G  -
rpool/swap                              517M  59.7G    16K  -
# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP    
   0 global           running    /                              native   shared
   - ufszone          installed  /uzone/ufszone                 native   shared
   - zfszone          installed  /pool/zones/zfszone            native   shared