C.2 Using a ZLM Server and an ISO Image File to Upgrade

NOTE:All of the examples in this section reflect the x86_64 (64-bit) platform.

The information and instructions in the following sections help you perform an unattended, online upgrade from Open Enterprise Server (OES) 2 SP2 to OES 2 SP3 by using ZENworks Linux Management (ZLM) and an OES 2 SP3 ISO image file.

After completing the instructions in the following sections, OES 2 SP2 servers are upgraded according to the schedule you set.

C.2.1 Preparing the Environment

Before you can use ZENworks Linux Management to upgrade OES 2 SP2 servers to OES 2 SP3, you must have the following:

  • The ZENworks Linux Management 7.3 IR3 server installed and running on your network.

  • The ZENworks Linux Management 7.3 IR3 Agent installed on each OES 2 SP2 server that you plan to upgrade.

    IMPORTANT:The agent included with OES provides package-management capabilities through the ZENworks Management Daemon. Unless the full agent is installed, updates cannot be scheduled from the ZENworks Linux Management server.

  • Each OES 2 SP2 server registered with the ZENworks Linux Management server.

C.2.2 Creating OES 2 SP3 Bundles

For the upgrade process, you need to create the following bundles on the ZLM server:

OES2SP3-bundle

When you create this bundle, all of the OES 2 SP3 RPMs are added to it.

  1. Download the OES 2 SP3 ISO image for the x86_64 (64-bit) platform.

  2. Create a pkgadd.sh file and copy it to the ZLM server. For more information on the pkgadd.sh file, refer to the Creating the pkgadd.sh file.

  3. Add the execute permission to the pkgadd.sh file:

    chmod +x pkgadd.sh

  4. On the ZLM server, mount the OES 2 SP3 ISO image under the directory where you copied pkgadd.sh.

    For example, if the pkgadd.sh file is copied to the /home/user1/ directory, mount the OES 2 SP3 ISO image on /home/user1/oes2sp3/.

  5. Execute the following command:

    ./pkgadd.sh OES2SP3-bundle sles-10-x86_64

    This creates the OES2SP3-bundle for the x86_64 platform with OES 2 SP3 RPMs.

OES2SP3-file-bundle

You must create the answer file and the prereboot.sh file before executing the following steps.

  1. Log in to ZENworks Control Center.

  2. Click Bundles.

  3. In the Bundles panel, click New > Bundle.

  4. Select File Bundle, then click Next.

  5. In the Name field, type OES2SP3-file-bundle.

  6. Click Next.

    The file bundle is ready to have files added to it.

  7. Add the prereboot.sh file to OES2SP3-file-bundle:

    1. In the Files panel, click Add > Upload.

    2. In the Destination field, type /tmp.

    3. In the Target Platforms list, select sles-10-x86_64.

    4. Click Add File, browse to and select the prereboot.sh script file on your workstation or server, then click OK.

      The prereboot.sh file is set to be uploaded to the /tmp directory on each server being upgraded.

  8. Add the answer file to OES2SP3-file-bundle:

    1. In the Files panel, click Add > Upload.

    2. In the Destination field, type /opt/novell/oes-install.

    3. In the Target Platforms list, select sles-10-x86_64.

    4. Click Add File, browse to and select the answer file on your workstation or server, then click OK.

      The prereboot.sh and answer files are listed.

  9. Below the Files panel, click Next.

    An empty Scriptable Actions list is displayed.

  10. Click New.

  11. In the Scriptable Action drop-down list, select Post-Installation.

  12. In the Script to run drop-down list, select Define your own script.

  13. Copy and paste the following contents to the Script Content box:

    #!/bin/sh
    /etc/init.d/atd start
    at now + 2 minutes -f /tmp/prereboot.sh
    
  14. Click OK > Next.

  15. Click Finish > OK.

    The file bundle is created.

OES2SP3-firstboot-bundle

  1. Log in to ZENworks Control Center.

  2. Click Bundles.

  3. In the Bundles panel, click New > Bundle.

  4. Select RPM Package Bundle, then click Next.

  5. In the Name field, type OES2SP3-firstboot-bundle.

  6. Click Next.

    The file bundle is ready to have files added to it.

  7. In the Packages panel, click Import From Repository

  8. In the Search panel > Name field, type yast2-firstboot and click Search.

  9. Select RPM, then click OK.

    The yast2-firstboot rpm is available as part of the SLES10 SP4 bundle on the ZENworks Linux Management (ZLM) server. If the SLES 10 SP4 bundle is not available on the ZLM server, then copy yast2-firstboot.rpm from the SLES 10 SP4 ISO image and upload the RPM to this bundle.

  10. Click Next.

  11. Under Scriptable Actions, click New.

  12. In the Scriptable Action drop-down list, select Post-Installation.

  13. In the Script to Run drop-down list, select Define your own script.

  14. Copy and paste the contents from Section C.2.6, Post-Installation Script File to the Script Content box.

  15. Click OK > Next.

  16. Click Finish > OK.

    The post-installation script is added to the Scriptable Actions panel.

C.2.3 Assigning the Bundles and Scheduling Upgrades

