Sun N1 Service Provisioning System 5.1 Operation and Provisioning Guide

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.

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

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.

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

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.

  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.