Tuesday Nov 06, 2007

Live Upgrading

A short look at Live Upgrade


Have you ever used Solaris Live Upgrade or wondered what it looks like?


Here you go...


I just did a small demonstration and thought I share the logs with you.


Step One: Create a new boot environment


This means looking for space to accomodate the OS copy.


As we have a rather simple setup with a single file system for root (/), we just have to provide a place for this one. BTW: Live Upgrade can re-layout your file system on the fly. If I wanted to put /var in its own file system, I could just add a mount point for it (lucreate can create mirrored file systems, too).


In this case, c0t1d0s3 is an unused 10GB slice my 5GB plain Solaris will nicely fit into.


root@m8000b-test # lucreate -n toms -m /:/dev/dsk/c0t1d0s3:ufs
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.
Comparing source boot environment <production> 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.
The device </dev/dsk/c0t1d0s3> is not a root device for any boot environment; cannot get BE ID.
Creating configuration for boot environment <toms>.
Source boot environment is <production>.
Creating boot environment <toms>.
Creating file systems on boot environment <toms>.
Creating <ufs> file system for </> in zone <global> on </dev/dsk/c0t1d0s3>.
Mounting file systems for boot environment <toms>.
Calculating required sizes of file systems for boot environment <toms>.
Populating file systems on boot environment <toms>.
Checking selection integrity.
Integrity check OK.
Populating contents of mount point </>.
Copying.
Creating shared file system mount points.
Creating compare databases for boot environment <toms>.
Creating compare database for file system </>.
Updating compare databases on boot environment <toms>.
Updating compare databases on boot environment <kopie>.
Making boot environment <toms> bootable.
Setting root slice to </dev/dsk/c0t1d0s3>.
Population of boot environment <toms> successful.
Creation of boot environment <toms> successful.
root@m8000b-test #


This process took about ten minutes. This is the result:

root@m8000b-test # lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
production                 yes      yes    yes       no     -
toms                       yes      no     no        yes    -


Step two: Do the upgrade


To upgrade, I have to provide the location of the OS install media. In this case, we copied the DVD to the installation server "iserv" which exports it via nfs.


root@m8000b-test # luupgrade -u -n toms -s /net/iserv/export/upgrade/sol10_u4/


159648 blocks
miniroot filesystem is <lofs>
Mounting miniroot at </net/iserv/export/upgrade/sol10_u4//Solaris_10/Tools/Boot>
Validating the contents of the media </net/iserv/export/upgrade/sol10_u4/>.
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 <toms>.
Determining packages to install or upgrade for BE <toms>.
Performing the operating system upgrade of the BE <toms>.
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 <toms>.
Package information successfully updated on boot environment <toms>.
Adding operating system patches to the BE <toms>.
The operating system patch installation is complete.
INFORMATION: The file </var/sadm/system/logs/upgrade_log> on boot
environment <toms> contains a log of the upgrade operation.
INFORMATION: The file </var/sadm/system/data/upgrade_cleanup> on boot
environment <toms> contains a log of cleanup operations required.
INFORMATION: Review the files listed above. Remember that all of the files
are located on boot environment <toms>. Before you activate boot
environment <toms>, 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 <toms> is complete.


The upgrade took about 1 hour.


Step three: Reboot


Wanna boot the new OS? luactivate takes care of everything necessary.


root@m8000b-test # luactivate -n toms


\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
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 fallback 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
/pci@20,600000/pci@0/scsi@1/disk@0,0:a
3
. Boot to the original boot environment by typing:
     boot
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
Activation of boot environment <toms> successful.


Ok, there we go...


Rebooting with command: boot
Boot device:
/pci@20,600000/pci@0/scsi@1/disk@1,0:d  File and args:
SunOS Release 5.10 Version Generic_120011-14 64-bit
Copyright 1983-2007 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Hostname: m8000b-test
Configuring devices.
Loading smf(5) service descriptions: 29/33
Nov  6 13:46:23 svc.startd[7]: svc:/system/rcap:default: Method ":kill -SIGHUP" failed with exit status 1.
Nov  6 13:46:23 svc.startd[7]: svc:/system/rcap:default: Method ":kill -SIGHUP" failed with exit status 1.
Nov  6 13:46:23 svc.startd[7]: svc:/system/rcap:default: Method ":kill -SIGHUP" failed with exit status 1.
Nov  6 13:46:23 svc.startd[7]: system/rcap:default failed: transitioned to maintenance (see 'svcs -xv' for details)  33/33


m8000b-test console login: root
Password:
Last login: Mon Nov  5 17:15:15 from 10.67.213.111
Nov  6 13:48:44 m8000b-test login: ROOT LOGIN /dev/console
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005


TERM=vt100


root@m8000b-test # lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
production                 yes      no     no        yes    -
toms                       yes      yes    yes       no     -


Step four (there and back again...) (optional)


Is everything ok with the Upgrade?
If not, switching back is a matter of minutes:


root@m8000b-test # luactivate -n production



\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
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 fallback 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 /pci@20,600000/pci@0/scsi@1/disk@1,0:c
3. Boot to the original boot environment by typing:
     boot
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*


Activation of boot environment <production> successful.
root@m8000b-test # init 6
root@m8000b-test #
Nov  6 13:49:10 m8000b-test ip: ip_create_dl: hw addr length = 0
svc.startd: The system is coming down.  Please wait.
svc.startd: 98 system services are now being stopped.
Nov  6 13:49:56 m8000b-test agent[2249]: syslog   Nov 06 13:49:56 agent         {received software termination signal}
Nov  6 13:49:56 m8000b-test agent[2249]: syslog   Nov 06 13:49:56 agent         \*\*\* terminating execution \*\*\*
Nov  6 13:50:01 m8000b-test ip: ipsec_check_inbound_policy: Policy Failure for the incoming packet (not secure); Source 192.168.224.001, Destination 192.168.224.003.
Nov  6 13:50:02 m8000b-test ip: ip_create_dl: hw addr length = 0
Nov  6 13:50:02 m8000b-test rpc.metad: Terminated
Nov  6 13:50:02 m8000b-test syslogd: going down on signal 15
Nov  6 13:51:35 svc.startd[7]: svc:/application/management/sunmcagent:default: Method or service exit timed out.  Killing contract 52.
Nov  6 13:51:35 svc.startd[7]: application/management/sunmcagent:default failed: transitioned to maintenance (see 'svcs -xv' for details)
svc.startd: The system is down.
syncing file systems... done
rebooting...
Resetting...
..POST Sequence 01
POST Sequence 02
..
POST Sequence 1A
POST Sequence Complete.
ChassisSerialNumber xxxxxxxx


Sun SPARC Enterprise M8000 Server, using Domain console
Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
Copyright 2007 Sun Microsystems, Inc. and Fujitsu Limited. All rights reserved.
OpenBoot 4.24.1, 16384 MB memory installed, Serial #xxxxxxxxx.
Ethernet address 0:xx:xx:xx:xx:x, Host ID: xxxxxxxxx.

Rebooting with command: boot
Boot device:
/pci@20,600000/pci@0/scsi@1/disk@0,0:a  File and args:
SunOS Release 5.10 Version Generic_120011-11 64-bit
Copyright 1983-2007 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Hostname: m8000b-test


m8000b-test console login: root
Password:
Last login: Mon Nov  5 17:15:15 from 10.67.213.111
Nov  6 13:56:02 m8000b-test login: ROOT LOGIN /dev/console
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005

TERM=vt100


root@m8000b-test # lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
production                 yes      yes    yes       no     -
toms                       yes      no     no        yes    -


root@m8000b-test # init 6


And so on...


It is an easy, unattended, quick and safe way to do OS upgrades with Live Upgrade.


You can use it to create a copy of your system before you do an oracle upgrade, too. Just tell Live Upgrade to copy your Oracle binaries as well (see man lucreate on how to do that). Look at lumake, too.

 

Update Nov 23, 2007: "bbr" reminded me that I should have upgraded Live Upgrade Packages before doing the actual upgrade. Correct. This is done by removing lu Packages and re-installing them from the version you want to upgrade to (or newer).

About

Dirk Wriedt

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
Bookmarks
Software for Solaris
Favourite blogs
Dirks Bookmarks

No bookmarks in folder