Últimos Cambios |
||
Blog personal: El hilo del laberinto |
Última Actualización: 12 de mayo de 2009 - Martes
En este documento abundo en mi experiencia con "Live Upgrade". En este caso describo la migración de Solaris 10 Update 6 (10/08) a Solaris 10 Update 7 (5/09).
Para comprender completamente este documento, habría que leerse los artículos anteriores:
Tras la migración a ZFS "root"/"boot" después de actualizar al Update 6, la actualización es mucho más rápida, simple y aún más indolora.
La nueva actualización de Solaris incluye algunas mejoras muy interesantes, como la mejor integración entre ZFS y Zonas (tanto en "Live Upgrade" como en clonación de zonas), mejoras en IPSec, mejoras en el módulo de "iSCSI Target", y mejoras en los modos de ahorro de energía.
Los pasos son los siguientes:
[root@tesalia /]# lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status -------------------------- -------- ------ --------- ------ ---------- Solaris10u6ZFS yes no no yes - Solaris10u6 yes yes yes no - [root@tesalia /]# ludelete Solaris10u6ZFS System has findroot enabled GRUB Checking if last BE on any disk... BE <Solaris10u6ZFS> is not the last BE on any disk. Updating GRUB menu default setting Changing GRUB menu default setting to <0> Saving existing file </boot/grub/menu.lst> in top level dataset for BE <Solaris10u6> as <mount-point>//boot/grub/menu.lst.prev. File </etc/lu/GRUB_backup_menu> propagation successful Successfully deleted entry from GRUB menu 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. cannot promote 'datos/ROOT/Solaris10u6/var': not a cloned filesystem Boot environment <Solaris10u6ZFS> deleted. [root@tesalia /]# lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status -------------------------- -------- ------ --------- ------ ---------- Solaris10u6 yes yes yes no -
A continuación clonamos el BE actual, para poder actualizarlo. Como ahora estamos usando ZFS, la clonación apenas supone unos segundos:
[root@tesalia /]# time lucreate -n Solaris10u7 Checking GRUB menu... System has findroot enabled GRUB Analyzing system configuration. Comparing source boot environment <Solaris10u6> 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 <Solaris10u7>. Source boot environment is <Solaris10u6>. Creating boot environment <Solaris10u7>. Cloning file systems from boot environment <Solaris10u6> to create boot environment <Solaris10u7>. Creating snapshot for <datos/ROOT/Solaris10u6> on <datos/ROOT/Solaris10u6@Solaris10u7>. Creating clone for <datos/ROOT/Solaris10u6@Solaris10u7> on <datos/ROOT/Solaris10u7>. Setting canmount=noauto for </> in zone <global> on <datos/ROOT/Solaris10u7>. Creating snapshot for <datos/ROOT/Solaris10u6/var> on <datos/ROOT/Solaris10u6/var@Solaris10u7>. Creating clone for <datos/ROOT/Solaris10u6/var@Solaris10u7> on <datos/ROOT/Solaris10u7/var>. Setting canmount=noauto for </var> in zone <global> on <datos/ROOT/Solaris10u7/var>. Saving existing file </boot/grub/menu.lst> in top level dataset for BE <Solaris10u7> as <mount-point>//boot/grub/menu.lst.prev. File </boot/grub/menu.lst> propagation successful Copied GRUB menu from PBE to ABE No entry for BE <Solaris10u7> in GRUB menu Population of boot environment <Solaris10u7> successful. Creation of boot environment <Solaris10u7> successful. real 0m46.063s user 0m5.399s sys 0m8.516s [root@tesalia /]# lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status -------------------------- -------- ------ --------- ------ ---------- Solaris10u6 yes yes yes no - Solaris10u7 yes no no yes -
Solo necesitamos 46 segundos para clonar el BE actual, durante la mayoría de los cuales se está esperando por el disco duro...
El siguiente paso consiste en actualizar el sistema operativo en el nuevo BE. Para ello copio la imagen ISO en "/tmp", la monto y actualizo desde ella:
[root@tesalia tmp]# lofiadm -a /tmp/sol-10-u7-ga-x86-dvd.iso /dev/lofi/1 [root@tesalia tmp]# mkdir /tmp/sol-10-u7-ga-x86-dvd [root@tesalia tmp]# mount -o ro -F hsfs /dev/lofi/1 /tmp/sol-10-u7-ga-x86-dvd [root@tesalia tmp]# time luupgrade -n Solaris10u7 -u -s /tmp/sol-10-u7-ga-x86-dvd System has findroot enabled GRUB No entry for BE <Solaris10u7> in GRUB menu Copying failsafe kernel from media. Uncompressing miniroot Creating miniroot device miniroot filesystem is <ufs> Mounting miniroot at </tmp/sol-10-u7-ga-x86-dvd/Solaris_10/Tools/Boot> Validating the contents of the media </tmp/sol-10-u7-ga-x86-dvd>. 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 <Solaris10u7>. Checking for GRUB menu on ABE <Solaris10u7>. Saving GRUB menu on ABE <Solaris10u7>. Checking for x86 boot partition on ABE. Determining packages to install or upgrade for BE <Solaris10u7>. Performing the operating system upgrade of the BE <Solaris10u7>. 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. Restoring GRUB menu on ABE <Solaris10u7>. Updating package information on boot environment <Solaris10u7>. Package information successfully updated on boot environment <Solaris10u7>. Adding operating system patches to the BE <Solaris10u7>. The operating system patch installation is complete. ABE boot partition backing deleted. PBE GRUB has no capability information. PBE GRUB has no versioning information. ABE GRUB is newer than PBE GRUB. Updating GRUB. GRUB update was successfull. Configuring failsafe for system. Failsafe configuration is complete. INFORMATION: The file </var/sadm/system/logs/upgrade_log> on boot environment <Solaris10u7> contains a log of the upgrade operation. INFORMATION: The file </var/sadm/system/data/upgrade_cleanup> on boot environment <Solaris10u7> contains a log of cleanup operations required. WARNING: <2> packages failed to install properly on boot environment <Solaris10u7>. INFORMATION: The file </var/sadm/system/data/upgrade_failed_pkgadds> on boot environment <Solaris10u7> 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 <Solaris10u7>. Before you activate boot environment <Solaris10u7>, 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 <Solaris10u7> is partially complete. Installing failsafe Failsafe install is complete. real 115m50.715s user 17m14.624s sys 8m3.789s [root@tesalia tmp]# umount /tmp/sol-10-u7-ga-x86-dvd [root@tesalia tmp]# lofiadm -d /dev/lofi/1
Lo único que quedaría por hacer ahora es cambiar el BE de arranque y reiniciar el sistema. En mi caso particular, no obstante, tengo algunos problemas que hay que resolver primero:
Como mal menor, puedo arrancar el BE nuevo sin sistema de correo, para poder actualizarlo y probarlo un poco antes de activarlo. La forma más sencilla de lograrlo es eliminar el ejecutable del sistema responsable del correo, de forma que su lanzamiento falle. Para eso podemos utilizar "lumount Solaris10u7", para hacerlo visible y poder eliminarlo.
Hay que tener en cuenta que la actualización del sistema destroza por completo mi configuración de correo. Por tanto es conveniente realizar un backup previo y revisar la actualización con lupa, después.
Ya solo queda activar el nuevo BE y reiniciar la máquina:
[root@tesalia /]# lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status -------------------------- -------- ------ --------- ------ ---------- Solaris10u6 yes yes yes no - Solaris10u7 yes no no yes - [root@tesalia /]# luactivate Solaris10u7 System has findroot enabled GRUB Generating boot-sign, partition and slice information for PBE <Solaris10u6> A Live Upgrade Sync operation will be performed on startup of boot environment <Solaris10u7>. Generating boot-sign for ABE <Solaris10u7> Saving existing file </etc/bootsign> in top level dataset for BE <Solaris10u7> as <mount-point>//etc/bootsign.prev. Generating partition and slice information for ABE <Solaris10u7> Copied boot menu from top level dataset. Generating multiboot menu entries for PBE. Generating multiboot menu entries for ABE. Disabling splashimage Re-enabling splashimage No more bootadm entries. Deletion of bootadm entries is complete. GRUB menu default setting is unaffected Done eliding bootadm entries. ********************************************************************** 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. Boot from Solaris failsafe or boot in single user mode from the Solaris Install CD or Network. 2. Mount the Parent boot environment root slice to some directory (like /mnt). You can use the following command to mount: mount -Fzfs /dev/dsk/c5t0d0s0 /mnt 3. Run <luactivate> utility with out any arguments from the Parent boot environment root slice, as shown below: /mnt/sbin/luactivate 4. luactivate, activates the previous working boot environment and indicates the result. 5. Exit Single User mode and reboot the machine. ********************************************************************** Modifying boot archive service Propagating findroot GRUB for menu conversion. File </etc/lu/installgrub.findroot> propagation successful File </etc/lu/stage1.findroot> propagation successful File </etc/lu/stage2.findroot> propagation successful File </etc/lu/GRUB_capability> propagation successful Deleting stale GRUB loader from all BEs. File </etc/lu/installgrub.latest> deletion successful File </etc/lu/stage1.latest> deletion successful File </etc/lu/stage2.latest> deletion successful Activation of boot environment <Solaris10u7> successful. [root@tesalia /]# lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status -------------------------- -------- ------ --------- ------ ---------- Solaris10u6 yes yes no no - Solaris10u7 yes no yes no - [root@tesalia /]# init 6
Una vez reiniciados, comprobamos que estamos ejecutando la versión correcta, recreo el servicio de correo y me aseguro de que todo funciona a la perfección:
# cat /etc/release Solaris 10 5/09 s10x_u7wos_08 X86 Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. Assembled 30 March 2009 # lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status -------------------------- -------- ------ --------- ------ ---------- Solaris10u6 yes no no yes - Solaris10u7 yes yes yes no -
Los cambios más reseñables respecto a la anterior actualización son:
En este caso, no obstante, hay dos paquetes que fallan durante la actualización: SUNWcsr y SUNWupdatemgrr. El log muestra que actualizar esos paquetes durante la actualización del sistema ha fallado, pero no nos da ningún detalle al respecto.
Por ello tras esperar unas horas y ver que el sistema parece funcionar con normalidad, procedo a actualizar ambos paquetes de forma manual, para ver así qué error surge y poder solucionarlo. Lo ideal sería haber instalado estos paquetes en el BE antes de haberlo arrancado, pero no lo he hecho así. Es algo a tener en cuenta para la próxima ocasión.
Los paquetes están en el DVD del sistema:
[root@tesalia /]# cd /tmp/sol-10-u7-ga-x86-dvd/Solaris_10/Product [root@tesalia Product]# cp -r SUNWcsr SUNWupdatemgrr /tmp [root@tesalia Product]# cd /tmp [root@tesalia tmp]# pkgadd -d . The following packages are available: 1 SUNWcsr Core Solaris, (Root) (i386) 11.10.0,REV=2005.01.21.16.34 2 SUNWupdatemgrr Update Manager GUI (root) (i386) 0.1,REV=2005.05.20.11.37 Select package(s) you wish to process (or 'all' to process all packages). (default: all) [?,??,q]: all Processing package instance <SUNWcsr> from </tmp> Core Solaris, (Root)(i386) 11.10.0,REV=2005.01.21.16.34 Copyright 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. This appears to be an attempt to install the same architecture and version of a package which is already installed. This installation will attempt to overwrite this package. The installation of this package was previously terminated and installation was never successfully completed. Do you want to continue with the installation of <SUNWcsr> [y,n,?] y [...] Installation of <SUNWcsr> was successful. Processing package instance <SUNWupdatemgrr> from </tmp> Update Manager GUI (root)(i386) 0.1,REV=2005.05.20.11.37 Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. This appears to be an attempt to install the same architecture and version of a package which is already installed. This installation will attempt to overwrite this package. The installation of this package was previously terminated and installation was never successfully completed. Do you want to continue with the installation of <SUNWupdatemgrr> [y,n,?] y [...] Installation of <SUNWupdatemgrr> was successful
Se indica claramente que la actualización previa falló (dejó la actualización incompleta). Pero en esta ocasión la actualización se realiza sin problemas. Misterios...
Lo ideal es realizar esta actualización antes de activar el nuevo BE, pero ya es tarde para ello. Los pasos a dar para actualizar el "Solaris 10 Companion" en "caliente" son: (se describen perfectamente en el "README" del CD)
[root@tesalia tmp]# cat sol-10-u7-companion-ga.cfg mail= conflict=nocheck setuid=nocheck action=nocheck partial=nocheck instance=overwrite idepend=nocheck rdepend=nocheck space=check [root@tesalia tmp]# lofiadm -a /tmp/sol-10-u7-companion-ga.iso /dev/lofi/1 [root@tesalia tmp]# mkdir /tmp/sol-10-u7-companion-ga [root@tesalia tmp]# mount -o ro -F hsfs /dev/lofi/1 /tmp/sol-10-u7-companion-ga [root@tesalia tmp]# cd /tmp/sol-10-u7-companion-ga/Solaris_Software_Companion/Solaris_i386/Packages [root@tesalia Packages]# pkgadd -a /tmp/sol-10-u7-companion-ga.cfg -d . [...] [root@tesalia Packages]# cd / [root@tesalia /]# umount /dev/lofi/1 [root@tesalia /]# lofiadm -d /dev/lofi/1
Más información sobre los OpenBadges
Donación BitCoin: 19niBN42ac2pqDQFx6GJZxry2JQSFvwAfS