Sun N1 Service Provisioning System 5.1 Operation and Provisioning Guide

Chapter 2 Running Comparisons

About Comparisons

Comparisons are used to validate an installation or system configuration. By comparing the configuration of a host against its original configuration, you can tell if anything has changed. You can also compare one or more hosts against a reference host to ensure that all hosts are configured the same.

Illustration is described in the contexts.

With the provisioning system you can compare one or more hosts against another host, one or more hosts against a model in the Master Server, or a host against its original configuration. The provisioning software allows you to check the entire configuration of a host or limit what is checked to a single directory.

N1 Service Provisioning System software allows you to perform three types of comparisons.

Time Synchronization for Comparisons

Because the time stamp for a comparison is based on the clock in the Master Server, you should run some kind of synchronization utility on all your N1 Service Provisioning System software machines so that all system clocks are synchronized on the same time.

Model to Model Comparisons

A Model to Model comparison is the simplest type of comparison. The comparison checks the list of components that are installed on one host against the list of components that are installed on another host. This comparison is purely a verification of the records that the provisioning system has about what it has installed.

If there have been out-of-band changes made to either component list, the changes are not detected. A Model to Model comparison takes place entirely on the Master Server based on information the Master Server has received about what has been deployed.

Model to Model Comparison Characteristics

You might want to use a Model to Model comparison in the following situations.

ProcedureHow to Create a Model to Model Comparison

This procedure describes creating a comparison by using the browser interface. You can also create comparisons by using the following command.

For a detailed description of this command, see Chapter 5, cmp: CLI Commands for Running Comparisons, in Sun N1 Service Provisioning System 5.1 Command-Line Interface Reference Manual.

Before You Begin

To create a new comparison, you must belong to a user group with Create, Edit, Delete permission on comparisons.

Steps
  1. In the navigation menu, click Comparisons.

    The Comparisons page is displayed.

  2. Type the name and description of the comparison you want to create and click Create.

    The comparison's Details page is displayed.

  3. In the Style of Comparison area, click Model to Model.

  4. In the Reference Host field, type or select the name of the host whose model should serve as the standard for the comparison.

    Ideally, the reference host contains the configuration that you would like to see on the comparison host.

  5. In the Comparison Host Field, type or select the name of the host whose model you would like to compare to the reference model.

  6. In the Limits area, specify the maximum number of hours or minutes the comparison can run.

    By default, comparisons are allowed to run for four hours.

    If the comparison times out, an error message will display on the Comparisons page.

  7. Click Save.

Model to Install Comparisons

Unlike Model to Model comparisons, which compare one ideal installation to another, Model to Install comparisons compare the actual state of the installed component or components at deployment time against their current state. You can specify that this comparison compares the model to hosts, host sets, or to component level.

A Model to Install comparison uses snapshot information to compare a component's just-installed state with its current state. A snapshot is a record of the state of an installed component immediately after it has been deployed to a host. The component's XML model includes parameters that control the scope of this snapshot. For example, the XML model can list files, such as log files, that should be ignored during a comparison.

When the provisioning software performs a Model to Install comparison, the Master Server looks up the list of snapshots for all the components being compared. It sends this list to the Remote Agent on the host where the components are installed. The snapshot information includes rules for any files and directories that should be ignored during the comparison. The Remote Agent then processes these rules. Both Master Server and Remote Agents must be using the same locale for the Model to Install comparison to function properly.

Model to Install Comparison Characteristics

You will want to use a Model to Install comparison in the following situation.

Component Types and Model to Install Comparisons

A Model to Install comparison compares a component model to a specific installation of a component. This section describes how a component type effects a Model to Install comparison.

During a snapshot, the current state of the metabase is exported into an XML file. During a Model to Install comparison, the metabase is re-exported and compared against the original XML file.

IIS Types Introduction

During a snapshot, the current state of the metabase is exported into an XML file. During a Model to Install comparison, the metabase is re-exported and compared against the original XML file. The standard XML differentiator is used to generate differences between these files.

COM+ Application

The COM+ Application is re-exported on the target system as an MSI file and compared against the MSI file used to install the application. A Model to Install comparison will only indicate that there were differences (that is, the two binary files are different). It will not indicate the details of the differences.

COM Component

The COM component is compared as a binary file against the file used during installation. A Model to Install comparison will only indicate that there were differences (that is, the two binary files are different). It will not indicate the details of the differences.

H Keys

During a snapshot, the current state of registry key (and its children) is exported into an XML file. During a Model to Install comparison, the registry key is re-exported and compared against the original XML file. The standard XML differentiator is used to generate differences between these files.

Registry Settings

