Search in sources :

Example 1 with PowerPathHDSInquiry

use of com.iwave.ext.linux.command.powerpath.PowerPathHDSInquiry in project coprhd-controller by CoprHD.

the class FindPowerPathEntryForVolume method findPowerPathEntry.

private PowerPathDevice findPowerPathEntry(BlockObjectRestRep blockVolume) {
    List<PowerPathDevice> entries = executeCommand(new PowerPathInquiry(), SHORT_TIMEOUT);
    for (PowerPathDevice device : entries) {
        String deviceWwn = device.getWwn();
        logDebug("FindPowerPathEntryForVolume.checking", device.getDevice(), deviceWwn, blockVolume.getWwn());
        if (VolumeWWNUtils.wwnMatches(deviceWwn, blockVolume.getWwn())) {
            return device;
        }
    }
    entries = executeCommand(new PowerPathInvistaInquiry(), SHORT_TIMEOUT);
    for (PowerPathDevice device : entries) {
        String deviceWwn = device.getWwn();
        logDebug("FindPowerPathEntryForVolume.checking", device.getDevice(), deviceWwn, blockVolume.getWwn());
        if (VolumeWWNUtils.wwnMatches(deviceWwn, blockVolume.getWwn())) {
            return device;
        }
    }
    entries = executeCommand(new PowerPathHDSInquiry(), SHORT_TIMEOUT);
    for (PowerPathDevice device : entries) {
        String deviceWwn = device.getWwn();
        logDebug("FindPowerPathEntryForVolume.checking", device.getDevice(), deviceWwn, blockVolume.getWwn());
        if (VolumeWWNUtils.wwnHDSMatches(deviceWwn, blockVolume.getWwn())) {
            return device;
        }
    }
    logDebug("FindMultiPathEntryForVolume.noEntries", blockVolume.getWwn());
    return null;
}
Also used : PowerPathDevice(com.iwave.ext.linux.model.PowerPathDevice) PowerPathInquiry(com.iwave.ext.linux.command.powerpath.PowerPathInquiry) PowerPathInvistaInquiry(com.iwave.ext.linux.command.powerpath.PowerPathInvistaInquiry) PowerPathHDSInquiry(com.iwave.ext.linux.command.powerpath.PowerPathHDSInquiry)

Aggregations

PowerPathHDSInquiry (com.iwave.ext.linux.command.powerpath.PowerPathHDSInquiry)1 PowerPathInquiry (com.iwave.ext.linux.command.powerpath.PowerPathInquiry)1 PowerPathInvistaInquiry (com.iwave.ext.linux.command.powerpath.PowerPathInvistaInquiry)1 PowerPathDevice (com.iwave.ext.linux.model.PowerPathDevice)1