Assign the bundles to the OES 2 SP2 servers, then schedule them to install appropriately.

  1. In the ZENworks Control Center, click Bundles.

  2. In the left column, select OES2SP3-bundle, OES2SP3-file-bundle, and OES2SP3-firstboot-bundle.

  3. Click Action > Assign Bundle.

  4. Click Add, click the down-arrow by Servers, then select the servers you want to upgrade.

  5. Click OK > Next.

  6. Schedule the bundles to install according to your organization’s policy.

  7. Click Next > Finish > OK.

IMPORTANT:The servers you have selected in the preceding steps are now ready to be upgraded to OES 2 SP3. The actual upgrade operations occur automatically as scheduled.

C.2.4 Creating the answer and prereboot.sh Files

answer file

For the upgrade process to run without user intervention, each SP3 server must have an eDirectory password answer file for the YaST install.

  1. As root, open a terminal prompt.

  2. At the prompt, enter the following command:

    sudo yast2 create-answer-file ldap_password optional_domain_admin_password

    Replace ldap_password with the LDAP (eDirectory) Admin password and optional_domain_admin_password with the Domain Services for Windows (DSfW) Domain Administrator password, if it is needed for any of the servers being upgraded. (The existence of a second password in the answer file does not affect the upgrade process on servers that don’t have DSfW installed.)

    IMPORTANT:All the uses of an exclamation mark (!) require that you escape the character by using a backslash (\). For example, the password novell! must be specified as novell\!.

    A dash (-) used at the beginning of a password also requires escaping. For example, -novell- must be specified as \-novell-.

  3. Press Enter to close the confirmation message.

  4. From your working directory, copy the resulting answer file to the workstation or server that you will use to create the bundles.

prereboot.sh file

The prereboot.sh script checks whether the bundles are installed. On successful installation of all bundles, it triggers a reboot.

  1. Open any text editor.

  2. Copy and paste the following text into a text editor, then save it as prereboot.sh

    #!/bin/bash
    
    status="j"
    while [ $status != "ii" ] ; do
    sleep 10
    status=i`rug bl |grep OES2SP3-bundle  |cut -f1 -d '|'`
    done
    status="j"
    while [ $status != "ii" ] ; do
    sleep 10
    status=i`rug bl |grep OES2SP3-firstboot-bundle  |cut -f1 -d '|'`
    done
    
    sleep 60
    /sbin/reboot
    

    IMPORTANT:In the above script, the bundle names are OES2SP3-bundle and OES2SP3-firstboot-bundle. If your bundle name is different, change the script accordingly. If the bundle names are inaccurate, the reboot is not triggered after installation of the bundles.

C.2.5 Creating the pkgadd.sh file

This script is used to create a bundle from an ISO image.

Usage: pkgadd.sh <bundle_name> <arch/target>

To create the pkgadd.sh file:

  1. Open any text editor.

  2. Copy and paste the following text into the text editor, then save it as pkgadd.sh.

    #!/bin/bash
    #
    # Run this program from a directory filled with RPMS to load them into a bundle in ZLM.
    #
    # All rpms, except src and nosrc rpms, in the directory and all of its subdirectories will be loaded into the bundle and architecture indicated below.
    #
    # Don't forget to enter your admin password below and update the bundle name and architecture below.
    #
    if [ $# -lt 2 ]
    
    then
    
     echo "Usage :: pkgadd.sh <bundle_name> <arch> "
    
     echo "Example :: pkgadd.sh SLES-9-Distro sles-9-i586 "
    
    exit
    
    fi
    
    # Create the bundle to load into
    
    zlman -V -U administrator -P novell bc $1
     
    # loop through these directories and load all of the rpms
    
    STARTDIR=`pwd`
    
    for dir in `find . |grep .rpm |grep -v src.rpm|grep -v nosrc.rpm|awk -F / '{NF--; OFS="/"; print $0}'| sort | uniq`; do
    
      cd $STARTDIR
    
      cd $dir
    
      echo "Loading RPM's from `pwd`"
    
      zlman -V -U administrator -P novell bap $1 $2 *.rpm --force-nevra --freshen;
    
    done
    

C.2.6 Post-Installation Script File

The following post-installation script is added to the OES 2 SP3-firstboot-bundle. See Step 14.

#!/bin/sh

touch /etc/reconfig_system
chkconfig firstboot on

cat  > /etc/YaST2/firstboot.xml << EndOfText
<?xml version="1.0"?>
<!DOCTYPE productDefines SYSTEM "/usr/share/YaST2/control/control.dtd">
<productDefines  xmlns="http://www.suse.com/1.0/yast2ns"
    xmlns:config="http://www.suse.com/1.0/configns">

    <!--
    : firstboot.xml 35106 2007-01-05 13:42:15Z jsrain $
    Work around for the text domain
    textdomain="firstboot"
    -->

    <textdomain>firstboot</textdomain>
    <workflows  config:type="list">
        <workflow>
            <defaults>
                <enable_back>yes</enable_back>
                <enable_next>yes</enable_next>
                <archs>all</archs>
            </defaults>
            <stage>firstboot</stage>
            <label>Channel Upgrade</label>
            <mode>installation</mode>
            <modules  config:type="list">
                <module>
                    <label>upgrade</label>
                    <enabled config:type="boolean">true</enabled>
                    <name>channel-upgrade-oes</name>
                </module>
            </modules>
        </workflow>
    </workflows>
</productDefines>
EndOfText