Sun N1 System Manager 1.2 Administration Guide

Managing Packages, Patches, and RPMs

The N1 System Manager enables you to perform following OS update management tasks:

The following graphic describes the order in which these tasks should be completed.

This graphic illustrates the steps to update an OS.

Introduction to Managing OS Updates

After you have installed an OS on a provisionable server, the N1 System Manager enables you to install OS updates. These OS updates consist of Solaris packages and patches and Linux RPMs.

For Solaris packages or patches, you can issue an optional parameter to install the updates by using a script. This parameter is useful for installation of a set of packages or patches that have dependencies. Use the create update command with the installscriptfile parameter to specify the script. See Example 3–16 for an example script and sample command syntax.

Installing OS updates on servers for the first time involves the following four-step process when you use the N1 System Manager:

  1. Downloading the OS update.

  2. Copying the OS update to the N1 System Manager

    The N1 System Manager must have system access to the OS update before the update can be installed on the provisionable servers.

    By using the create update command, you can import an OS update from a web site or an accessible file system on the management server. After an OS update is imported, you can display the update in the browser interface's Shortcuts pane, or you can use the show update command.

  3. Verifying that the OS update was copied by displaying the Shortcut in the browser interface or by using the show update command.

  4. Installing the OS update on the appropriate provisionable servers by using the browser interface or the load server or load group commands. The provisionable servers must have the base management feature supported.

OS update installations behave differently for every operating system because the native package installation mechanisms are used. For example, if a Solaris package is already installed on the target server, the installation might succeed without reporting an error. However, this same scenario for a Linux RPM results in an error message indicating that the package is already installed.

See OS Update Problems for troubleshooting information.

ProcedureTo Copy an OS Update

This procedure describes how to copy an OS update to the N1 System Manager. Once an OS update is copied, you can use the command line or the browser interface to install the OS update on a provisionable server.

The following graphic illustrates the use of the browser user interface for confirming that an OS update has been successful.

This graphic illustrates the two-step process used to create
and verify a new OS update.
Before You Begin

Ensure that the OS update is available to the management server on the local file system, a network accessible file, or a web site. You can copy OS updates in the following formats:


Note –

The *.tar file must match the top-level directory name after the tar expansion. For example, if the tar file is SUNWstade.tar, the top-level directory of the tar expansion must be SUNWstade.


Steps
  1. Log in to the N1 System Manager.

    See To Access the N1 System Manager Command Line for details.

  2. Copy the OS update to the N1 System Manager.


    N1-ok> create update update file file ostype ostype [adminfile adminfile]
    [responsefile responsefile] [installscriptfile installscriptfile]

    Valid ostype values are in the following list:

    • redhat-es3 Red Hat Enterprise Linux ES 3.0

    • redhat-ws3 Red Hat Enterprise Linux WS 3.0

    • redhat-as3 Red Hat Enterprise Linux, AS 3.0

    • redhat-as4 Red Hat Enterprise Linux, AS 4.0

    • redhat-es4 Red Hat Enterprise Linux, ES 4.0

    • redhat-ws4 Red Hat Enterprise Linux, WS 4.0

    • redhat-es3-64 Red Hat Enterprise Linux ES 3.0, 64-bit

    • redhat-ws3-64 Red Hat Enterprise Linux WS 3.0, 64-bit

    • redhat-as3-64 Red Hat Enterprise Linux, AS 3.0, 64-bit

    • redhat-as4-64 Red Hat Enterprise Linux, AS 4.0, 64-bit

    • redhat-es4-64 Red Hat Enterprise Linux, ES 4.0, 64-bit

    • redhat-ws4-64 Red Hat Enterprise Linux, WS 4.0, 64-bit

    • solaris9x86 Solaris x86 Version 9 Update 7

    • solaris10x86 Solaris x86 Version 10

    • solaris9sparc Solaris SPARC Version 9 Update 7

    • solaris10sparc Solaris SPARC Version 10

    • suse-es9 SUSE LINUX Enterprise Server 9

    • suse-es9-64 SUSE LINUX Enterprise Server 9, 64-bit

    • suse-pro92 SUSE Professional Edition 9.2

    • suse-pro92-64 SUSE Professional Edition 9.2, 64-bit

    • suse-pro93 SUSE Professional Edition 9.3

    • suse-pro93-64 SUSE Professional Edition 9.3, 64-bit

    See create update in Sun N1 System Manager 1.2 Command Line Reference Manual for details.


