Rapid Patching and Upgrading with Solaris Live Upgrade SoftwareAmy Rich, February 2004 Because business has largely become a 24x7 operation, most companies strive for minimal or no downtime across the company infrastructure. If a site has only one machine performing a critical function instead of using clustering or another form of HA, the uptime of that machine is of utmost importance. Such machines still require maintenance and the occasional upgrade, but this must be balanced with the need for machine availability. In situations like this, tools such as JumpStart, Live Upgrade, and Web Start Flash are invaluable. These three tools are designed to greatly speed reinstallation, upgrading, and modifications to a machine so that a functioning system can be obtained with minimal downtime. This article takes a look at using Live Upgrade in conjunction with JumpStart and Web Start Flash to minimize downtime for system maintenance and upgrades. Live Upgrade is a suite of tools that allow the system administrator to utilize free disk space to create a copy, called the alternate boot environment (ABE), of the currently running system. Modifications can be made to the alternate boot environment with the system still running in a production setting. Once these modifications are complete, the alternate boot environment can be activated so that the system boots off of the newly selected boot environment during subsequent reboots. Starting with the Solaris 7 Operating System, Live Upgrade allows for an "N+3" upgrade path, meaning that Solaris version N (7) can be upgraded to N+1 (8), N+2 (9), and N+3 (10). In addition, the SPARC Platform Edition of the Solaris 2.6 OS can be upgraded to Solaris 8 and 9, skipping Solaris 7. Preparing to UpgradeSeveral steps must be taken before Live Upgrade can be used. To ensure smooth operation, the machine undergoing the upgrade requires the application of a specific set of patches, available from SunSolve, to
the currently booted OS. To determine the
necessary patches required by a system, read Sun Infodoc ID72099, Solaris Live-Upgrade Minimum Patch Requirements. Live Upgrade also requires a set of prerequisite packages as detailed by this chart in the Solaris Live Upgrade Guide. Once the prerequisite packages are in place, the Live Upgrade packages, The Live Upgrade suite of tools installed by
Once the appropriate packages and patches are installed and the necessary disk space is allocated, modifying a system with Live Upgrade usually involves five distinct steps:
Creating a Boot EnvironmentCreating a boot environment requires that the machine have free disk slices
and adequate space to hold the existing boot partitions. Files in
Example One The following example shows a machine with
two identical disks, fd - /dev/fd fd - no - /proc - /proc proc - no - /dev/dsk/c0t1d0s1 - - swap - no - /dev/dsk/c0t1d0s0 /dev/rdsk/c0t1d0s0 / ufs 1 no logging /dev/dsk/c0t1d0s3 /dev/rdsk/c0t1d0s3 /usr ufs 1 no logging /dev/dsk/c0t1d0s4 /dev/rdsk/c0t1d0s4 /var ufs 1 no logging /dev/dsk/c0t1d0s5 /dev/rdsk/c0t1d0s5 /files ufs 2 yes logging swap - /tmp tmpfs - yes -
/usr/sbin/prtvtoc /dev/rdsk/c0t1d0s2 |/usr/sbin/fmthard -s - /dev/rdsk/c0t3d0s2 The secondary disk could also be formatted to combine or split existing
partitions in the new boot environment or grow or shrink partition sizes
instead of matching the original partitions exactly. Once the new disk is
partitioned as desired, the This first example uses the # lucreate -c "Solaris_8" -m /:/dev/dsk/c0t3d0s0:ufs \ -m /usr:/dev/dsk/c0t3d0s3:ufs -m /var:/dev/dsk/c0t3d0s4:ufs -n "Solaris_9" Discovering physical storage devices Discovering logical storage devices Cross referencing storage devices with boot environment configurations 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. No name for current boot environment. Current boot environment is named <Solaris_8>. Creating initial configuration for primary boot environment <Solaris_8>. PBE configuration successful: PBE name <Solaris_8> PBE Boot Device </dev/dsk/c0t1d0s0>. Comparing source boot environment <Solaris_8> 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. Searching /dev for possible boot environment filesystem devices Updating system configuration files. Creating configuration for boot environment <Solaris_9>. Creating boot environment <Solaris_9>. Creating file systems on boot environment <Solaris_9>. Creating <ufs> file system for </> on </dev/dsk/c0t3d0s0>. Creating <ufs> file system for </usr> on </dev/dsk/c0t3d0s3>. Creating <ufs> file system for </var> on </dev/dsk/c0t3d0s4>. Mounting file systems for boot environment <Solaris_9>. Calculating required sizes of file systems for boot environment <Solaris_9>. Populating file systems on boot environment <Solaris_9>. Checking selection integrity. Integrity check OK. Populating contents of mount point </>. Populating contents of mount point </usr>. Populating contents of mount point </var>. Copying. Creating shared file system mount points. Creating compare databases for boot environment <Solaris_9>. Creating compare database for file system </var>. Creating compare database for file system </usr>. Creating compare database for file system </>. Updating compare databases on boot environment <Solaris_9>. Making boot environment <Solaris_9> bootable. Population of boot environment <Solaris_9> successful. Creation of boot environment <Solaris_9> successful. Example Two Instead of using the preceding command to create the alternate boot environment
so it matches the current boot environment, the following command joins
# lucreate -c "Solaris_8" -m /:/dev/dsk/c0t3d0s0:ufs \ -m /usr:merged:ufs -m /var:/dev/dsk/c0t3d0s4:ufs \ -n "Solaris_9" Example Three This next example would instead split # lucreate -c "Solaris_8" -m /:/dev/dsk/c0t3d0s0:ufs \ -m /usr:/dev/dsk/c0t3d0s3:ufs -m /var:/dev/dsk/c0t3d0s4:ufs \ -m /opt:/dev/dsk/c0t3d0s5:ufs -n "Solaris_9" Example Four This final example creates a new boot environment on an encapsulated
mirror. The entire current boot environment ( # lucreate -c "Solaris_8" -m /:/dev/md/dsk/d10:ufs,mirror \ -m /:/dev/dsk/c0t0d0s6:attach -m /:/dev/dsk/c0t3d0s6:attach -n "Solaris_9" With the current boot environment named and the alternate boot environment
initialized to match the boot environment (as shown in the Example One),
# lufslist Solaris_8
boot environment name: Solaris_8
This boot environment is currently active.
This boot environment will be active on next system boot.
Filesystem fstype device size Mounted on Mount Options
- ----------------------- -------- ------------ ------------- -------------
/dev/dsk/c0t1d0s1 swap 1076428800 - -
/dev/dsk/c0t1d0s0 ufs 1076428800 / logging
/dev/dsk/c0t1d0s3 ufs 2149171200 /usr logging
/dev/dsk/c0t1d0s4 ufs 1076428800 /var logging
/dev/dsk/c0t1d0s5 ufs 31540838400 /files logging
# lufslist Solaris_9
boot environment name: Solaris_9
Filesystem fstype device size Mounted on Mount Options
- ----------------------- -------- ------------ ------------- -------------
/dev/dsk/c0t1d0s1 swap 1076428800 - -
/dev/dsk/c0t3d0s0 ufs 1076428800 / logging
/dev/dsk/c0t1d0s5 ufs 31540838400 /files logging
/dev/dsk/c0t3d0s3 ufs 2149171200 /usr logging
/dev/dsk/c0t3d0s4 ufs 1076428800 /var logging
The Versatility of luupgradeWith the alternate boot environment prepared for modification, Using luupgrade to Upgrade from a JumpStart Server This next example shows how to upgrade from the existing Solaris 8 alternate boot environment to
Solaris 9 by means of an NFS-mounted JumpStart installation. First create a
JumpStart installation from CD-ROM, DVD, or an ISO image as covered in
the Solaris 9
Installation Guide. The JumpStart installation in this example
resides in install_type upgrade package SUNWxwice add On the target machine, mount the # mkdir /install # mount -o ro js-server:/install /install # luupgrade -u -n "Solaris_9" -s /install/cdrom/SunOS-5.9-sparc \ - -j /install/jumpstart/profiles/liveupgrade/js-upgrade Validating the contents of the media </install/cdrom/SunOS-5.9-sparc>. The media is a standard Solaris media. The media contains an operating system upgrade image. The media contains <Solaris> version <9>. 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 <Solaris_9>. Determining packages to install or upgrade for BE <Solaris_9>. Performing the operating system upgrade of the BE <Solaris_9>. CAUTION: Interrupting this process may leave the boot environment unstable or unbootable. Upgrading Solaris: 100% completed Installation of the packages from this the media is complete. Adding operating system patches to the BE <Solaris_9>. The operating system patch installation is complete. INFORMATION: </var/sadm/system/logs/upgrade_log> contains a log of the upgrade operation. INFORMATION: </var/sadm/system/data/upgrade_cleanup> contains a log of cleanup operations required. INFORMATION: Review the files listed above on boot environment <Solaris_9>. Before you activate the boot environment, 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 <Solaris_9> is complete. The # lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status - -------------------------- -------- ------ --------- ------ ---------- Solaris_8 yes yes yes no - Solaris_9 yes no no yes - Following the profile directive, SUNWxwice is also installed on the the
Using luupgrade to Patch a System Though the In the following example, the NFS-mounted JumpStart partition
contains the recommended patch cluster in
# luupgrade -t -n "Solaris_9" \ -s /install/data/patches/SunOS-5.9-sparc/recommended -O \ "-M /install/data/patches/SunOS-5.9-sparc/recommended patch_order" Validating the contents of the media </install/data/patches/SunOS-5.9-sparc/recommended>. The media contains 93 software patches that can be added. All 93 patches will be added because you did not specify any specific patches to add. Mounting the BE <Solaris_9>. Adding patches to the BE <Solaris_9>. The Using luupgrade to Install a Web Start Flash Archive Instead of upgrading or patching a system, Live Upgrade can also be used to install a Web Start Flash image. This is especially useful when a number of identical servers perform the same tasks, such as a web farm cluster. Web Start Flash allows the system administrator to archive a specific reference installation on a master machine. Once the archive is created, it can be copied to other machines, without the configuration information erased by running Since the previous example upgraded and patched the # lumake -n Solaris_9 Creating configuration for boot environment <Solaris_9>. Determining the split file systems of </var>. Determining the merge point of </var>. Determining the size and inode count for the split filesystem of </var>. Determining the split file systems of </usr>. Determining the merge point of </usr>. Determining the size and inode count for the split filesystem of </usr>. Determining the split file systems of </>. Determining the merge point of </>. Determining the size and inode count for the split filesystem of </>. Creating boot environment <Solaris_9>. Creating file systems on boot environment <Solaris_9>. Creating <ufs> file system for </> on </dev/dsk/c0t3d0s0>. Creating <ufs> file system for </usr> on </dev/dsk/c0t3d0s3>. Creating <ufs> file system for </var> on </dev/dsk/c0t3d0s4>. Mounting file systems for boot environment <Solaris_9>. Calculating required sizes of file systems for boot environment <Solaris_9>. Populating file systems on boot environment <Solaris_9>. Checking selection integrity. Integrity check OK. Populating contents of mount point </>. Populating contents of mount point </usr>. Populating contents of mount point </var>. Copying. Creating shared file system mount points. Creating compare databases for boot environment <Solaris_9>. Creating compare database for file system </var>. Creating compare database for file system </usr>. Creating compare database for file system </>. Updating compare databases on boot environment <Solaris_9>. Making boot environment <Solaris_9> bootable. Population of boot environment <Solaris_9> successful. Next create a Web Start Flash archive on the master machine. This
master machine has Solaris 9 08/03 installed with the latest patch cluster and
also has additional software and customizations. Omit the
# flarcreate -n "Solaris 9 12.22.2003 Full Patched" \ -x /files/ -x /var/adm/ -x /var/tmp/ -x /var/log \ /files/Solaris-9-12.22.2003.archive Determining which filesystems will be included in the archive... Determining the size of the archive... The archive will be approximately 0.95GB. Creating the archive... 1995279 blocks Archive creation complete. Place the Web Start Flash archive on the JumpStart
server's NFS exported partition. This example shows it stored in
# luupgrade -f -n "Solaris_9" \ -s /install/cdrom/SunOS-5.9-sparc \ -a /install/data/flash-images/Solaris-9-12.22.2003.archive Validating the contents of the media </install/cdrom/SunOS-5.9-sparc>. The media is a standard Solaris media. Validating the contents of the miniroot </install/cdrom/SunOS-5.9-sparc/Solaris_9/Tools/Boot>. Locating the flash install program. Checking for existence of previously scheduled Live Upgrade requests. Constructing flash profile to use. Creating flash profile for BE <Solaris_9>. Performing the operating system flash install of the BE <Solaris_9>. CAUTION: Interrupting this process may leave the boot environment unstable or unbootable. Extracting Flash Archive: 100% completed (of 974.26 megabytes) The operating system flash install completed. The Live Flash Install of the boot environment <Solaris_9> is complete. Checking and Modifying an Alternate Boot EnvironmentAfter the alternate boot environment has been successfully upgraded, patched, or overwritten with
a Web Start Flash archive, it's wise to look through the alternate boot environment's
configuration files and make any necessary changes. The
# lucompare -t Solaris_9 -o /tmp/BE-comparisons Another option for checking inactive alternate boot environment is # lumount Solaris_9 /.alt.Solaris_9 # df -k Filesystem 1024-blocks Used Available Capacity Mounted on /dev/dsk/c0t1d0s0 1019167 51821 906196 6% / /dev/dsk/c0t1d0s3 2056111 176498 1817930 9% /usr /proc 0 0 0 0% /proc fd 0 0 0 0% /dev/fd mnttab 0 0 0 0% /etc/mnttab /dev/dsk/c0t1d0s4 1019167 41496 916521 5% /var swap 1127624 24 1127600 1% /var/run swap 1127608 8 1127600 1% /tmp /dev/dsk/c0t1d0s5 30331071 72676 29955085 1% /files /dev/dsk/c0t3d0s0 1019167 61097 896920 7% /.alt.Solaris_9 /dev/dsk/c0t3d0s3 2056111 200737 1793691 11% /.alt.Solaris_9/usr /dev/dsk/c0t3d0s4 1019167 32817 925200 4% /.alt.Solaris_9/var Activating the Alternate Boot Environment with luactivateWhen the alternate boot environment is completely configured and meets all of the necessary
requirements, activate it with
# luactivate Solaris_9
**********************************************************************
The target boot environment has been activated. It will be used when you
reboot. NOTE: You MUST NOT USE the reboot, halt, or uadmin commands. You
MUST USE either the init or the shutdown command when you reboot. If you
do not use either init or shutdown, the system will not boot using the
target BE.
**********************************************************************
In case of a failure while booting to the target BE, the following process
needs to be followed to fall back to the currently working boot environment:
1. Enter the PROM monitor (ok prompt).
2. Change the boot device back to the original boot environment by typing:
setenv boot-device disk1:a
3. Boot to the original boot environment by typing:
boot
**********************************************************************
Activation of boot environment <Solaris_9> successful.
Now that
# lufslist Solaris_9
boot environment name: Solaris_9
This boot environment will be active on next system boot.
Filesystem fstype device size Mounted on Mount Options
- ---------------------- -------- ------------ -------------- --------------
/dev/dsk/c0t1d0s1 swap 1076428800 - -
/dev/dsk/c0t3d0s0 ufs 1076428800 / logging
/dev/dsk/c0t1d0s5 ufs 31540838400 /files logging
/dev/dsk/c0t3d0s3 ufs 2149171200 /usr logging
/dev/dsk/c0t3d0s4 ufs 1076428800 /var logging
# lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
- -------------------------- -------- ------ --------- ------ ----------
Solaris_8 yes yes no no -
Solaris_9 yes no yes no -
At the next convenient time, such as the next maintenance window, reboot
the machine with the # init 6 INIT: New run level: 6 The system is coming down. Please wait. System services are now being stopped. Live Upgrade: Deactivating current boot environment <Solaris_8>. Live Upgrade: Executing Stop procedures for boot environment <Solaris_8>. Live Upgrade: Current boot environment is <Solaris_8>. Live Upgrade: New boot environment will be <Solaris_9>. Live Upgrade: Activating boot environment <Solaris_9>. Live Upgrade: The boot device for boot environment <Solaris_9> is </dev/dsk/c0t3d0s0>. Live Upgrade: Activation of boot environment <Solaris_9> completed. The system is down. syncing file systems... done rebooting... Resetting ... Rebooting with command: boot Boot device: disk3:a File and args: SunOS Release 5.9 Version Generic_112233-08 64-bit Copyright 1983-2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. configuring IPv4 interfaces: hme0. Hostname: machine.my.domain Configuring /dev and /devices Configuring the /dev directory (compatibility devices) The system is coming up. Please wait. checking ufs filesystems /dev/rdsk/c0t1d0s7: is clean. /dev/rdsk/c0t1d0s5: is logging. Live Upgrade: Synchronizing new boot environment. Live Upgrade: Previous boot environment was <Solaris_8>. Live Upgrade: Current boot environment is now <Solaris_9>. Configuring network interface addresses: hme0. starting rpc services: rpcbind done. Setting netmask of hme0 to 255.255.255.0 Setting default IPv4 interface for multicast: add net 224.0/4: gateway machine.my.domain syslog service starting. /etc/mail/aliases: 3 aliases, longest 10 bytes, 52 bytes total starting SSHD daemon volume management starting. The system is ready. Recycling or Removing the Old Boot EnvironmentOnce the new boot environment is proven to be complete and stable, the original boot environment can be
removed with the # ludelete Solaris_8 Determining the devices to be marked free. Updating boot environment configuration database. Updating boot environment description database on all BEs. Updating all boot environment configuration databases. Boot environment <Solaris_8> deleted. If the root disk was originally mirrored, it can now be re-encapsulated and
re-mirrored. If the original boot environment was not part of an existing
mirror, it can be renamed and remade for future Live Upgrade
maintenance tasks instead of deleting it. For example, the original boot
environment could be renamed to # lurename -e Solaris_8 -n Solaris_10 Renaming boot environment <Solaris_8> to <Solaris_9_01_04>. Changing the name of BE in the BE definition file. Changing the name of BE in configuration file. Updating compare databases on boot environment <Solaris_9_01_04>. Changing the name of BE in Internal Configuration Files. Propagating the boot environment name change to all BEs. Boot environment <Solaris_8> renamed to <Solaris_9_01_04>. When the recommended patch set is available and ready for application,
simply run Resources
Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License. |
|