вторник, 20 апреля 2010 г.

Обновление root pool при помощи Live Upgrade

Ранее я писал о том, как выполнить миграцию на root pool ZFS посредством Live Upgrade. Сейчас мы рассмотрим обновление корневого пула, а точнее, выполнение апгрейда операционной системы.

Как мы это сделаем? "Всегда правой" ;)

Создадим новый boot environment (BE) в рамках существующего пула:

server2# lustatus
Boot Environment           Is       Active Active    Can    Copy    
Name                       Complete Now    On Reboot Delete Status  
-------------------------- -------- ------ --------- ------ ----------
zfsBE                      yes      yes    yes       no     -       
server2# lucreate -o zfsBE -n zfsBE_new
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 [zfsBE_new].
Source boot environment is [zfsBE].
Creating boot environment [zfsBE_new].
Cloning file systems from boot environment [zfsBE] to create boot environment [zfsBE_new].
Creating snapshot for [rpool/ROOT/zfsBE] on [rpool/ROOT/zfsBE@zfsBE_new].
Creating clone for [rpool/ROOT/zfsBE@zfsBE_new] on [rpool/ROOT/zfsBE_new].
Setting canmount=noauto for [/] in zone [global] on [rpool/ROOT/zfsBE_new].
Population of boot environment [zfsBE_new] successful.
Creation of boot environment [zfsBE_new] successful.

Примонтируем по NFS дистрибутив для обновления:

server2# mount -F nfs /mnt

Выполним обновление (система все время находится в онлайне):

server2# luupgrade -u -n zfsBE_new -s /mnt/SunOS5.10_1009_sun4

62652 blocks
miniroot filesystem is [lofs]
Mounting miniroot at [/mnt/SunOS5.10_1009_sun4/Solaris_10/Tools/Boot]
Validating the contents of the media [/mnt/SunOS5.10_1009_sun4].
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_new].
Determining packages to install or upgrade for BE [zfsBE_new].
Performing the operating system upgrade of the BE [zfsBE_new].
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_new].
Package information successfully updated on boot environment [zfsBE_new].
Adding operating system patches to the BE [zfsBE_new].
The operating system patch installation is complete.
INFORMATION: The file [/var/sadm/system/logs/upgrade_log] on boot
environment [zfsBE_new] contains a log of the upgrade operation.
INFORMATION: The file [/var/sadm/system/data/upgrade_cleanup] on boot
environment [zfsBE_new] 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_new]. Before you activate boot
environment [zfsBE_new], determine if any additional system maintenance is
required or if additional media of the software distribution must be
The Solaris upgrade of the boot environment [zfsBE_new] is complete.
Installing failsafe
Failsafe install is complete.

Активируем новый BE и перезапускаемся:

server2# luactivate zfsBE_new


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 command to mount:

     mount -Fzfs /dev/dsk/c0t1d0s0 /mnt

4. Run [luactivate] utility with out any arguments from the current boot
environment root slice, as shown below:


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 [zfsBE_new] successful.

Все. Обновление завершено. Осталось удалить старый BE.