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.
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 Grid Service Provisioning System software allows you to perform three types of comparisons.
Model to Model
Model to Install
Install to Install
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 Grid Service Provisioning System software machines so that all system clocks are synchronized on the same time.
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
Compares the records of what has been installed on two hosts
Requires no data transfer
Requires the least amount of time to run
You might want to use a Model to Model comparison in the following situations.
You want to compare the contents of two hosts and no out-of-band changes have occured.
You want to compare two hosts and neither of the hosts had snapshots taken during installation.
This procedure describes creating a comparison by using the browser interface. You can also create comparisons by using the following command.
cmp.ds.add – Creates a new comparison.
For a detailed description of this command, see Chapter 5, cmp: CLI Commands for Running Comparisons, in N1 Grid Service Provisioning System 5.0 Command-Line Interface Reference Manual.
To create a new comparison, you must belong to a user group with Create, Edit, Delete permission on comparisons.
In the navigation menu, click Comparisons.
The Comparisons page is displayed.
Type the name and description of the comparison you want to create and click Create.
The comparison's Details page is displayed.
In the Style of Comparison area, click Model to Model.
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.
In the Comparison Host Field, type or select the name of the host whose model you would like to compare to the reference model.
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.
Click Save.
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
Compares a snapshot of installed components with the current state of the components
Allows the flexibility of comparing either an individual component or any set of components installed on a host
Compares at a high level (component and directory lists) or a low level (file contents)
Processes comparison on the Remote Agent
Requires that components created snapshots when installed on a Remote Agent.
You will want to use a Model to Install comparison in the following situation.
If a configuration was working as expected and is no longer working, you might want to determine if there have been out-of-band changes.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Model to Install comparisons with WebLogic WAR Files use the standard file and directory approach.
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.
Model to Install comparisons with WebLogic JAR Files use the standard file and directory approach.
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.
Model to Install comparisons with WebLogic EAR Files use the standard file and directory approach.
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.
This procedure describes creating a comparison by using the browser interface. You can also create comparisons by using the following command.
cmp.ds.add – Creates a new comparison.
For a detailed description of this command, see Chapter 5, cmp: CLI Commands for Running Comparisons, in N1 Grid Service Provisioning System 5.0 Command-Line Interface Reference Manual.
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.
In the navigation menu, click Comparisons.
The Comparisons page is displayed.
Type the name and description of the comparison you want to create and click Create.
The comparison's Details page is displayed.
In the Style of Comparison area, click Model to Install.
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.
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.
Select the scope of the comparison.
(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.
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.
Choose to save the comparison to run later or run it now.
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.
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
Compares the current state of components on one host with the current state of components on another host
Allows the flexibility of comparing either an individual component or any set of components installed on a host
Processes comparison on the comparison host's Remote Agent
Requires that components created snapshots when installed
Requires that the Remote Agents use the same locale
You will want to use an Install to Install comparison in the following situations.
You want to compare a component across two hosts.
For example, you can compare software on a staging host with software on a production host.
You want to compare two directories that both exist on a single host.
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.
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 N1 Grid Service Provisioning System 5.0 XML Schema Reference Guide.
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> |
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> |
This procedure describes creating a comparison by using the browser interface. You can also create comparisons by using the following command.
cmp.ds.add – Creates a new comparison.
For a detailed description of this command, see Chapter 5, cmp: CLI Commands for Running Comparisons, in N1 Grid Service Provisioning System 5.0 Command-Line Interface Reference Manual.
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.
In the navigation menu, click Comparisons.
The HTML user interface displays the comparisons page, which lists the comparisons already checked into the database.
Type the name and description of the comparison you want to create and click Create.
The comparison's Details page is displayed.
In the Style of Comparison area, click Install to Install.
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.
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.
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.
Type the name of the comparison host and the path to the directory you want to compare against the reference host.
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.
Click Include Temporary Files Generated by Scripts During Comparison.
The page will refresh and provide two fields to generate and cleanup scripts.
Enter the scripts into the appropriate fields.
For information on scripts for prepare and cleanup, refer to Using Scripts in Install to Install Comparisons.
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.
(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.
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.
Click Save.
Running comparisons can often take a significant amount of time. After a comparison has been created, you can run, modify, or view it.
This procedure describes how to run comparisons by using the browser interface. You can also run comparisons by using the following command.
cmp.dj.add – Runs a comparison
For a detailed description of this command, see Chapter 5, cmp: CLI Commands for Running Comparisons, in N1 Grid Service Provisioning System 5.0 Command-Line Interface Reference Manual.
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.
You must belong to a user group that has permission to run comparisons on a particular host set.
From the Comparisons page, select the comparison that you want to run.
(Optional) Modify the comparison criteria.
Click Save & Run.
The comparison's Progress page is displayed.
After the comparison completes, the comparison's Results page is displayed.
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.
(Optional) To view the comparison's results in another format, click either Print or Download.
Click Done.
This procedure describes how to view comparisons by using the browser interface. You can also view comparisons by using the following commands.
cmp.ds.la – Displays all comparisons
cmp.ds.lo – Displays detailed information about a particular comparison
For a detailed description of these commands, see Chapter 5, cmp: CLI Commands for Running Comparisons, in N1 Grid Service Provisioning System 5.0 Command-Line Interface Reference Manual.
In the navigation menu, click Comparisons.
The Comparisons page is displayed.
(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.
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.
cmp.dj.la – Lists running and completed comparisons.
cmp.dj.lo – Displays status of a particular comparison.
For a detailed description of these commands, see Chapter 5, cmp: CLI Commands for Running Comparisons, in N1 Grid Service Provisioning System 5.0 Command-Line Interface Reference Manual.
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.
To view the details about a particular plan, click Results.
This procedure describes how to run comparisons by using the browser interface. You can also run comparisons by using the following command.
cmp.dj.del – Stops a comparison
For a detailed description of this command, see Chapter 5, cmp: CLI Commands for Running Comparisons, in N1 Grid Service Provisioning System 5.0 Command-Line Interface Reference Manual.
To stop a comparison, you must be either the user that started the comparison or a member of the admin user group.
From the Run History page, determine the comparison you want to stop.
In the Action column, click Progress.
Click Cancel Comparison.
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.
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.
cmp.ds.mod – Modifies a comparison
For a detailed description of this command, see Chapter 5, cmp: CLI Commands for Running Comparisons, in N1 Grid Service Provisioning System 5.0 Command-Line Interface Reference Manual.
To modify a comparison, you must belong to a user group with Create, Edit, Delete permission on comparisons.
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.
Modify the Directories and Files to Ignore During Comparisons table.
Add a directory or file to the ignore list.
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.
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*.
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.
Click Save.