MPIO
index
/usr/lib/sca/python/MPIO.py

Supportconfig Analysis Library for Device Mapper Multi-path I/O (MPIO) Related Patterns
 
Library of python functions used when dealing with issues incident to MPIO

 
Modules
       
Core
re

 
Functions
       
convertKeyValue(STR_TO_CONVERT)
devicesManaged()
Determines if any disks are managed with MPIO. It looks at the multipath -ll output for device lines with -+- in them.
 
Args: None
Returns: True or False
        True if devices are being managed
        False if they are not.
 
Example:
if( SUSE.mpioDevicesManaged() ):
        Core.updateStatus(Core.IGNORE, "MPIO Disks are being managed")
else:
        Core.updateStatus(Core.WARNG, "No MPIO Disks are being managed")
getDiskID(DEVICE_PATH)
Gets the system disk (sd?) or world wide name ID for use in MPIO managed disk lookup.
Returns and sd disk device without partition numbers or a wwid
getManagedDevices()
Normalizes the multipath -ll output into a list of dictionaries. The multipath -ll output looks similar to:
#==[ Command ]======================================#
# /sbin/multipath -ll
mpathe (3600601609e003700bd875493d3ade411) dm-2 DGC,VRAID
size=1.0T features='1 queue_if_no_path' hwhandler='1 emc' wp=rw
|-+- policy='round-robin 0' prio=4 status=active
| |- 2:0:1:4 sdai 66:32  active ready running
| `- 1:0:1:4 sdo  8:224  active ready running
`-+- policy='round-robin 0' prio=1 status=enabled
        |- 1:0:0:4 sde  8:64   active ready running
        `- 2:0:0:4 sdy  65:128 active ready running
 
Args: None
Returns: List of Dictionaries
 
Example:
Though the order of the elements will be different that shown. These are ordered to demonstrate the key value pairs. 
getManagedDevices would return a list of dictionaries for the example above as follows:
 
[       {'alias': 'mpathe', 'wwid': '3600601609e003700bd875493d3ade411', 'dmdev': 'dm-2', 'description': 'DGC,VRAID', 
        'size': '1.0T', 'features': '1 queue_if_no_path', 'hwhandler': '1 emc', 'wp': 'rw', 
        'devicepath': 
        [       {'path_group_policy': 'round-robin 0', 'path_state': 'running', 'path_group_status': 'active', 'path_devnode': 'sdai', 'path_group_prio': '4', 'dm_status': 'ready', 'path_major_minor': '66:32', 'path_scsi_addr': '2:0:1:4', 'path_status': 'active'}, 
                {'path_group_policy': 'round-robin 0', 'path_state': 'running', 'path_group_status': 'active', 'path_devnode': 'sdo', 'path_group_prio': '4', 'dm_status': 'ready', 'path_major_minor': '8:224', 'path_scsi_addr': '1:0:1:4', 'path_status': 'active'}, 
                {'path_group_policy': 'round-robin 0', 'path_state': 'running', 'path_group_status': 'enabled', 'path_devnode': 'sde', 'path_group_prio': '1', 'dm_status': 'ready', 'path_major_minor': '8:64', 'path_scsi_addr': '1:0:0:4', 'path_status': 'active'}, 
                {'path_group_policy': 'round-robin 0', 'path_state': 'running', 'path_group_status': 'enabled', 'path_devnode': 'sdy', 'path_group_prio': '1', 'dm_status': 'ready', 'path_major_minor': '65:128', 'path_scsi_addr': '2:0:0:4', 'path_status': 'active'}
        ]
}]
partitionManagedDevice(DISK_ID, MPIO_DEVS)
Checks if the DISK_ID is present in the MPIO_DEVS or multipath devices that do not have a no_partitions feature.
Returns True if the DISK_ID is managed without no_partitions or False if it is not managed or if no_partitions is found on the wwid.