System administrators can use a CIM client application to query the name and version information for the vSphere Installation Bundles (VIBs) that are installed on the managed server. This information is valuable for diagnosing software problems.

Note: The Software Update profile is not supported in the base installation. It requires a separate VIB installation.

This example shows how to get the name and software version string by traversing the CIM_ElementSoftwareIdentity association from the server Scoping Instance. The VMware implementation of the Software Inventory profile uses CIM_InstalledSoftwareIdentity to associate only firmware and hypervisor instances of CIM_SoftwareIdentity to the server Scoping Instance. For VIBs, VMware implements the CIM_ElementSoftwareIdentity association. The ElementSoftwareStatus property of the CIM_ElementSoftwareIdentity association contains the value 6 (Installed).

Locating the Installed Software Versions from the Base Server Scoping Instance shows the relationships of the CIM objects involved. VIBs are modeled with instances of VMware_ComponentSoftwareIdentity.

The CIM_InstalledSoftwareIdentity association that leads to the instance of VMware_HypervisorSoftwareIdentity is included in the illustration for comparison only.

Figure 1. Locating the Installed Software Versions from the Base Server Scoping Instance
Diagram shows path from scoping instance to VMware_HypervisorSoftwareIdentity.

The VMware implementation of CIM_SoftwareIdentity for VIBs makes the version available in the VersionString property rather than in the MajorVersion and MinorVersion properties.

This pseudocode depends on the pseudocode in Make a Connection to the CIMOM and Identifying the Base Server Scoping Instance.

To report the VIB versions

Procedure

  1. Connect to the server URL.

    Specify the Interop namespace, supplied as a parameter, for the connection.

    use wbemlib
    use sys
    use connection renamed cnx
    use registered_profiles renamed prof
    connection = Null
    
    params = cnx.get_params()
    if params is Null 
       sys.exit(-1)
    interop_params = params
    interop_params['namespace'] = 'root/interop'
    connection = cnx.connect_to_host( interop_params )
    if connection is Null 
       print 'Failed to connect to: ' + params['host'] + ' as user: ' + params['user']
       sys.exit(-1)
  2. Locate the Base Server Scoping Instance that represents the managed server.
    use scoping_instance renamed si
    
    scoping_instance_name = si.get_scoping_instance_name( connection )
    if scoping_instance_name is Null
       print 'Failed to find server Scoping Instance.'
       sys.exit(-1)
  3. Use the CIM_ElementSoftwareIdentity association to identify the CIM_SoftwareIdentity instances that correspond to the software on the managed server.
    element_softwares = connection.References( scoping_instance_name, \
                                              ResultClass = 'VMware_ElementSoftwareIdentity' )
    if len( element_softwares ) < 1 
       print 'No software was found for the server Scoping Instance.'
       sys.exit(-1)
  4. Select only those instances for which the ElementSoftwareStatus property of the CIM_ElementSoftwareIdentity association has a value of 6 (Installed).

    Print the ElementName and VersionString properties of the CIM_SoftwareIdentity instances.

    function print_info( instance )
       print '  Software = %s' % ( instance[ 'ElementName' ] )
       print '     (Version %s)' % ( instance[ 'VersionString' ] )
    
    print 'Installed software:'
    count = 0
    for software in element_softwares
       if software[ 'ElementSoftwareStatus' ] == [6L]
          print_instance( connection.GetInstance( software[ 'Antecedent' ] ) )
          count = count + 1
    if not count
       print '   None'