Sun Update Connection - Enterprise 1.0 User's Guide

Inventory Jobs

You can manipulate inventory components to create quick jobs. Use Inventory jobs to install, uninstall, upgrade, or downgrade specific components.

Although Inventory jobs are quickly created and deployed, more control and features are available with Complex jobs, which options offer more efficient environment management. For more details, see Chapter 11, Complex Jobs.

Creating Inventory Jobs

ProcedureTo Change the Inventory of a Host or Group

This procedure explains how to create an inventory job to manage the installed components of hosts.

Before you begin a job on a Solaris machine, make sure the PKG deployment preferences are appropriate for your local needs. See Host Preferences – PKGs.

  1. From the View menu, make sure Inventory is selected.

  2. From the drop-down list on the tool bar, select a distribution-architecture.

    The Components list changes to display components of the selected distribution.

  3. In the Hosts list, select groups or hosts.

  4. In the Components list, select a component.

  5. Assign an action to the selected component.

    Do one of the following:

    • From the tool bar, click the Required, Not Allowed, or Upgrade button.

    • Right-click the selected component and choose Required, Not Allowed, or Upgrade.

    • From the Components menu, choose Required, Not Allowed, or Upgrade.

      See Table 8–1 for more explanations of these options.

      The action-component setting appears in the Actions list.

  6. Enter as many component actions as you want.

  7. To make the inventory job applicable to hosts of different distributions:

    • To select specific components from different distributions, change the selection of the drop-down list of distributions in the tool bar. Find the relevant components and add the action settings to the Actions list.

    • To let Sun Update Connection – Enterprise find components from other distributions that are comparable to the ones you have in the Actions list, click the Multi Distribution button (see To Align Component Settings for Multiple Distributions).

  8. Do one of the following:

    • From the tool bar, click the Run Job button.

    • Right-click in the Actions list and choose Run on Selected Hosts.

    • From the Actions menu, choose Run on Selected Hosts.

    The Run Job window opens.

  9. Give the job a name and an optional, free-text description.

  10. Select a mode for the job:

    • Deploy – Do the actions on the selected hosts

    • Simulate – Simulate the actions to estimate job time and full job actions

      (If you have restricted permissions to run simulation only jobs, these options are disabled. The job will be run in simulate mode.)

  11. Click OK.

    The Run Job window closes. The job starts.

Comparing Inventories

ProcedureTo Compare Inventories

The Inventory Comparison feature shows the differences of installed components between two hosts. The hosts must be of the same distribution-architecture, both in console and in CLI commands.

Comparing inventories offers the following features:

Before You Begin

Before comparing inventories, you should run the Check System profile on the host or group. This will ensure that the source inventory does not have dependency issues. If you will be managing Solaris hosts, you should run the Check Withdrawn Patches profile. This will replace withdrawn Solaris patches with appropriate operating software. See Chapter 7, System Management Profiles.

In addition, if you will be comparing Solaris machines, you should edit the PKG settings (see Host Preferences – PKGs) to ensure that the deployment operates as expected.

  1. Make sure the Inventory panel is open in the main window. From the View menu, choose Inventory.

  2. Do one of the following:

    • From the tool bar, click the Compare Inventories button.

    • Right-click in the Hosts list and choose Compare Inventories.

    • From the Hosts menu, choose Compare Inventories.

    The Inventory Comparison window opens.

    This screen capture shows the Inventory Compare window.
  3. Click the Host Select button to the right of the Target host field.

    The Host Selection window opens.

  4. Select the host you want to change and then click OK.

    The Host Selection window closes. The selected host name appears in the Target host field.

  5. From the Inventory drop-down list, select a stored inventory or the current inventory.

    If you want to create a job from the comparison, select Current Inventory.

  6. Click the Host Select button to the right of the Source field.

    The Host Selection window opens.

  7. Select the managed host you want to use as the source and then click OK.

    The Host Selection window closes. The selected host name appears in the Source field.

  8. From the Inventory drop-down list, select a saved inventory.

    (If the source host is different from the target host, you can select the current inventory.)

  9. In the Filter section, select the types of components you want to be in the comparison:

    • Software packages

    • Hardware drivers

    • Configuration Files

    • whether you want the comparison to ignore differences in Versions of the same packages

  10. Click Compare.

    The results of the inventory comparison are displayed.

  11. Under the See section of the Inventory Comparison window, select Tasks to Make Target like Source.

    If the results include at least one difference between the selected inventories which can be converted to an action (differences in configuration files cannot be converted), more features are available. See the following procedures.


Example 8–3 Comparing Inventories with the CLI

The compare host inventories CLI command outputs two lists: what is installed in the source inventory and not in the target inventory, and what is in the target inventory and not in the source inventory.

Both hosts must be of the same distribution. Both the source host and the target host may be the same host, but the inventories must be different.

If you do not use the -s or the -ts parameters, the current inventories are used by default. See Compare Hosts and Inventories (-chi) Command.


#! /bin/bash

