This post illustrates upgrading a Solaris
machine to a later release using Live upgrade (no downtime required). Live
upgrade makes a copy of the critical file systems (root, opt etc), and places
it on a defined slice on your disk. The next step is to upgrade that new
secondary environment, activate it and reboot to that new environment. The aim
of live upgrade is to reduce downtime as much as possible (requiring one simple
reboot).
Pre-requisites
Non-Global zones on machine are fully configured
and functional
Define and choose a slice that has an efficient
amount of memory (approximately enough to hold multiple file-systems, for a
better estimate, perform a “df- h” on the primary environment to get an idea of
how much storage you will need on your defined slice
Place your new release/OS image in a suitable
directory on your primary environmen
Optional – backup
Create a auto registration file (using vi or
another editor) on your primary environment, this tags the machine to your my
oracle support account, the config file should contain the following
attributes:
oracle_user=USERNAME
oracle_pw=PASSWORD
NOTE: http proxy
information can be inserted but this is optional (refer to appendix)
Make sure you have the following packages and
patches installed on the system you are performing live upgrade on
-
119254-82 (or higher)
-
121428-15 (or higher)
-
121430-74 (or higher)
Login to your My
Oracle Support portal and click Patches and Updates to obtain these packages
Procedure
(NOTE: MAKE SURE YOU TAKE INTO CONSIDERATION THE PRE-REQUISITES BEFORE
RUNNING THIS PROCEDURE)
Define a slice that has an efficient amount of memory and run this
command
# lucreate -n [solenv2] -m [MOUNTPOINT]:[TARGETSLICE]:[FILESYSTEMTYPE]
The environment name will be the name of the second environment you
are creating (solenv2 for e.g.).The default file system type is UFS. An example
of the target slice would be /dev/dsk/c0t1d0s5.
When Enter is pressed you will see progress output similar to below:
Determining types of file systems supported
Validating file system requests
Preparing logical storage devices
Preparing physical storage devices
Configuring physical storage devices
Configuring logical storage devices
Analyzing system configuration.
Updating boot environment description database
on all BEs.
Updating system configuration files.
The device </dev/dsk/c0t1d0s6> is not a
root device for any boot environment; ca
Creating configuration for boot environment
<solenv2>.
Source boot environment is <be0>.
Creating file systems on boot environment
<solenv2>.
Creating <ufs> file system for </>
in zone <global> on </dev/dsk/c0t1d0s6>.
Mounting file systems for boot environment
<solenv2>.
Calculating required sizes of file systems for
boot environment <solenv2>.
Populating file systems on boot environment
<solenv2>.
Analyzing zones.
Mounting ABE <solenv2>.
Cloning mountpoint directories.
Generating file list.
Copying data from PBE <be0> to ABE <solenv2>.
100% of filenames transferred
Finalizing ABE.
Fixing zonepaths in ABE.
Unmounting ABE <solenv2>.
Fixing properties on ZFS datasets in ABE.
Reverting state of zones in PBE <be0>.
Making boot environment <solenv2>
bootable.
WARNING: merged filesystem </opt> and
merge point </>
have different mount point options <->
and <logging>.
Population
of boot environment <solenv2> successful.
Creation
of boot environment <solenv2> successful.
When you see the bottom two outputs, the next step is to upgrade using a
image.
Make sure your chosen image is on the boot environment before using the
below commands, The next step is to mount the iso so that it will be made
bootable for live upgrade, a loopback file command will be used:
# mkdir /solCD
# lofiadm -a /path/to/iso/[ISOIMAGE]
dev/lofi/1
# mount -F hsfs -o ro /dev/lofi/1 /solCD
The mounted file system type is hsfs (high sierra file system) as this
is the standard logical File system used for CD-ROM. (basically making this ISO
cd/dvd bootable).
The next step is to upgrade the newly created environment, specifying
the auto registration file created early during the pre-requisites stage:
# luupgrade -u -k /path/to/autoregfile/[REGFILE]
-n solenv2 -s /solCD/
You should see progress output similar to below:
64459 blocks
miniroot filesystem is <lofs>
Mounting miniroot at
</solCD//Solaris_10/Tools/Boot>
#######################################################################
NOTE: To
improve products and services, Oracle Solaris communicates
configuration data to Oracle after rebooting.
You can
register your version of Oracle Solaris to capture this data
for your
use, or the data is sent anonymously.
For
information about what configuration data is communicated and how
to
control this facility, see the Release Notes or
www.oracle.com/goto/solarisautoreg.
INFORMATION: After activated and booted into
new BE <solenv2>,
Auto
Registration happens automatically with the following Information
oracle_user=
#######################################################################
Validating the contents of the media
</solCD/>.
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
<solenv2>.
Determining packages to install or upgrade for
BE <solenv2>.
Performing the operating system upgrade of the
BE <solenv2>.
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
<solenv2>.
Package information successfully updated on
boot environment <solenv2>.
Adding operating system patches to the BE
<solenv2>.
The operating system patch installation is
complete.
INFORMATION: The file
</var/sadm/system/logs/upgrade_log> on boot
environment <solenv2> contains a log of
the upgrade operation.
INFORMATION: The file
</var/sadm/system/data/upgrade_cleanup> on boot
environment <solenv2> contains a log of
cleanup operations required.
WARNING: <1> packages failed to install
properly on boot environment <solenv2>.
INFORMATION: The file
</var/sadm/system/data/upgrade_failed_pkgadds> on
boot environment <solenv2> contains a
list of packages that failed to
upgrade or install properly.
INFORMATION: Review the files listed above. Remember
that all of the files
are located on boot environment
<solenv2>. Before you activate boot
environment <solenv2>, 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 <solenv2> is partially complete.
Installing
failsafe
Failsafe
install is complete.
You can check the log files once you reboot into the new envirnonment.
Once the install is complete, the next step would be to activate the
environment so that we can boot into it after reboot:
# luactivate solenv2
Finally, reboot the system (make sure you take the default actions in
regards to shutting down the machine, schedule downtime, save your work etc)
# shutdown –i6 –g0 –y
Once the system has been rebooted, perform the following command to
see if your installation/upgrade has been successful
# cat /etc/release
Oracle Solaris 10 8/11 s10s_u10wos_17b SPARC
Copyright (c) 1983,
2011, Oracle and/or its affiliates. All rights reserved.
Assembled 23 August
2011
Optionally, Live upgrade gives the user the choice whether to fall
back to the original environment perhaps if something goes wrong,
# luactivate [PRIMARYENVNAME]
# shutdown –i6 –g0 -y
Or when you are absolutely confident that the primary environment is
not needed anymore you can delete it:
# ludelete [PRIMARYENVNAME]
NOTE: TO SEE THE LIST OF ENVIRONMENTS CONFIGURED ON THE MACHINE
PERFORM THE FOLLOWING COMMAND:
# lustatus
Name
Complete Now On Reboot Delete
Status
-------------------------- -------- ------ --------- ------
----------
be0
yes no no
yes -
be3
yes no no
yes -
solenv2
yes yes yes
no -