Report the BIOS Version

System administrators can query the BIOS version of the managed server as part of routine maintenance.

This example shows how to get the BIOS version string by traversing the CIM_InstalledSoftwareIdentity association from the server Scoping Instance. The VMware implementation of the Software Inventory profile uses CIM_InstalledSoftwareIdentity to associate firmware and hypervisor instances of CIM_SoftwareIdentity to the server Scoping Instance. VMware does not implement the CIM_ElementSoftwareIdentity association for firmware and hypervisor instances, so you must use CIM_InstalledSoftwareIdentity to locate the system BIOS instance of CIM_SoftwareIdentity.

Locating the BIOS Version from the Base Server Scoping Instance shows the relationships of the CIM objects involved.

Figure 1. Locating the BIOS Version from the Base Server Scoping Instance
Diagram shows path from scoping instance to OMC_SMASHFirmwareIdentity.

The VMware implementation of CIM_SoftwareIdentity 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 BIOS version

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
    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. Traverse the CIM_InstalledSoftwareIdentity association to reach the CIM_SoftwareIdentity instances that correspond to the software on the managed server.
    instance_names = connection.Associators( scoping_instance_name, \
                                AssocClass = 'CIM_InstalledSoftwareIdentity', \
                                ResultRole = 'InstalledSoftware' )
  4. Select the CIM_SoftwareIdentity instance that represents the BIOS of the managed server, and print the Manufacturer and VersionString properties.
    function print_info( connection, instance_name ) 
       instance = connection.GetInstance( instance_name )
       print '\n' + ’CIM_SoftwareIdentity’ + ' [' + instance.classname + '] ->'
       for prop in [ 'Manufacturer', 'VersionString' ] 
          print ' %30s = %s' % ( prop, instance[prop] )
    
    for instance_name in instance_names 
       instance = connection.GetInstance( instance_name )
       if instance['Name'] == 'System BIOS' 
          print_info( connection, instance_name )