Friday, August 03, 2007

LiveUpgrade SXCE

Using LiveUpgrade, you can minimize downtime to the time it takes your system to reboot, and save a lot more time in case things go wrong and you need to go back to the state the system was before update. With LiveUpgrade you just reboot, and select the old environment. There's also no need to burn new Solaris media, you can just mount the .iso images. There are very few requirements for performing a LiveUpgrade: a free partition or disk the size of your root needed for the alternate environment (in our case, the /altroot partition).

It's basically an interesting alternative to upgrading from the media (CD, DVD, etc) or using JumpStart.

Make sure you have the latest version on LiveUpgrade packages.
"Once the prerequisite packages are in place, the Live Upgrade packages, SUNWlur and SUNWluu, must also be installed from the version of Solaris to which the target machine is being upgraded"

See http://www.sun.com/bigadmin/features/articles/live_upgrade.html

Read the ONNV Flag Days if you're using OpenSolaris:

http://opensolaris.org/os/community/on/flag-days/

For Solaris 8 07/01 and earlier, 7 and 2.6 you need to download LiveUpgrade 2 from:

http://www.sun.com/software/solaris/liveupgrade/

While LU 2 is integrated into Solaris 9 and 8 10/01 and later it's usually best to check that page or upgrade to the latest LU.


Anyway, on with an example on how to perform a LiveUpgrade between 2 SXCE builds:

cmsol% uname -a
SunOS cmsol 5.11 snv_68 i86pc i386 i86pc

  1. Download a new SXCE DVD image from http://opensolaris.org/os/downloads/


  2. Unzip the archives:
    "for i in *.zip; do unzip $i; done; rm *zip"


  3. Concatenate the files into a iso:
    cmsol% cat sol-nv-b69-x86-dvd-iso-a sol-nv-b69-x86-dvd-iso-b sol-nv-b69-x86-dvd-iso-c > sol-nv-b69-x86-dvd.iso


  4. Check the md5 sum:
    cmsol% digest -a md5 sol-nv-b69-x86-dvd.iso
    6a760b97fe664b3670aae1cf091ebaaf
    cmsol% grep 6a76 md5sum_x86.list
    6a760b97fe664b3670aae1cf091ebaaf sol-nv-b69-x86-dvd.iso


  5. Check how the hard disk is partitioned:
    # format
    Searching for disks...done


    AVAILABLE DISK SELECTIONS:
    0. c1d0
    /pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0
    Specify disk (enter its number): 0
    selecting c1d0
    Controller working list found
    [disk formatted, defect list found]
    Warning: Current Disk has mounted partitions.
    /dev/dsk/c1d0s0 is currently mounted on /. Please see umount(1M).
    /dev/dsk/c1d0s1 is currently used by swap. Please see swap(1M).
    /dev/dsk/c1d0s3 is currently mounted on /altroot. Please see umount(1M).
    /dev/dsk/c1d0s7 is currently mounted on /export/home. Please see umount(1M).



  6. We're using the /altroot partition for LiveUpgrade. We are going to umount it first.
    # umount /dev/dsk/c1d0s3 && rmdir /altroot
  7. Edit /etc/vfstab and comment out the line that mounts /altroot
    #/dev/dsk/c1d0s3 /dev/rdsk/c1d0s3 /altroot ufs 2 yes -


  8. Create the boot environment
    # lucreate -c "SXCE1" -m /:/dev/dsk/c1d0s3:ufs -n "SXCE2"
    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 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
    is not a root device for any boot environment; cannot get BE ID.
    Creating configuration for boot environment .
    Source boot environment is .
    Creating boot environment .
    Checking for GRUB menu on boot environment .
    The boot environment does not contain the GRUB menu.
    Creating file systems on boot environment .
    Creating file system for in zone on .
    Mounting file systems for boot environment .
    Calculating required sizes of file systems for boot environment .
    Populating file systems on boot environment .
    Checking selection integrity.
    Integrity check OK.
    Populating contents of mount point
    .
    Copying.
    WARNING: The file
    contains a list of <2>
    potential problems (issues) that were encountered while populating boot
    environment .
    INFORMATION: You must review the issues listed in
    and determine if any must be resolved. In
    general, you can ignore warnings about files that were skipped because
    they did not exist or could not be opened. You cannot ignore errors such
    as directories or files that could not be created, or file systems running
    out of disk space. You must manually resolve any such problems before you
    activate boot environment .
    Creating shared file system mount points.
    Copying root of zone .
    Creating compare databases for boot environment .
    Creating compare database for file system
    .
    Updating compare databases on boot environment .
    Making boot environment bootable.
    Updating bootenv.rc on ABE .
    Population of boot environment successful.
    Creation of boot environment successful.
    #




  9. Mount the DVD .iso image:
    # mkdir /mnt/iso
    # lofiadm -a /export/home/cmihai/iso/sol-nv-b69-x86-dvd.iso
    # mount -F hsfs /dev/lofi/1 /mnt/iso


  10. Initiate the LiveUpgrade process using the mounted iso image:
    # luupgrade -u -n SXCE2 -s /mnt/iso/

    Copying failsafe kernel from media.
    Uncompressing miniroot
    Creating miniroot device
    miniroot filesystem is
    Mounting miniroot at

    Validating the contents of the media .
    The media is a standard Solaris media.
    The media contains an operating system upgrade image.
    The media contains version <11>.
    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 .
    Checking for GRUB menu on ABE .
    Checking for x86 boot partition on ABE.
    Determining packages to install or upgrade for BE .
    Performing the operating system upgrade of the BE .
    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.
    Deleted empty GRUB menu on ABE .
    Adding operating system patches to the BE .
    The operating system patch installation is complete.
    ABE boot partition backing deleted.
    Configuring failsafe for system.
    Failsafe configuration is complete.
    INFORMATION: The file on boot
    environment contains a log of the upgrade operation.
    INFORMATION: The file on boot
    environment contains a log of cleanup operations required.
    INFORMATION: Review the files listed above. Remember that all of the files
    are located on boot environment . Before you activate boot
    environment , 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 is complete.
    Installing failsafe
    Failsafe install is complete.


  11. Activate the new boot environment:
    luactivate SXCE2

    Saving latest GRUB loader.
    Generating partition and slice information for ABE
    Boot menu exists.
    Generating direct boot menu entries for ABE.
    Generating direct boot menu entries for PBE.

    **********************************************************************

    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. Do *not* change *hard* disk order in the BIOS.

    2. Boot from the Solaris Install CD or Network and bring the system to
    Single User mode.

    3. Mount the Parent boot environment root slice to some directory (like
    /mnt). You can use the following command to mount:

    mount -Fufs /dev/dsk/c1d0s0 /mnt

    4. Run utility with out any arguments from the Parent boot
    environment root slice, as shown below:

    /mnt/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
    GRUB menu is on device:
    .
    Filesystem type for menu device: .
    Activation of boot environment successful.


  12. Reboot (don't use "reboot").
    # init 6


    You should now boot into the new environment (SXCE 69 in this case).
cmsol% uname -a
SunOS cmsol 5.11 snv_69 i86pc i386 i86pc

Reading material:

0 comments: