Vous êtes sur la page 1sur 9

Solaris Live Upgrade

What Is It? Live upgrade is a feature of Solaris that allows the operating system to be cloned to an offline partition(s) or disk, which can then be upgraded with new OS patches, software, or even a new version of the operating system. Then reboot the system on the newly upgraded partition. In case of problems, it is easy to revert back to the original environment via a single live upgrade command followed by a reboot. How It Works? Create a copy of the system environment; that is, a copy of the root (/) file system on another partition(s) or another disk. Apply changes (whether OS upgrade, patches, or other changes) to that copyinstead of to the current system environment. The software that applies the changes to the copy runs as a background task on your production server. Boot to the new environment and assess the impact of the changes. If you are satisfied with the new environment, you are done. If you encountered problems with the new environment, reboot to the original environment.

What are the advantages? All the tasks except reboot can be performed on an operational operating system i.e. reduced downtime. If something goes wrong, can reboot to original environment and the system is up i.e. reduced risk.

What are the commands? lucreate - To create a copy of active boot environment. lustatus - To check state of boot environment. lumount - To mount inactive boot environment. luumount - To umount inactive boot environment. luupgrade - To installs, upgrades, and performs other

functions on software on

a boot environment.
luactivate - To activate a boot environment.

Can you give one example? Yes, this example will explain how to upgrade from Solaris 9 to Solaris 10 for CRS upgrade using root mirror. 1. Begin by logging into the root account.

You must apply a few key patches before using Solaris Live Upgrade. See Technical Instruction 206844 from SunSolve (sun.com/sunsolve), which describes the Solaris Live Upgrade SPARC or X86 patches required for each Solaris release. For CRS upgrade we used patch 137477-01.
# cp /cdrom/cdrom0/137477-01.zip /tmp # cd /tmp # unzip 137477-01.zip
Archive: 137477-01.zip creating: 137477-01/ inflating: 137477-01/.diPatch inflating: 137477-01/patchinfo creating: 137477-01/SUNWbzip/ inflating: 137477-01/SUNWbzip/pkgmap inflating: 137477-01/SUNWbzip/pkginfo creating: 137477-01/SUNWbzip/install/ inflating: 137477-01/SUNWbzip/install/checkinstall inflating: 137477-01/SUNWbzip/install/copyright inflating: 137477-01/SUNWbzip/install/i.none inflating: 137477-01/SUNWbzip/install/patch_checkinstall inflating: 137477-01/SUNWbzip/install/patch_postinstall inflating: 137477-01/SUNWbzip/install/postinstall inflating: 137477-01/SUNWbzip/install/preinstall inflating: 137477-01/SUNWbzip/install/u.none creating: 137477-01/SUNWbzip/reloc/ creating: 137477-01/SUNWbzip/reloc/usr/ creating: 137477-01/SUNWbzip/reloc/usr/bin/ inflating: 137477-01/SUNWbzip/reloc/usr/bin/7z inflating: 137477-01/SUNWbzip/reloc/usr/bin/7za inflating: 137477-01/SUNWbzip/reloc/usr/bin/7zr inflating: 137477-01/SUNWbzip/reloc/usr/bin/p7zip creating: 137477-01/SUNWbzip/reloc/usr/lib/ creating: 137477-01/SUNWbzip/reloc/usr/lib/7z/ inflating: 137477-01/SUNWbzip/reloc/usr/lib/7z/7z.so creating: 137477-01/SUNWbzip/reloc/usr/lib/7z/Codecs/ inflating: 137477-01/SUNWbzip/reloc/usr/lib/7z/Codecs/Rar29.so creating: 137477-01/SUNWsfman/ inflating: 137477-01/SUNWsfman/pkgmap inflating: 137477-01/SUNWsfman/pkginfo creating: 137477-01/SUNWsfman/install/ inflating: 137477-01/SUNWsfman/install/checkinstall inflating: 137477-01/SUNWsfman/install/copyright inflating: 137477-01/SUNWsfman/install/i.none inflating: 137477-01/SUNWsfman/install/patch_checkinstall inflating: 137477-01/SUNWsfman/install/patch_postinstall inflating: 137477-01/SUNWsfman/install/postinstall inflating: 137477-01/SUNWsfman/install/preinstall inflating: 137477-01/SUNWsfman/install/u.none creating: 137477-01/SUNWsfman/reloc/ creating: 137477-01/SUNWsfman/reloc/usr/ creating: 137477-01/SUNWsfman/reloc/usr/share/ creating: 137477-01/SUNWsfman/reloc/usr/share/man/ creating: 137477-01/SUNWsfman/reloc/usr/share/man/man1/ inflating: 137477-01/SUNWsfman/reloc/usr/share/man/man1/7z.1 inflating: 137477-01/SUNWsfman/reloc/usr/share/man/man1/7za.1 inflating: 137477-01/SUNWsfman/reloc/usr/share/man/man1/7zr.1 inflating: 137477-01/SUNWsfman/reloc/usr/share/man/man1/p7zip.1 inflating: 137477-01/README.137477-01 inflating: 137477-01/LEGAL_LICENSE.TXT

# patchadd 137477-01

Checking installed patches... Verifying sufficient filesystem capacity (dry run method)... Installing patch packages... Patch number 137477-01 has been successfully installed. See /var/sadm/patch/137477-01/log for details Patch packages installed: SUNWbzip SUNWsfman

2. Install the Solaris Live Upgrade package from the release to which you are upgrading . Install

latest live upgrade package using liveupgrade20 script.


# cd /cdrom/cdrom0/s0/Solaris_10/Tools/Installers # ./liveupgrade20 -noconsole nodisplay
Sun Microsystems, Inc. Binary Code License Agreement Live Upgrade READ THE TERMS OF THIS AGREEMENT AND ANY PROVIDED SUPPLEMENTAL LICENSE TERMS (COLLECTIVELY "AGREEMENT") CAREFULLY BEFORE OPENING THE SOFTWARE MEDIA PACKAGE. BY OPENING THE SOFTWARE MEDIA PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCESSING THE SOFTWARE ELECTRONICALLY, INDICATE YOUR ACCEPTANCE OF THESE TERMS BY SELECTING THE "ACCEPT" BUTTON AT THE END OF THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL THESE TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR PLACE OF PURCHASE FOR A REFUND OR, IF THE SOFTWARE IS ACCESSED ELECTRONICALLY, SELECT THE "DECLINE" BUTTON AT THE END OF THIS AGREEMENT. 1. LICENSE TO USE. Sun grants you a non-exclusive and non-transferable license for the internal use only of the accompanying software and documentation and any error corrections provided by Sun (collectively "Software"), by the number of users and the class of computer hardware for which the corresponding fee has been paid. 2. RESTRICTIONS Software is confidential and copyrighted. Title to Software and all associated intellectual property rights is retained by Sun and/or its licensors. Except as specifically authorized in any Supplemental License Terms, you may not make copies of Software, other than a single copy of Software for archival purposes. Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software. Software is not designed or licensed for use in on-line control of aircraft, air traffic, aircraft navigation or aircraft communications; or in the design, construction, operation or maintenance of any nuclear facility. You warrant that you will not use Software for these purposes. You may not publish or provide the results of any benchmark or comparison tests run on Software to any third party without the prior written consent of Sun. No right, title or interest in or to any trademark, service mark, logo or trade name of Sun or its licensors is granted under this Agreement. 3. LIMITED WARRANTY. Sun warrants to you that for a period of ninety (90) days from the date of purchase, as evidenced by a copy of the receipt, the media on which Software is furnished

(if any) will be free of defects in materials and workmanship under normal use. Except for the foregoing, Software is provided "AS IS". Your exclusive remedy and Sun's entire liability under this limited warranty will be at Sun's option to replace Software media or refund the fee paid for Software. 4. DISCLAIMER OF WARRANTY. UNLESS SPECIFIED IN THIS AGREEMENT, ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. 5. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event will Sun's liability to you, whether in contract, tort (including negligence), or otherwise, exceed the amount paid by you for Software under this Agreement. The foregoing limitations will apply even if the above stated warranty fails of its essential purpose. 6. Termination. This Agreement is effective until terminated. You may terminate this Agreement at any time by destroying all copies of Software. This Agreement will terminate immediately without notice from Sun if you fail to comply with any provision of this Agreement. Upon Termination, you must destroy all copies of Software. 7. Export Regulations. All Software and technical data delivered under this Agreement are subject to US export control laws and may be subject to export or import regulations in other countries. You agree to comply strictly with all such laws and regulations and acknowledge that you have the responsibility to obtain such licenses to export, re-export, or import as may be required after delivery to you. 8. U.S. Government Restricted Rights. Use, duplication, or disclosure by the U.S. Government is subject to restrictions set forth in this Agreement and as provided in DFARS 227.7202-1 (a) and 227.7202-3(a) (1995), DFARS 252.227-7013 (c)(1)(ii)(Oct 1988), FAR 12.212 (a) (1995), FAR 52.227-19 (June 1987), or FAR 52.227-14(ALT III) (June 1987), as applicable. 9. Governing Law. Any action related to this Agreement will be governed by California law and controlling U.S. federal law. No choice of law rules of any jurisdiction will apply. 10. Severability. If any provision of this Agreement is held to be unenforceable, This Agreement will remain in effect with the provision omitted, unless omission would frustrate the intent of the parties, in which case this Agreement will immediately terminate. 11. Integration. This Agreement is the entire agreement between you and Sun relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification of this Agreement will be binding, unless in writing and signed by an authorized representative of each party.

For inquiries please contact: Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. Sun Microsystems, Inc. Supplemental Terms for Live Upgrade These terms and conditions for Live Upgrade supplement the terms of the Binary Code License Agreement ("BCL"). Capitalized terms not defined herein will have the meanings ascribed to them in the BCL. These terms and conditions will supersede any inconsistent or conflicting terms and conditions in the BCL. A.Source Code. Software may contain source code that, unless expressly licensed for other purposes, is provided solely for reference purposes pursuant to the terms of this Agreement. Source code may not be redistributed unless expressly provided for in this Agreement. B.Third Party Code. Additional copyright notices and license terms applicable to portions of the Software are set forth in the THIRDPARTYLICENSEREADME.txt file. In addition to any terms and conditions of any third party opensource/freeware license identified in the THIRDPARTYLICENSEREADME.txt file, the disclaimer of warranty and limitation of liability provisions in paragraphs 5 and 6 of the Binary Code License Agreement shall apply to all Software in this distribution. C.Termination for Infringement. Either party may terminate this Agreement immediately should any Software become, or in either party's opinion be likely to become, the subject of a claim of infringement of any intellectual property right. For inquiries please contact: Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A.

3. Break the mirror and de-encapsulate the root disk. 4. Run lucreate command to create inactive copy of active boot environment.
# lucreate -m /:/dev/dsk/c1t0d0s0:ufs -m -:/dev/dsk/c1t0d0s1:swap -m /opt:/dev/dsk/c1t0d0s5:ufs -n fd2abe
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. No name for current boot environment. INFORMATION: The current boot environment is not named - assigning name <c1t1d0s0>. Current boot environment is named <c1t1d0s0>. Creating initial configuration for primary boot environment <c1t1d0s0>. The device </dev/dsk/c1t1d0s0> is not a root device for any boot environment; cannot get BE ID. PBE configuration successful: PBE name <c1t1d0s0> PBE Boot Device </dev/dsk/c1t1d0s0>. Comparing source boot environment <c1t1d0s0> 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

44% complete

113% complete

165% complete

Updating system configuration files. The device </dev/dsk/c1t0d0s0> is not a root device for any boot environment; cannot get BE ID. Creating configuration for boot environment <fd2abe>. Source boot environment is <c1t1d0s0>. Creating boot environment <fd2abe>. Creating file systems on boot environment <fd2abe>. Creating <ufs> file system for </> in zone <global> on </dev/dsk/c1t0d0s0>. Creating <ufs> file system for </opt> in zone <global> on </dev/dsk/c1t0d0s5>. Mounting file systems for boot environment <fd2abe>. Calculating required sizes of file systems for boot environment <fd2abe>. Populating file systems on boot environment <fd2abe>. Checking selection integrity. Integrity check OK. Populating contents of mount point </>. Populating contents of mount point </opt>. Copying. Creating shared file system mount points. Creating compare databases for boot environment <fd2abe>. Creating compare database for file system </>. Updating compare databases on boot environment <fd2abe>. Making boot environment <fd2abe> bootable. Population of boot environment <fd2abe> successful. Creation of boot environment <fd2abe> successful.

5. Now use lustatus to check the state of boot environments.


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

-------------------------- -------c1t1d0s0 fd2abe yes yes

6. To upgrade to a new Solaris release, you will use the luupgrade command with the -u option. The -s option identifies the path to the media.
# luupgrade -u -n fd2abe -s /cdrom
42092 blocks miniroot filesystem is <lofs> Mounting miniroot at </cdrom/Solaris_10/Tools/Boot> Validating the contents of the media </cdrom>. 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 <fd2abe>. Determining packages to install or upgrade for BE <fd2abe>. Performing the operating system upgrade of the BE <fd2abe>. CAUTION: Interrupting this process may leave the boot environment unstable or unbootable. Upgrading Solaris: 1% completed Upgrading Solaris: 2% completed Upgrading Solaris: 3% completed Upgrading Solaris: 4% completed Upgrading Solaris: 5% completed Upgrading Solaris: 6% completed

Upgrading Solaris: 7% completed Upgrading Solaris: 8% completed Upgrading Solaris: 9% completed Upgrading Solaris: 10% completed Upgrading Solaris: 11% completed Upgrading Solaris: 12% completed Upgrading Solaris: 13% completed Upgrading Solaris: 14% completed Upgrading Solaris: 15% completed Upgrading Solaris: 16% completed Upgrading Solaris: 17% completed Upgrading Solaris: 18% completed Upgrading Solaris: 19% completed Upgrading Solaris: 20% completed Upgrading Solaris: 21% completed Upgrading Solaris: 22% completed Upgrading Solaris: 23% completed Upgrading Solaris: 24% completed Upgrading Solaris: 25% completed Upgrading Solaris: 26% completed Upgrading Solaris: 27% completed Upgrading Solaris: 28% completed Upgrading Solaris: 29% completed Upgrading Solaris: 30% completed Upgrading Solaris: 31% completed Upgrading Solaris: 32% completed Upgrading Solaris: 33% completed Upgrading Solaris: 34% completed Upgrading Solaris: 35% completed Upgrading Solaris: 36% completed Upgrading Solaris: 37% completed Upgrading Solaris: 38% completed Upgrading Solaris: 39% completed Upgrading Solaris: 40% completed Upgrading Solaris: 41% completed Upgrading Solaris: 42% completed Upgrading Solaris: 43% completed Upgrading Solaris: 44% completed Upgrading Solaris: 45% completed Upgrading Solaris: 46% completed Upgrading Solaris: 47% completed Upgrading Solaris: 48% completed Upgrading Solaris: 49% completed Upgrading Solaris: 50% completed Upgrading Solaris: 51% completed Upgrading Solaris: 52% completed Upgrading Solaris: 53% completed Upgrading Solaris: 54% completed Upgrading Solaris: 55% completed Upgrading Solaris: 56% completed Upgrading Solaris: 57% completed Upgrading Solaris: 58% completed Upgrading Solaris: 59% completed Upgrading Solaris: 60% completed Upgrading Solaris: 61% completed Upgrading Solaris: 62% completed Upgrading Solaris: 63% completed Upgrading Solaris: 64% completed Upgrading Solaris: 65% completed Upgrading Solaris: 66% completed Upgrading Solaris: 67% completed Upgrading Solaris: 68% completed Upgrading Solaris: 69% completed Upgrading Solaris: 70% completed Upgrading Solaris: 71% completed Upgrading Solaris: 72% completed Upgrading Solaris: 73% completed Upgrading Solaris: 74% completed Upgrading Solaris: 75% completed Upgrading Solaris: 76% completed

Upgrading Solaris: 77% completed Upgrading Solaris: 78% completed Upgrading Solaris: 79% completed Upgrading Solaris: 80% completed Upgrading Solaris: 81% completed Upgrading Solaris: 82% completed Upgrading Solaris: 83% completed Upgrading Solaris: 84% completed Upgrading Solaris: 85% completed Upgrading Solaris: 86% completed Upgrading Solaris: 87% completed Upgrading Solaris: 88% completed Upgrading Solaris: 89% completed Upgrading Solaris: 90% completed Upgrading Solaris: 91% completed Upgrading Solaris: 92% completed Upgrading Solaris: 93% completed Upgrading Solaris: 94% completed Upgrading Solaris: 95% completed Upgrading Solaris: 96% completed Upgrading Solaris: 97% completed Upgrading Solaris: 98% completed Upgrading Solaris: 99% completed Upgrading Solaris: 100% completed Installation of the packages from this media is complete. Updating package information on boot environment <fd2abe>. Package information successfully updated on boot environment <fd2abe>. Adding operating system patches to the BE <fd2abe>. The operating system patch installation is complete. INFORMATION: The file </var/sadm/system/logs/upgrade_log> on boot environment <fd2abe> contains a log of the upgrade operation. INFORMATION: The file </var/sadm/system/data/upgrade_cleanup> on boot environment <fd2abe> contains a log of cleanup operations required. INFORMATION: Review the files listed above. Remember that all of the files are located on boot environment <fd2abe>. Before you activate boot environment <fd2abe>, 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 <fd2abe> is complete.

7. If

upgrade is successful, activate the new boot environment after reboot using luactivate.
# luactivate -s fd2abe

A Live Upgrade Sync operation will be performed on startup of boot environment <fd2abe>.

********************************************************************** 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. Change the boot device back to the original boot environment by typing: setenv boot-device vx-rootdisk 3. Boot to the original boot environment by typing: boot ********************************************************************** Modifying boot archive service Activation of boot environment <fd2abe> successful.

8. This can be confirmed using lustatus.


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

-------------------------- -------c1t1d0s0 yes

yes no -

fd2abe
9. Reboot

yes the system.

no

You have now succeeded in upgrading to Solaris 10.

Final Notes: 1. The best strategy is to review Chapter 7, "Solaris Live Upgrade (Planning)" in the "Solaris 10 Installation Guide: Solaris Live Upgrade and Upgrade Planning" document available from docs.sun.com. 2. The example used doesnt show the complete process of CRS upgrade from CP6 to FD2. FD2 havent been released. I had done these tests as part of my UMI assignment in PDU.

Vous aimerez peut-être aussi