Wednesday, March 18, 2015

Solaris 10: Live upgrade with ZFS rpool - Example


Solaris 10 Live Upgrade with ZFS is really simple compared to some of the messes you could get into with SVM mirrored root disks. Below is a simple live upgrade BE creation and patching example. Also, Solaris Live Upgrade works the same as in previous releases when you use ZFS. The same commands. As I said, it's just easier. Also, a really great feature is that you can now migrate from UFS file systems to a ZFS root pool and create new boot environments within a ZFS root pool. Will't show that in another blog entry at a later date.
# lucreate -n Dec2012
Analyzing system configuration.
No name for current boot environment.
INFORMATION: The current boot environment is not named – assigning name <s10s_u10wos_17b>.
Current boot environment is named <s10s_u10wos_17b>.
Creating initial configuration for primary boot environment <s10s_u10wos_17b>.
INFORMATION: No BEs are configured on this system.
The device </dev/dsk/c0t5000CCA02533AC20d0s0> is not a root device for any boot environment; cannot get BE ID.
PBE configuration successful: PBE name <s10s_u10wos_17b> PBE Boot Device </dev/dsk/c0t5000CCA02533AC20d0s0>.
Updating boot environment description database on all BEs.
Updating system configuration files.
Creating configuration for boot environment <Dec2012>.
Source boot environment is <s10s_u10wos_17b>.
Creating file systems on boot environment <Dec2012>.
Populating file systems on boot environment <Dec2012>.
Analyzing zones.
Duplicating ZFS datasets from PBE to ABE.
Creating snapshot for <rpool/ROOT/s10s_u10wos_17b> on <rpool/ROOT/s10s_u10wos_17b@Dec2012>.
Creating clone for <rpool/ROOT/s10s_u10wos_17b@Dec2012> on <rpool/ROOT/Dec2012>.
Mounting ABE <Dec2012>.
Generating file list.
Finalizing ABE.
Fixing zonepaths in ABE.
Unmounting ABE <Dec2012>.
Fixing properties on ZFS datasets in ABE.
Reverting state of zones in PBE <s10s_u10wos_17b>.
Making boot environment <Dec2012> bootable.
Population of boot environment <Dec2012> successful.
Creation of boot environment <Dec2012> successful.

now patch it. Lets move to my patch folder where I unzipped my stuff 
# cd /root/10_Recommended/patches
# luupgrade -n Dec2012 -s /root/10_Recommended/patches -t `cat patch_order`
Validating the contents of the media </root/10_Recommended/patches>.
The media contains 358 software patches that can be added.
Mounting the BE <Dec2012>.
---------------- SNIP -------------------------------------------------
Patch 146054-07 has been successfully installed.
See /a/var/sadm/patch/146054-07/log for details
Executing postpatch script…
Patch packages installed:
SUNWcsu
SUNWxcu6
Checking installed patches…
Executing prepatch script…
Installing patch packages…
Patch 125555-12 has been successfully installed.
See /a/var/sadm/patch/125555-12/log for details
Executing postpatch script…
Patch packages installed:
SUNWcsu
Checking installed patches…
Installing patch packages…
---------------- SNIP ------------------------------------------------Un
mount the BE <Dec2012>.
The patch add to the BE <Dec2012> completed.

Now we activate the new BE
# luactivate Dec2012
A Live Upgrade Sync operation will be performed on startup of boot environment <Dec2012>.
**********************************************************************
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. Boot the machine to Single User mode using a different boot device
(like the Solaris Install CD or Network). Examples:
At the PROM monitor (ok prompt):
For boot to Solaris CD:  boot cdrom -s
For boot to network:     boot net -s
3. Mount the Current boot environment root slice to some directory (like
/mnt). You can use the following commands in sequence to mount the BE:
zpool import rpool
zfs inherit -r mountpoint rpool/ROOT/s10s_u10wos_17b
zfs set mountpoint=<mountpointName> rpool/ROOT/s10s_u10wos_17b
zfs mount rpool/ROOT/s10s_u10wos_17b
4. Run <luactivate> utility with out any arguments from the Parent boot
environment root slice, as shown below:
<mountpointName>/sbin/luactivate
5. luactivate, activates the previous working boot environment and
indicates the result.
6. Exit Single User mode and reboot the machine.
**********************************************************************
Modifying boot archive service
Activation of boot environment <Dec2012> successful.

All done. Lets see if it looks ok,
# lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
————————–                 ——–       ——     ———       ——     ———-
s10s_u10wos_17b            yes      yes    no        no     –
Dec2012                    yes      no     yes       no     –

Yes, Dec2012 is now the active BE. Now we reboot, WITHOUT using REBOOT command.
# shutdown -i6 -y -g0
Shutdown started.    Thu Dec 20 13:11:38 EST 2012
Changing to init state 6 – please wait
Broadcast Message from root (pts/1) on mybox.ca Thu Dec 20 13:11:39…
THE SYSTEM mybox.ca IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged

System has rebooted now. Lets look:
# uname -a
SunOS mybox.ca  5.10 Generic_147440-26 sun4v sparc sun4v

# lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
————————–                 ——–       ——     ———       ——     ———-
s10s_u10wos_17b            yes      no     no        yes    –
Dec2012                    yes      yes    yes       no     –

New kernel. Yes. Dec2012 is the booted and active BE. Hope this helps.

No comments:

Post a Comment