echo -n “Enter your user name:” 
read user 
echo -n “Enter your password:” 
read password 

echo “What distribution are you working on?” 
uce_cli -ld -u “$user” -p “$password” 
echo -n “Copy the distribution name you want:” 
read distroGroup 
echo “The list of hosts in this distribution is:” 
uce_cli -lgh -g “$distroGroup hosts” -u “$user” -p “$password” 
echo -n “Copy the name of the source host:” 
read sourcehost 
echo -n “Copy the name of the target host:” 
read targethost 

echo “The list of saved inventories is:” 
uce_cli -lss -g “$distroGroup hosts” -u “$user” -p “$password” 
echo -n “Copy the name of the source inventory:” 
read sourceInven 
echo -n “Copy the name of the target inventory:” 
read targetInven 

uce_cli -chi -h “$sourcehost” -s “$sourceInven” -t “$targethost” -ts “$targetInven” \
-u “$user” -p “$password”

Cloning Inventories

ProcedureTo Clone Software Inventory

If the results of a Compare Inventory include differences which can be converted to tasks, and if the target inventory is a Current Inventory of a host, you can make the target inventory like the source inventory. This operation does not dump everything on the target as a traditional clone feature would. It allows for a more secure job. It shows you which components are on the source that are not on the target, and could be installed; and which are on the target which could be uninstalled.

  1. Compare a source inventory to the Current Inventory of a target host.

    If the source inventory can be cloned onto the target inventory, the Make Target Like Source button is enabled.

  2. Click Make Target like Source.

    The Run Job window opens.

    The actions under Deploy source’s inventory on target->Profile Data show the components to be installed, uninstalled, upgraded, or downgraded on the target to make its inventory similar to the source inventory.

    You may continue with the job now, if this is the only type of action to be done:

    • Comparison is of Linux inventories

    • Differences are of software, not Solaris patches

    • Tasks are for only install, with no uninstall of Solaris patches

      If the tasks displayed in the Run Job window include Maintain target’s patches, see Patch Management in Solaris Comparisons before continuing with this procedure.

  3. Type a new name for the job.

  4. Select Deploy or Simulate.

  5. Click OK.

    The job installs, uninstalls, upgrades, and downgrades components on the target managed host to make its inventory consistent with that of the source.

Patch Management in Solaris Comparisons

Solaris patches are installed and handled differently than Linux components. An inventory comparison will result in patch comparisons only if the selected inventories have identical software components.

If patches are compared and differences found:

Troubleshooting Clone Inventory Jobs

Restoring Managed Hosts

ProcedureTo Roll Back an Inventory

After you run a job and decide that the changes are not what you need, you can roll back the component inventory of a managed host to a previously saved inventory. Inventories are saved automatically before job changes, and you can save an inventory on demand (see Saving Inventories).

  1. Make sure the Inventory panel is open in the main window by choosing Inventory from the View menu.

  2. Do one of the following:

    • From the tool bar, click the Compare Inventories button.

    • Right-click in the Hosts list and choose Compare Inventories.

    • From the Hosts menu, choose Compare Inventories.

    The Inventory Comparison window opens.

  3. Click the Host Select button to the right of the Target host field.

    The Host Selection window opens.

  4. Select the host you want to restore and then click OK.

    The Host Selection window closes. The selected host name appears in the Target host field.

  5. From the Inventory drop-down list, select Current Inventory.

  6. Click the Host Select button to the right of the Source field.

    The Host Selection window opens.

  7. Select the same managed host you want to restore and then click OK.

    The Host Selection window closes. The selected host name appears in the Source field.

  8. From the Inventory drop-down list, select the optimal stored inventory of the host or of a group to which the host belongs.

  9. Filter the inventories for the type that you want to restore, or select all the inventory options.


    Note –

    If the hosts are Solaris machines, you can rollback only Software or only Patches at one time.


  10. Click Compare.

    Check the results of the inventory comparison. If the differences between the inventories can be converted to component management tasks, the Make Target like Source button is enabled.

  11. Click Make Target like Source.

    The Run Job window opens.

  12. In the Run Job window, select Deploy and then click OK.

    The restore job begins.

    If you are a user with restricted permissions to run only simulation jobs, you do not have this option.)


Example 8–4 Restoring a Host with the CLI

The CLI command submit compare job can clone the inventory (or part of it) from one host or saved inventory to another host. It can also restore a host to a previously saved inventory. This example shows a restore inventory job. See Submit Compare Job (-scj) Command.


#! /bin/bash

echo -n “Enter your user name:” 
read user 
echo -n “Enter your password:” 
read password 

echo “What distribution are you working on?” 
uce_cli -ld -u “$user” -p “$password” 
echo -n “Copy the distribution name you want:” 
read distroGroup 
echo “The list of hosts in this distribution is:” 
uce_cli -lgh -g “$distroGroup hosts” -u “$user” -p “$password” 
echo -n “Copy the name of the host to restore:” 
read host 

