This example shows how to report the connections of RAID controller initiators to targets on the managed server. RAID connection information is useful to system administrators who need to monitor system health.

This example assumes you have installed a VIB that contains an implementation of the Host Hardware RAID profile, defined by the SNIA. VMware does not implement this profile, but prominent hardware vendors provide implementations for their storage controllers.

This example assumes an implementation that models serial-attached SCSI connections to drives that belong to pooled RAID configurations. This model is similar to the SMI-S Host Hardware RAID Controller profile published by the SNIA. The model might or might not correspond to your hardware vendor’s implementation.

Locating Connections Between HBA Initiators and Targets shows the relationships of the CIM objects involved. Locating Connections Between HBA Initiators and Targets uses a fictitious namespace and class names that begin with the prefix ACME_.

This example enumerates the connections of a controller by starting from the instance of CIM_ComputerSystem subclassed as ACME_HBA that represents the RAID controller. You must do this procedure for each disk controller that you monitor on the managed server. See Monitor RAID Controller State for information about locating the RAID controllers attached to a managed system.

From the ACME_HBA instance, you traverse the CIM_SystemDevice association to the CIM_LogicalPort instances, then traverse the CIM_DeviceSAPImplementation association to the CIM_SCSIProtocolEndpoint instances.

The SMI-S specifies two different ways to model connections between targets and initiators. This example shows the simpler but less detailed choice.

Your hardware vendor’s implementation might not follow this approach. Contact the hardware vendor for more information about the implementation.

This example traverses the CIM_MemberOfCollection association from the CIM_SCSIProtocolEndpoint to the CIM_ConnectivityCollection instance that represents a connection to a SCSI target. If your vendor’s hardware implementation models the connection with the CIM_SCSIInitiatortargetLogicalUnitPath association, you can find connection status in that association instead of in the CIM_ConnectivityCollection instance.

Figure 1. Locating Connections Between HBA Initiators and Targets
Diagram shows path from SCSI controller to storage LUNs.

This pseudocode depends on the pseudocode in Make a Connection to the CIMOM and Mapping Integer Property Values to Strings.

To report state of RAID connections

Procedure

  1. From a given instance of CIM_ComputerSystem that represents a SCSI controller, traverse the CIM_SystemDevice association to reach the CIM_LogicalPort instances on the managed server.
    port_instance_names = connection.AssociatorNames( controller_instance_name, \
                                         AssocClass = 'CIM_SystemDevice', \
                                         ResultClass = ’CIM_LogicalPort’ )
    if len( port_instance_names ) is 0 
       print 'Error:  No ports associated with controller.'
       sys.exit(-1)
  2. For each logical port instance, traverse the CIM_DeviceSAPImplementation association to reach the matching instance of CIM_SCSIProtocolEndpoint.
    for port_instance_name in port_instance_names
       init_instance_names = connection.AssociatorNames( port_instance_name, \
                                            AssocClass = 'CIM_DeviceSAPImplementation', \
                                            ResultClass = ’CIM_SCSIProtocolEndpoint’ )
  3. From the instance of CIM_SCSIProtocolEndpoint, traverse the CIM_MemberOfCollection association to reach the instance of CIM_ConnectivityCollection that represents the connection between initiator and target.
       for init_instance_name in init_instance_names
          conn_instance_names = connection.AssociatorNames( init_instance_name, \
                                             AssocClass = 'CIM_MemberOfCollection', \
                                             ResultClass = ’CIM_ConnectivityCollection’ )
  4. For the resulting instance of CIM_ConnectivityCollection, print the InstanceID and ConnectivityStatus properties.
          for instance_name in conn_instance_names 
             print_scsi_connection_instance( connection, instance_name )
    
    use value_mapper renamed map
    
    function print_scsi_connection_instance( connection, instance_name 
       health_state = connectivity_status = ’’
       instance = connection.GetInstance( instance_name )
       if instance.key( ’InstanceID’ ) 
          instance_id = instance[ ’InstanceID’ ]
       else
          instance_id = ’InstanceID not available’
       if instance.key( ’ConnectivityStatus’ ) 
          connectivity_status = map.map_instance_property_to_string( connection, \
                                                                     instance, \
                                                                     ’ConnectivityStatus’ )
       if not connectivity_status 
          connectivity_status = ’not available’
       print ’   Port connection ’ + instance_id
       print ’     ConnectivityStatus: ’ + connectivity status