Últimos Cambios |
||
Blog personal: El hilo del laberinto |
Última Actualización: 16 de octubre de 2011
En este documento abundo en mi experiencia con "Live Upgrade". En este caso describo la migración de Solaris 10 Update 9 (09/10) a Solaris 10 Update 10 (08/11).
Para comprender completamente este documento, habría que leerse los artículos anteriores sobre este tema. Para ir limpiando el asunto sólo enlazo a la actualización anterior. Recomiendo leer toda la serie sobre "Live Upgrade":
La nueva actualización de Solaris es bastante "light", aunque algunos usuarios encontrarán cambios valiosos: Varias mejoras en ZFS (ZFS root flash archive, el impagable "zfs diff", gestión de "system properties", importación de "zpool" aunque falte el dispositivo ZIL, podemos importar un "zpool" como "read-only", configuración de la "durabilidad" -en el sentido de la "D" en RAID- de las escrituras en cada "dataset", cambios -algunos controvertidos- en la gestión de ACLs en ZFS), soporte para máquinas con más de 2TB de RAM, mejoras de escalabilidad en la librería libmtmalloc, soporte de Intel AVX (extensiones SSE de 256 bits), mejoras en Intimate Shared Memory (ISM), soporte de IPV6 en el NAT, nuevos drivers, y mejora en varios de los viejos sobre todo la parte de drivers de red.
En el año transcurrido desde la última actualización, he limpiado bastante mi configuración Solaris, para que estas actualizaciones sean lo más simples e indoloras posibles. Ésta es la prueba de fuego. A ver cómo va.
Recordemos que la gran ventaja de usar "Live Upgrade" es:
Los pasos para actualizar nuestro sistema mediante "Live Upgrade" son los siguientes:
# lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status -------------------------- -------- ------ --------- ------ ---------- Solaris10u9 yes yes yes no - Solaris10u9INICIAL yes no no yes - # ludelete Solaris10u9INICIAL System has findroot enabled GRUB Checking if last BE on any disk... BE <Solaris10u9INICIAL> is not the last BE on any disk. No entry for BE <Solaris10u9INICIAL> in 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. Boot environment <Solaris10u9INICIAL> deleted. # lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status -------------------------- -------- ------ --------- ------ ---------- Solaris10u9 yes yes yes no -
A continuación clonamos el BE actual, para poder actualizarlo:
# time lucreate -n Solaris10u10 Checking GRUB menu... System has findroot enabled GRUB Analyzing system configuration. Comparing source boot environment <Solaris10u9> 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 <Solaris10u10>. Source boot environment is <Solaris10u9>. Creating boot environment <Solaris10u10>. Cloning file systems from boot environment <Solaris10u9> to create boot environment <Solaris10u10>. Creating snapshot for <datos/ROOT/Solaris10u9> on <datos/ROOT/Solaris10u9@Solaris10u10>. Creating clone for <datos/ROOT/Solaris10u9@Solaris10u10> on <datos/ROOT/Solaris10u10>. Setting canmount=noauto for </> in zone <global> on <datos/ROOT/Solaris10u10>. Creating snapshot for <datos/ROOT/Solaris10u9/var> on <datos/ROOT/Solaris10u9/var@Solaris10u10>. Creating clone for <datos/ROOT/Solaris10u9/var@Solaris10u10> on <datos/ROOT/Solaris10u10/var>. Setting canmount=noauto for </var> in zone <global> on <datos/ROOT/Solaris10u10/var>. Creating snapshot for <datos/ROOT/Solaris10u9/zones> on <datos/ROOT/Solaris10u9/zones@Solaris10u10>. Creating clone for <datos/ROOT/Solaris10u9/zones@Solaris10u10> on <datos/ROOT/Solaris10u10/zones>. Setting canmount=noauto for </zones> in zoneon <datos/ROOT/Solaris10u10/zones>. Creating snapshot for <datos/ROOT/Solaris10u9/zones/stargate> on <datos/ROOT/Solaris10u9/zones/stargate@Solaris10u10>. Creating clone for <datos/ROOT/Solaris10u9/zones/stargate@Solaris10u10> on <datos/ROOT/Solaris10u10/zones/stargate-Solaris10u10>. Creating snapshot for <datos/ROOT/Solaris10u9/zones/babylon5> on <datos/ROOT/Solaris10u9/zones/babylon5@Solaris10u10>. Creating clone for <datos/ROOT/Solaris10u9/zones/babylon5@Solaris10u10> on <datos/ROOT/Solaris10u10/zones/babylon5-Solaris10u10>. Saving existing file </boot/grub/menu.lst> in top level dataset for BE <Solaris10u10> 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 <Solaris10u10> in GRUB menu Population of boot environment <Solaris10u10> successful. Creation of boot environment <Solaris10u10> successful. real 0m16.620s user 0m2.254s sys 0m4.140s # lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status -------------------------- -------- ------ --------- ------ ---------- Solaris10u9 yes yes yes no - Solaris10u10 yes no no yes -
Como puede verse, el clonado del BE actual, si estamos bajo ZFS, lleva apenas unos pocos segundos.
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:
# lofiadm -a /tmp/sol-10-u10-ga2-x86-dvd.iso /dev/lofi/1 # mkdir /tmp/sol-10-u10-ga2-x86-dvd # mount -o ro -F hsfs /dev/lofi/1 /tmp/sol-10-u10-ga2-x86-dvd # time luupgrade -n Solaris10u10 -u -s /tmp/sol-10-u10-ga2-x86-dvd System has findroot enabled GRUB No entry for BE <Solaris10u10> in GRUB menu Copying failsafe kernel from media. 62128 blocks miniroot filesystem is <lofs> Mounting miniroot at </tmp/sol-10-u10-ga2-x86-dvd/Solaris_10/Tools/Boot> INFORMATION: Auto Registration already done for this BE <Solaris10u10>. Validating the contents of the media </tmp/sol-10-u10-ga2-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 <Solaris10u10>. Checking for GRUB menu on ABE <Solaris10u10>. Saving GRUB menu on ABE <Solaris10u10>. Checking for x86 boot partition on ABE. Determining packages to install or upgrade for BE <Solaris10u10>. Performing the operating system upgrade of the BE <Solaris10u10>. 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. Updating package information on boot environment . Package information successfully updated on boot environment . Adding operating system patches to the BE . 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. INFORMATION: The file </var/sadm/system/logs/upgrade_log> on boot environment <Solaris10u10> contains a log of the upgrade operation. INFORMATION: The file </var/sadm/system/data/upgrade_cleanup> on boot environment <Solaris10u10> contains a log of cleanup operations required. WARNING: <1> packages failed to install properly on boot environment <Solaris10u10>. INFORMATION: The file </var/sadm/system/data/upgrade_failed_pkgadds> on boot environment <Solaris10u10> 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 <Solaris10u10>. Before you activate boot environment <Solaris10u10>, 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 <Solaris10u10> is partially complete. Creating miniroot device Configuring failsafe for system. Failsafe configuration is complete. Installing failsafe Failsafe install is complete. real 21m50.191s user 4m58.160s sys 3m18.215s # umount /tmp/sol-10-u9-ga-x86-dvd # lofiadm -d /dev/lofi/1
El comentario sobre "CAUTION: Interrupting this process may leave the boot environment unstable or unbootable." se refiere al nuevo BE (el que estamos actualizando a Solaris 10 Update 10), no al BE actualmente en ejecución. Es decir, la actualización es segura. Si hay problemas, simplemente borramos el BE nuevo y volvemos a probar.
La actualización es rápida, menos de 22 minutos, durante los cuales la máquina sigue en producción.
No obstante falla la actualización de un paquete. Veamos cual es e intentemos instalarlo a mano, para ver los errores:
# lumount Solaris10u10 /.alt.Solaris10u10 # cat /.alt.Solaris10u10/var/sadm/system/data/upgrade_failed_pkgadds SUNWscpr # luumount Solaris10u10 # luupgrade -p -n Solaris10u10 -s /tmp/sol-10-u10-ga2-x86-dvd/Solaris_10/Product SUNWscpr [...] /a/home[ verifying class <none> ] ERROR: attribute verification of </a/home> failed [...]
El error lo hemos encontrado ya con anterioridad. En pocas palabras, la actualización intenta modificar los permisos del "/home" del nuevo BE. Adopto la misma solución que en la actualización anterior: modificar el manifiesto. Que conste que sigo considerando esto un bug de este paquete, no veo por qué necesita acceder a "/home". De hecho elimino ese acceso y todo funciona...
Porque soy así de chulo, en vez de instalar únicamente este paquete modificado, como en la actualización anterior, voy a modificar el paquete y volver a realizar la actualización entera:
# ludelete Solaris10u10 System has findroot enabled GRUB Checking if last BE on any disk... BE <Solaris10u10> is not the last BE on any disk. No entry for BE <Solaris10u10> in 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. Boot environment <Solaris10u10> deleted. # cp -a sol-10-u10-ga2-x86-dvd sol10u10 (Editamos el fichero "/tmp/sol10u10/Solaris_10/Product/SUNWscpr/pkgmap" y eliminamos la linea que referencia a "home") # lucreate -n Solaris10u10 [...] # time luupgrade -n Solaris10u10 -u -s /tmp/sol10u10/ [...] INFORMATION: The file </var/sadm/system/logs/upgrade_log> on boot environment <Solaris10u10> contains a log of the upgrade operation. INFORMATION: The file </var/sadm/system/data/upgrade_cleanup> on boot environment <Solaris10u10> contains a log of cleanup operations required. INFORMATION: Review the files listed above. Remember that all of the files are located on boot environment <Solaris10u10>. Before you activate boot environment <Solaris10u10>, 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 <Solaris10u10> is complete. Creating miniroot device Configuring failsafe for system. Failsafe configuration is complete. Installing failsafe Failsafe install is complete. real 24m51.211s user 4m59.709s sys 3m41.149s
Ahora la actualización se completa sin ningún problema.
Ya solo queda activar el nuevo BE y reiniciar la máquina:
# lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status -------------------------- -------- ------ --------- ------ ---------- Solaris10u9 yes yes yes no - Solaris10u10 yes no no yes - # luactivate Solaris10u10 System has findroot enabled GRUB Generating boot-sign, partition and slice information for PBE <Solaris10u9> A Live Upgrade Sync operation will be performed on startup of boot environment <Solaris10u10>. Generating boot-sign for ABE <Solaris10u10> Saving existing file in top level dataset for BE <Solaris10u10> as <mount-point>//etc/bootsign.prev. Generating partition and slice information for ABE <Solaris10u10> 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 the Solaris failsafe or boot in Single User mode from Solaris Install CD or Network. 2. Mount the Parent boot environment root slice to some directory (like /mnt). You can use the following commands in sequence to mount the BE: zpool import datos zfs inherit -r mountpoint datos/ROOT/Solaris10u9 zfs set mountpoint=<mountpointName> datos/ROOT/Solaris10u9 zfs mount datos/ROOT/Solaris10u9 3. Run <luactivate> utility with out any arguments from the Parent boot environment root slice, as shown below: <mountpointName>/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 <Solaris10u10> successful. # lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status -------------------------- -------- ------ --------- ------ ---------- Solaris10u9 yes yes no no - Solaris10u10 yes no yes no -# # init 6
Una vez reiniciados, comprobamos que estamos ejecutando la versión correcta:
# cat /etc/release Oracle Solaris 10 8/11 s10x_u10wos_17b X86 Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved. Assembled 23 August 2011 # lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status -------------------------- -------- ------ --------- ------ ---------- Solaris10u9 yes no no yes - Solaris10u10 yes yes yes no -
Los cambios más reseñables respecto a la anterior actualización son:
Una vez que pasan unos días y vemos que todo funciona sin problemas, queremos aprovechar todas las mejoras de la nueva versión de Solaris. En particular las mejoras en ZFS:
# lucreate -n Solaris10u10BACKUP Checking GRUB menu... System has findroot enabled GRUB Analyzing system configuration. Updating boot environment description database on all BEs. Updating system configuration files. Creating configuration for boot environment <Solaris10u10BACKUP>. Source boot environment is <Solaris10u10>. Creating file systems on boot environment <Solaris10u10BACKUP>. Populating file systems on boot environment <Solaris10u10BACKUP>. Analyzing zones. Duplicating ZFS datasets from PBE to ABE. Creating snapshot for <datos/ROOT/Solaris10u10> on <datos/ROOT/Solaris10u10@Solaris10u10BACKUP>. Creating clone for <datos/ROOT/Solaris10u10@Solaris10u10BACKUP> on <datos/ROOT/Solaris10u10BACKUP>. Creating snapshot for <datos/ROOT/Solaris10u10/var> on <datos/ROOT/Solaris10u10/var@Solaris10u10BACKUP>. Creating clone for <datos/ROOT/Solaris10u10/var@Solaris10u10BACKUP> on <datos/ROOT/Solaris10u10BACKUP/var>. Creating snapshot for <datos/ROOT/Solaris10u10/zones> on <datos/ROOT/Solaris10u10/zones@Solaris10u10BACKUP>. Creating clone for <datos/ROOT/Solaris10u10/zones@Solaris10u10BACKUP> on <datos/ROOT/Solaris10u10BACKUP/zones>. Mounting ABE <Solaris10u10BACKUP>. Generating file list. Finalizing ABE. Fixing zonepaths in ABE. Unmounting ABE <Solaris10u10BACKUP>. Fixing properties on ZFS datasets in ABE. Reverting state of zones in PBE <Solaris10u10>. Making boot environment <Solaris10u10BACKUP> bootable. Updating bootenv.rc on ABE <Solaris10u10BACKUP>. Saving existing file </boot/grub/menu.lst> in top level dataset for BE <Solaris10u10BACKUP> as <mount-point>//boot/grub/menu.lst.prev. Saving existing file </boot/grub/menu.lst> in top level dataset for BE <Solaris10u9> 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 <Solaris10u10BACKUP> in GRUB menu Population of boot environment <Solaris10u10BACKUP> successful. Creation of boot environment <Solaris10u10BACKUP> successful. # lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status -------------------------- -------- ------ --------- ------ ---------- Solaris10u9 yes no no yes - Solaris10u10 yes yes yes no - Solaris10u10BACKUP yes no no yes - # ludelete Solaris10u9 System has findroot enabled GRUB Checking if last BE on any disk... BE <Solaris10u9> 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 <Solaris10u10> as <mount-point>//boot/grub/menu.lst.prev. File </etc/lu/GRUB_backup_menu> propagation successful Successfully deleted entry from GRUB menu Updating boot environment configuration database. Updating boot environment description database on all BEs. Updating all boot environment configuration databases. # lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status -------------------------- -------- ------ --------- ------ ---------- Solaris10u10 yes yes yes no - Solaris10u10BACKUP yes no no yes - # zpool upgrade -a This system is currently running ZFS pool version 29. Successfully upgraded 'datos' # zfs upgrade -a 77 filesystems upgraded # init 6
El primer paso es crear un "backup" del BE actual, por si alguna actualización futura es problemática. El siguiente paso consiste en eliminar el BE antiguo (Solaris 10 Update 9), porque no podrá arrancar la máquina, al no soportar esta nueva versión de ZFS.
Por último, actualizamos el "zpool" y los "datasets", y reiniamos el equipo. Nos interesa reiniciar para asegurarnos de que la versión de GRUB que tenemos soporta esta versión de ZFS, ya que se supone que la actualizaciónd e sistema actualizó también el GRUB, pero he tenido problemas al respecto en el pasado.
Aparte de solucionar bugs, etc, ¿qué mejoras tenemos en ZFS?. Recomiendo leerse con atención el documento de Oracle. Algunos detalles:
# zpool upgrade -v This system is currently running ZFS pool version 29. The following versions are supported: VER DESCRIPTION --- -------------------------------------------------------- 1 Initial ZFS version 2 Ditto blocks (replicated metadata) 3 Hot spares and double parity RAID-Z 4 zpool history 5 Compression using the gzip algorithm 6 bootfs pool property 7 Separate intent log devices 8 Delegated administration 9 refquota and refreservation properties 10 Cache devices 11 Improved scrub performance 12 Snapshot properties 13 snapused property 14 passthrough-x aclinherit 15 user/group space accounting 16 stmf property support 17 Triple-parity RAID-Z 18 Snapshot user holds 19 Log device removal 20 Compression using zle (zero-length encoding) 21 Reserved 22 Received properties 23 Slim ZIL 24 System attributes 25 Improved scrub stats 26 Improved snapshot deletion performance 27 Improved snapshot creation performance 28 Multiple vdev replacements 29 RAID-Z/mirror hybrid allocator For more information on a particular version, including supported releases, see the ZFS Administration Guide. # zfs upgrade -v The following filesystem versions are supported: VER DESCRIPTION --- -------------------------------------------------------- 1 Initial ZFS filesystem version 2 Enhanced directory entries 3 Case insensitive and File system unique identifier (FUID) 4 userquota, groupquota properties 5 System attributes For more information on a particular version, including supported releases, see the ZFS Administration Guide. # time zfs diff -Ft datos/backups/buffy@20110926-20:22 datos/backups/buffy@20110926-20:35 1317061842.659141598 M / /backups/buffy/root/proc 1317061812.437869058 M / /backups/buffy/root/dev/fd 1317061816.752409624 M | /backups/buffy/root/etc/saf/_sacpipe 1317061816.791269117 M | /backups/buffy/root/etc/saf/zsmon/_pmpipe 1317061817.291653834 M / /backups/buffy/root/etc/svc/volatile 1317061934.727002843 M F /backups/buffy/var/adm/lastlog 1317061934.796205623 M F /backups/buffy/var/adm/wtmpx 1317061938.764996484 M F /backups/buffy/var/ntp/ntpstats/loopstats 1317061938.978388173 M F /backups/buffy/var/ntp/ntpstats/peerstats.20110926 real 10m0.272s user 0m0.809s sys 2m6.693s
Aquí se ven algunas mejoras más o menos evidentes, incluyendo (en ZPOOL versión 24 y ZFS versión 5) que ahora los enlaces simbólicos tienen su propio objeto y, por tanto, están sujetos a la replicación adicional que se indique con el atributo "copies" de los "datasets". Ya era hora.
"zfs diff" es una mejora muy interesante, aunque he encontrado que su rendimiento es decepcionante. He abierto una consulta en la lista de correo de ZFS, a ver... El problema se debe a que tengo el sistema configurado con "atime", así que cualquier acceso a un fichero modifica su "atime" y, por tanto, ocasiona cambios en el disco, lo que frena bastante el proceso. Poniendo el atributo "atime=off" en estos datasets incrementa mi velocidad "zfs diff" en casi dos órdenes de magnitud.
Las mejoras en el rendimiento de crear y destruir snapshots se notan bastante.
Información sobre los misteriosos "system attributes".
Más información sobre los OpenBadges
Donación BitCoin: 19niBN42ac2pqDQFx6GJZxry2JQSFvwAfS