echo “The list of saved inventories is:” 
uce_cli -lss -g “$distroGroup hosts” -u “$user” -p “$password” 
echo -n “Copy the name of the inventory to which $host is be restored:” 
read sourceInven 

uce_cli -scj -h “$host” -s “$sourceInven” -t “$host” -j “Restore $host” -C “Always ask me” \
-dp -u “$user” -p “$password”

Saving Inventory Settings as Profiles

ProcedureTo Save Inventory Settings as a Profile

Inventory jobs allow you to quickly manage hosts based on specific components. You can also manage hosts using Complex Jobs (see Chapter 11, Complex Jobs), which allow for more features in one management task. To do this, you need a profile. In this procedure, you save a inventory action list as a re-usable profile.

  1. Make sure the Inventory panel is open in the main window by choosing Inventory from the View menu.

  2. From the drop-down list on the tool bar, select a distribution-architecture.

    The Components list changes to display components of the selected distribution.

  3. In the Components list, select a component.

  4. Assign an action to the selected component.

    Do one of the following:

    • From the tool bar, click the Required, Not Allowed, or Upgrade button.

    • Right-click the selected component and choose Required, Not Allowed, or Upgrade.

    • From the Components menu, choose Required, Not Allowed, or Upgrade.

      The action-component setting appears in the Actions list.

  5. Enter as many component settings as you want.

  6. To make the inventory job applicable to hosts of different distributions:

    • To select specific components from different distributions, change the selection of the drop-down list of distributions in the tool bar. Find the relevant components and add the action settings to the Actions list.

    • To let Sun Update Connection – Enterprise find components from other distributions that are comparable to the ones you have in the Actions list, click the Multi Distribution button.

      See To Align Component Settings for Multiple Distributions.

  7. Do one of the following:

    • From the tool bar, click the Save As Profile button.

    • Right-click in the Actions list and choose Save as Profile.

    • From the Actions menu, choose Save as Profile.

    The Profile Editor window opens.

    The screen capture shows the Profile Editor window.
  8. Type a new name for the profile, and type a free-text description.

  9. Check that the component actions in the bottom panel are what you want. You can change the profile before saving it.

  10. Click OK.

    The profile is saved. The Profile Editor closes.


Example 8–5 Saving a Host Inventory as a Profile

This Copy Inventory to Profile CLI command takes a host as a parameter. Everything that is installed on the host is marked as Required in the profile. All remaining components in the knowledge base of the distribution of the selected host that are not installed on that host are marked as Not Allowed in the profile. Use this profile to make an inventory cloning job on multiple hosts.

Note that in the following script example, the existence of a policy is assumed.

Make sure to execute a Check System for dependency issues before you save the inventory as a profile, either in the CLI or in the console. In addition, if the host is a Solaris machine, execute a Check Withdrawn Patches profile. See Convert Inventory to Profile (-cip) Command.


#! /bin/bash

echo -n “Enter your user name:” 
read user 
echo -n “Enter your password:” 
read password 

echo “The list of hosts is:” 
uce_cli -lah -u “$user” -p “$password” 
echo -n “Copy the name of the host you want:” 
read host 
echo “The inventory of this host will be saved as a profile.” 
echo -n “Type a name for this profile:” 
read profileName 

echo “Checking $host for dependency issues....” 
uce_cli -sj -P “Check system” -C “YesToAll” -h “$host” -dp -u “$user” -p “$password” 
# Always run the System Test for Dependency Issues before saving an inventory. 
# YesToAll is a policy that says Yes to all actions on SW and Local. 
uce_cli -cip -h “$host” -P “$profileName” -u “$user” -p “$password”


Example 8–6 Saving a Saved Inventory as a Profile

This Copy Snapshot as Profile CLI command takes the name of a saved inventory (known as a snapshot in the CLI) as a parameter. Everything that was installed on the host when the inventory was saved, is marked as Required in the profile. This profile could be used for a mass clone job.

Make sure to execute a Check System for dependency issues before you save the inventory as a profile, either in the CLI or in the console. In addition, if the host is a Solaris machine, execute the Check Withdrawn Patches profile. See Convert Snapshot to Profile (-csp) Command.


#! /bin/bash

echo -n “Enter your user name:” 
read user 
echo -n “Enter your password:” 
read password 

echo “The list of hosts is:” 
uce_cli -lah -u “$user” -p “$password” 
echo -n “Copy the name of the host you want:” 
read host 

echo “The saved inventories of this host are:” 
uce_cli -lss -h “$host” -u “$user” -p “$password” 
echo -n “Copy the saved inventory that you want to save as a profile” 
read inven 
echo -n “Type a name for this profile:” 
read profileName

echo “Checking $host for dependency issues....” 
uce_cli -sj -P “Check system” -C “YesToAll” -h “$host” -dp -u “$user” -p “$password” 
# Always run the System Test for Dependency Issues before saving an inventory. 
# YesToAll is a policy that says Yes to all actions on SW and Local. 
uce_cli -csp -h “$host” -s “$inven” -P “$profileName” -u “$user” -p “$password”