Model to Install comparisons are not supported for *.reg files. Snapshots are not taken during installation. Without a snapshot, there is nothing to compare in a Model to Install comparison. If you need to compare registry changes, use the built-in Registry keys type.

MSI Files or Windows Installer Files

Model to Install comparisons are not supported for Windows Installer files. Snapshots are not taken during installation. Without a snapshot, there is nothing to compare in a Model to Install comparison. Since the provisioning system does not have first-hand knowledge of the actions taken during the installation, it cannot determine what needs to be captured.

Windows Batch Files

Model to Install comparisons are not supported for Windows Batch files. Snapshots are not taken during installation. Without a snapshot, there is nothing to compare in a Model to Install comparison.

Windows Scripting Host Files

Model to Install comparisons are not supported for WSH files. Snapshots are not taken during installation. Without a snapshot, there is nothing to compare in a Model to Install comparison.

WebLogic WAR Files

Model to Install comparisons with WebLogic WAR Files use the standard file and directory approach.

WebLogic Web Application Settings

The relevant settings for the application will be exported into a file, which will be compared to the file that contained the settings during deployment.

WebLogic JAR Files

Model to Install comparisons with WebLogic JAR Files use the standard file and directory approach.

WebLogic EJB Settings

The relevant settings for the EJB will be exported into a file, which will be compared to the file that contained the settings during deployment.

WebLogic EAR Files

Model to Install comparisons with WebLogic EAR Files use the standard file and directory approach.

WebLogic Enterprise Application Settings

The relevant settings for the Application will be exported into a file, which will be compared to the file that contained the settings during deployment.

ProcedureHow to Create a Model to Install Comparison

This procedure describes creating a comparison by using the browser interface. You can also create comparisons by using the following command.

For a detailed description of this command, see Chapter 5, cmp: CLI Commands for Running Comparisons, in Sun N1 Service Provisioning System 5.1 Command-Line Interface Reference Manual.

Before You Begin

The Remote Agents from each host must be set to use the same locale for Install to Install comparisons to function properly.

To create a new comparison, you must belong to a user group that has Create, Edit, Delete permission on comparisons.

Steps
  1. In the navigation menu, click Comparisons.

    The Comparisons page is displayed.

  2. Type the name and description of the comparison you want to create and click Create.

    The comparison's Details page is displayed.

  3. In the Style of Comparison area, click Model to Install.

  4. Select the level of detail that the comparison will use.

    • Directory and File properties. Confirms that both hosts have the same files and directories and that the files and directories are the same sizes.

    • File Contents. Compares the contents of files on both hosts.


      Note –

      If the component you are using in a comparison includes its own rules about files to ignore, those rules are used in addition to any ignore rules you define for this comparison.


  5. Select the scope of the comparison.

    • Host Set. Compares the last known state of the specified host set to its current state.

      1. Select Host Set from the Scope menu.

      2. Select the host set that you want to compare.

    • Host. Compares the last known state of the specified host to its current state.

      1. Select Host from the Scope menu.

      2. Type the name of the host that you want to compare.

    • Component. Compares the last known state of the specified component to its current state.

      1. Select Component from the Scope menu.

      2. Type the name of the host that contains the component and click Apply Change.

      3. Select the component from the Component (Path) menu.

  6. (Optional) Type the names of files or directories that you want the comparison to ignore.

    This feature allows the provisioning system to accommodate changes to things like log files without causing the comparison to fail.

    For more information, see Modifying Directories or Files to Ignore During Comparisons.

  7. In the Limits area, specify the maximum number of hours or minutes the comparison can run.

    By default, comparisons are allowed to run for 4 hours.

    If the comparison times out, an error message will display on the Comparisons page.

  8. Choose to save the comparison to run later or run it now.

    • To save the comparison without running it, click Save.

    • To both save the comparison and run it now, click Save & Run.

Install to Install Comparisons

Similar to the Model to Install comparison, the Install to Install comparison allows you to specify comparisons down to the level of the contents of files. Install to Install comparisons compare the files and directories on two of hosts.

The list of elements (files, directories, and so on) from the reference host are grouped into batches on the Master Server and then sent to the Remote Agent of the comparison host for processing. If you have defined some rules about file types or specific directories or files for the provisioning system to ignore, the Master Server will discard the appropriate items before sending the remainder of the list to the comparison host. The comparison results are then sent back to the Master Server.

You can run Install to Install comparisons on different directories on the same Remote Agent to compare the contents of two directories on the same host.


Note –

The Remote Agents from each host must be set to use the same locale for Install to Install comparisons to function properly.


Install to Install Comparison Characteristics

You will want to use an Install to Install comparison in the following situations.

Using Scripts in Install to Install Comparisons

If the components you are comparing include resources that are stored in a package, a database, or an archive such as a ZIP file, you can use scripts to export or transform the resources before the comparison occurs. Use the execNative step to direct the provisioning software to perform native commands such as unzipping or exporting file contents.

You can run any native command within the prepare and cleanup blocks. A common usage of these blocks before and after a comparison is to extract the files from a compressed archive and output them to a specified output file, then delete that file during the cleanup.


Note –

Unlike the execNative contained in a plan or component, this execNative instance must be contained within either a prepare or a cleanup block, and cannot make use of any variable substitutions.


When you are performing an Install to Install comparison using the browser interface, you can select a checkbox labeled Include Temporary Files Generated By Scripts During Comparison. When you select this option, the page refreshes and provides two fields into which you can enter the prepare and cleanup blocks.

You can also specify alternate prepare and cleanup blocks for the comparison host by deselecting the appropriate boxes.

For more information about execNative, see Chapter 2, Shared Schema Used by Components and Simple Plans, in Sun N1 Service Provisioning System 5.1 XML Schema Reference Guide.


Example 2–1 A prepare Block for an Install to Install Comparison

This prepare block specifies the output file for the result of the execNative. The execNative lists the contents of the /tmp directory.


<prepare>
  <execNative outputFile="file.txt" dir="temp">
    <exec cmd="ls">
      <arg value="-l"></arg>
      <arg value="/tmp"></arg>
    </exec>
  </execNative></prepare>


Example 2–2 A cleanup Block for an Install to Install Comparison

This cleanup block then removes the output file, file.txt, from the /temp directory.


<cleanup>
  <execNative  dir="/temp/">
    <exec cmd="rm">
      <arg value="-rf"></arg>
      <arg value="file.txt"></arg>
    </exec>
  </execNative></cleanup>

ProcedureHow to Create an Install to Install Comparison

This procedure describes creating a comparison by using the browser interface. You can also create comparisons by using the following command.

For a detailed description of this command, see Chapter 5, cmp: CLI Commands for Running Comparisons, in Sun N1 Service Provisioning System 5.1 Command-Line Interface Reference Manual.

Before You Begin

The Remote Agents from each host must be set to use the same locale for Install to Install comparisons to function properly.

To create a new comparison, you must belong to a user group with Create, Edit, Delete permission on comparisons.

Steps
  1. In the navigation menu, click Comparisons.

    The HTML user interface displays the comparisons page, which lists the comparisons already checked into the database.

  2. Type the name and description of the comparison you want to create and click Create.

    The comparison's Details page is displayed.

  3. In the Style of Comparison area, click Install to Install.

  4. Select the level of detail that the comparison will use.

    • Directory and File properties. Confirms that both hosts have the same files and directories and that the files and directories are the same sizes.

    • File Contents. Compares the contents of files on both hosts.


      Note –

      If the component you are using in a comparison includes its own rules about files to ignore, they will be used in addition to any ignore rules you define for this comparison.


  5. Type the name of the reference host and the path of the directory that you want to compare against the comparison host.

    Ideally, the reference host contains the configuration that you would like to see on the comparison host.

    The directory that you type specifies where in the hierarchical, file structure to limit the comparison. If you use the top of the tree structure you will evaluate the entire host.

  6. Type the name of the comparison host and the path to the directory you want to compare against the reference host.

  7. Select the options available for the comparison.

    • (Optional) To run a comparison on all the subdirectories within the selected directory, select Include All Subdirectories In Comparison.

    • (Optional) To resolve symbolic links to determine that what the link points to is also valid, select Follow Symbolic Links Found in Directories.

    • (Optional) To run a script before or after running this comparison, perform the following actions.

      1. Click Include Temporary Files Generated by Scripts During Comparison.

        The page will refresh and provide two fields to generate and cleanup scripts.

      2. Enter the scripts into the appropriate fields.

        For information on scripts for prepare and cleanup, refer to Using Scripts in Install to Install Comparisons.

      3. If you do not want the provisioning software to run the same scripts on the comparison host as on the reference host, deselect the appropriate options.

        • If you deselect the Generate checkbox, a field displays for you to provide an alternate generate script for the comparison host.

        • If you deselect the Cleanup checkbox, a field displays for you to provide an alternate cleanup script for the comparison host.

        If you want to specify resources to ignore during this comparison, see Modifying Directories or Files to Ignore During Comparisons.

  8. (Optional) Type the names of files or directories that you want the comparison to ignore.

    This feature allows the provisioning system to accommodate changes to things like log files without causing the comparison to fail.

  9. In the Limits area, specify the maximum number of hours or minutes the comparison can run.

    By default, comparisons are allowed to run for four hours.

    If the comparison times out, an error message will display on the Comparisons page.

  10. Click Save.