Example 3–15 Creating an OS Update Through the Command Line

The following example command shows how to create an OS update named RH3_update where the ostype is Red Hat Enterprise Linux, AS 3.0 and the location of the update file is /tmp/test-i386.rpm.


N1-ok> create update RH3_update file /tmp/test-i386.rpm ostype=redhat-as3


Example 3–16 Copying an OS Update With a Package Install Script Through the Command Line

This example shows an executable Bourne (/bin/sh) shell package installation script.

#!/bin/sh
echo "This is from the install script:"
echo "pkgadd -n -a /tmp/combo-pkgs.pkg.admin -d /tmp/combo-pkgs.pkg SUNWtest1 SUNWtest2"
pkgadd -n -a /tmp/combo-pkgs.pkg.admin -d /tmp/combo-pkgs.pkg SUNWtest1 SUNWtest2
exit $?

The following sample command shows how to associate the package installation script with the OS update files. This example assumes that you have copied the script to the management server's /tmp directory with the name install.sh.


N1-ok> create update combo file /tmp/combo-pkgs.pkg ostype solaris10x86 adminfile 
/tmp/combo-pkgs.pkg.admin installscriptfile /tmp/install.sh

In this example, /tmp/combo-pkgs.pkg contains two Solaris packages in the datastream format.

The script and the source files for the OS update are copied to the target server when the create os command is issued. The script file is executed by using the Bourne shell with the full path to the package file as the sole argument. If the adminfile subcommand is not specified, the default admin file is also copied to the target server and is renamed with .admin appended to the source file name.



Example 3–17 Copying an OS Update With a Patch Install Script Through the Command Line

This example shows an executable Bourne (/bin/sh) shell patch installation script.

As a best practice, any installation script that you use should create a new subdirectory, for example, in the /tmp directory. The script should then move or extract the OS update .tar file into that subdirectory. After the update is complete, the script should remove this subdirectory.

By default, the script executes in the invoker's home directory. In this case, this is the root directory. In addition, the installation script should refer to the full path to the package source files to avoid conflicts.

#!/bin/sh
mkdir /tmp/layer
cd /tmp/layer
echo "untar the source:"
tar -xvf /tmp/mypatches.tar
echo "let's install mypatches:"
patchadd -M /tmp/layer 117448-01 117466-01
exit $?

The following sample command shows how to associate the patch installation script with the OS update files. This example assumes that you have copied the script to the management server's /tmp directory with the name install.sh.


N1-ok> create update mypatches file /tmp/mypatches.tar ostype solaris10x86 installscriptfile 
/tmp/install.sh

In this example, /tmp/mypatches.tar contains the Solaris patches 117448–01 and 117466–01 in the datastream format.

The script and the source files for the OS update are copied to the target server when the create os command is issued. The script file is executed by using the Bourne shell with the full path to the package file as the sole argument.


Troubleshooting

If you use the installscriptfile parameter when creating an OS update, consider loading the OS update on a single server to test whether the script is working correctly before loading on a large server group.

Refer to OS Update Creation Failures for solutions to common errors.

See Also

To find out how to load an OS update, see To Load an OS Update on a Server or a Server Group

ProcedureTo Load an OS Update on a Server or a Server Group

This procedure describes how to load an OS update by using the browser interface. The example that follows the procedure provides a command-line equivalent.

The following default admin file is used to install Solaris packages:


mail=root
instance=unique
partial=nocheck
runlevel=nocheck
idepend=nocheck
rdepend=nocheck
space=quit
setuid=nocheck
conflict=nocheck
action=nocheck
basedir=default
authentication=nocheck

The admin file is located in the /opt/sun/n1gc/etc directory on the management server.

