Solaris Device Uniqueness

Problem

Determining Solaris Devices Uniqueness

Solaris has both strong and weak uniqueness, the type of uniqueness used is chosen based on the availability of certain commands. In Solaris the uniqueness string contains just one value, either the OS GUID (strong) or the MAC Address of the device (weak). In versions prior to this uniqueness string was technically made up of 3 pieces of information, the strong or weak component, the hostname and the Virtualization Identifier. However the Virtualization Identifier component was always blank (as it is not retrieved until later in the scan), this leaves just the hostname. The hostname has been removed as the logic in creating a device will now decide when to create a duplicate based on the hostname and correctly set the CollisionDeviceID.

Solution

Strong

Strong uniqueness is based on identifying the OS GUID from the prodreg command. This command returns a list of registered products and we parse this list to identify the Solaris OS install and retrieve its GUID.

prodreg browse

If the prodreg command fails, we check to see why it failed by doing a which command to see if it is in our path (emulating error code 127 which is not available in Solaris).

which prodreg

If prodreg is not found we enable the weak uniqueness flag for the device and continue with the scan.

Weak

Weak uniqueness is based on the primary MAC address of the device. To reliably retrieve the MAC address several different methods are attempted. We initially attempt to retrieve it directly from ifconfig. ifconfig -a If we do not have the MAC address we then attempt to identify it from the arp command. The arp command gives us a list of all active connections, their IP addresses and MAC addresses. If we can identify the primary network card we and IP address (or hostname) in the list we can then determine the correct MAC address. As a shortcut we check to see if the hostname (from uname) is listed in the arp output.

arp - a

If we still do not have the MAC address we list the adapters using the command below. We then identify the IP address associated with the adapter (from the ifconfig output) and check the arp output for it. If this still does not return the MAC address we then check the hosts file for the loghost entry and use the associated IP address and hostname (if they are different from the ones previously checked) to identify the MAC address in the arp output.

cat /etc/hosts

Filter by label

There are no items with the selected labels at this time.