Managing Comparisons

Running comparisons can often take a significant amount of time. After a comparison has been created, you can run, modify, or view it.

ProcedureHow to Run a Comparison

This procedure describes how to run comparisons by using the browser interface. You can also run comparisons by using the following command.

For a detailed description of this command, see Chapter 5, cmp: CLI Commands for Running Comparisons, in Sun N1 Service Provisioning System 5.1 Command-Line Interface Reference Manual.


Note –

If you have saved a comparison involving a component, and that component has been upgraded or its version numbers have changed for some other reason, the provisioning software automatically updates the comparison you saved to run against the new version of the component.


Before You Begin

You must belong to a user group that has permission to run comparisons on a particular host set.

Steps
  1. From the Comparisons page, select the comparison that you want to run.

  2. (Optional) Modify the comparison criteria.

  3. Click Save & Run.

    The comparison's Progress page is displayed.

    After the comparison completes, the comparison's Results page is displayed.


    Note –

    Running a comparison does not lock down the ability to perform other operations. You can perform other operations while waiting for a comparison to complete.


  4. (Optional) To view the comparison's results in another format, click either Print or Download.

  5. Click Done.

ProcedureHow to View Comparisons

This procedure describes how to view comparisons by using the browser interface. You can also view comparisons by using the following commands.

Steps
  1. In the navigation menu, click Comparisons.

    The Comparisons page is displayed.

  2. (Optional) To view the details of a specific comparison, click Details in the row listing the plan you're interested in.

    The comparison's Details page is displayed.

ProcedureHow to View the Progress of a Comparison

This procedure describes how to view the progress of a comparison by using the browser interface. You can also view a comparison's history by using the following commands.

For a detailed description of these commands, see Chapter 5, cmp: CLI Commands for Running Comparisons, in Sun N1 Service Provisioning System 5.1 Command-Line Interface Reference Manual.

Steps
  1. In the navigation menu, expand the Application Deployment category and click Run History.

    All running and completed comparisons are listed. Running comparisons are indicated in the Completed column with text describing the time when the plan started running.

  2. To view the details about a particular plan, click Results.

ProcedureHow to Stop a Running Comparison

This procedure describes how to run comparisons by using the browser interface. You can also run comparisons by using the following command.

For a detailed description of this command, see Chapter 5, cmp: CLI Commands for Running Comparisons, in Sun N1 Service Provisioning System 5.1 Command-Line Interface Reference Manual.

Before You Begin

To stop a comparison, you must be either the user that started the comparison or a member of the admin user group.

Steps
  1. From the Run History page, determine the comparison you want to stop.

  2. In the Action column, click Progress.

  3. Click Cancel Comparison.


    Note –

    If you cancel a comparison in progress, you are returned to the page listing all the comparisons. Occasionally, it may take a short time for the listing to refresh and show you that the comparison that you canceled has been stopped.


ProcedureModifying Directories or Files to Ignore During Comparisons

In addition to describing the level of detail and what hosts or components that you want to compare, you have the option of defining sets of files or directories to exclude from a comparison. You might want to do this if you know that particular resources have many differences that are not important to you. You can save these definitions and reuse them in other comparison definitions.

You can also modify comparisons by using the following command.

For a detailed description of this command, see Chapter 5, cmp: CLI Commands for Running Comparisons, in Sun N1 Service Provisioning System 5.1 Command-Line Interface Reference Manual.

Before You Begin

To modify a comparison, you must belong to a user group with Create, Edit, Delete permission on comparisons.

Steps
  1. If necessary, select the Model to Install comparison or the Install to Install comparison that you want to modify.

    The comparison's Details page is displayed.

  2. Modify the Directories and Files to Ignore During Comparisons table.

    • Add a directory or file to the ignore list.

      1. From the comparison's Details page, type the name of the directory or file you want to ignore and click Add.

        You can also provide an expression to represent the directories or files that you want to ignore by using wildcards (*). For example, if you want to ignore all log files, you can specify *.log to be excluded.


        Note –

        You must specify a complete pattern (with or without wildcards) all the way to the file name. Simply specifying down to the directory level will not exclude the files in that directory unless you add a * to the end. For example, if you want to exclude all the files in /usr/apache/logs, you must specify /usr/apache/logs*.


      2. Click Add.

        Your specification will be added to the list of directories and files to be ignored.

    • Remove a directory or file from the ignore list.

      1. Choose which directory or file you want to remove.


        Note –

        You cannot remove or disable a global ignore rule.


      2. Click Remove.

  3. Click Save.