Before You Begin
Steps
  1. Log in to the N1 System Manager.

    See To Access the N1 System Manager Browser Interface for details.

  2. Navigate to the table that contains the server or the server group by performing one of the following actions:

    • Choose All Servers from the View Selector menu.

      The Servers table appears.

    • Choose Servers By Group from the View Selector menu.

      The Server Groups table appears.

  3. Drag and drop the OS update icon from the Shortcuts pane to the server or the server group.

    The Load OS Update confirmation dialog box appears.

  4. To begin loading the OS update on the selected servers, click the OK button.

    The dialog box closes.

  5. Click the Jobs tab.

    The Jobs table appears with information about your Load OS Update job.

  6. Verify that the installation was successful.


    N1-ok> show server server
    

Example 3–18 Loading an OS Update Through the Command Line

The following command shows you how to install an OS update on two servers by using the load command.


N1-ok> load server server1,server2 update SUNWn1gcsolsparcag 

See load server in Sun N1 System Manager 1.2 Command Line Reference Manual for details.



Example 3–19 Loading an OS Update on a Server Group Through the Command Line

The following command shows you how to install an OS update on a server group by using the load command.


N1-ok> load group devgroup update SUNWupdate1,SUNWupdate2

See load group in Sun N1 System Manager 1.2 Command Line Reference Manual for details.


Troubleshooting

Solaris OS Update Deployment Failures

ProcedureTo List the Available OS Updates

This procedure describes how to list the available OS updates that have been copied to the N1 System Manager. These OS updates can be installed on a provisionable server.

The example that follows the procedure provides a command-line equivalent.

Steps
  1. Log in to the N1 System Manager.

    See To Access the N1 System Manager Browser Interface for details.

  2. Click the System Dashboard tab.

    The Shortcuts pane appears.

  3. Click the Expand/Collapse icon on the Update title bar.

    The Update list expands.

  4. Click the Edit List button.

    The Edit List dialog box appears with the list of available updates.


Example 3–20 Listing Available OS Updates Through the Command Line

The following command shows you how to list all of the OS updates in the system.


N1-ok> show update all

ProcedureTo List the OS Updates Installed on a Provisionable Server


Tip –

You can also use the browser interface Server Details page to view all of the OS updates that are installed on a server.


Steps
  1. Log in to the N1 System Manager.

    See To Access the N1 System Manager Command Line for details.

  2. List the OS updates that are installed on a provisionable server.


    N1-ok> show server server
    

    See show server in Sun N1 System Manager 1.2 Command Line Reference Manual for details

ProcedureTo Delete an OS Update

This procedure describes how to delete an OS update from the N1 System Manager. This procedure does not delete an OS update from a provisionable server. See To Uninstall an OS Update From a Provisionable Server for details on that specific task.

Steps
  1. Log in to the N1 System Manager.

    See To Access the N1 System Manager Command Line for details.

  2. Delete an OS update from the N1 System Manager.


    N1-ok> delete update update
    

    See delete update in Sun N1 System Manager 1.2 Command Line Reference Manual for details.

ProcedureTo Uninstall an OS Update From a Provisionable Server

Before You Begin
Steps
  1. Log in to the N1 System Manager.

    See To Access the N1 System Manager Command Line for details.

  2. Uninstall an OS update from a provisionable server.


    N1-ok> unload server server[,server...] update update
    

    Caution – Caution –

    If the user-specified update name is not found, the command tries to uninstall an OS update with a matching file name. The show update command enables you to list an OS update's corresponding file name.


    See unload server in Sun N1 System Manager 1.2 Command Line Reference Manual for details.

Troubleshooting

If you cannot uninstall an OS update that was installed with an admin file, check that the package file name matches the name of the package. If the name is not the same, rename the admin file in the provisionable server's /tmp directory to match the name of the package and try the unload command again. If the package still exists, remove it from the provisionable server by using pkgrm.

See Also

OS Update Uninstallation Failures

ProcedureTo Uninstall an OS Update on a Server Group

Before You Begin
Steps
  1. Log in to the N1 System Manager.

    See To Access the N1 System Manager Command Line for details.

  2. Uninstall an OS update on the provisionable servers in a server group.


    N1-ok> unload group group update update
    

    Caution – Caution –

    If the user-specified update name is not found, the command tries to uninstall an OS update with a matching file name. Use the show update command to list an OS update's corresponding file name.


    See unload group in Sun N1 System Manager 1.2 Command Line Reference Manual for details.