Search in sources :

Example 1 with PowerPathInquiry

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

the class FindPowerPathEntriesForMountPoint method executeTask.

@Override
public Void executeTask() throws Exception {
    List<PowerPathDevice> powerPathDevices = executeCommand(new PowerPathInquiry());
    for (VolumeSpec volume : volumes) {
        volume.powerpathDevices = Lists.newArrayList();
        String device = volume.mountPoint.getDevice();
        for (PowerPathDevice powerpathDevice : powerPathDevices) {
            logDebug("FindPowerPathEntriesForMountPoint.checking", powerpathDevice.getDeviceName(), powerpathDevice.getDevice(), device);
            if (StringUtils.equals(device, powerpathDevice.getDevice())) {
                volume.powerpathDevices.add(powerpathDevice);
                break;
            }
        }
        if (volume.powerpathDevices.size() == 0) {
            logWarn("FindPowerPathEntriesForMountPoint.noDevices", volume.mountPoint.getPath());
        }
    }
    return null;
}
Also used : VolumeSpec(com.emc.sa.service.linux.UnmountBlockVolumeHelper.VolumeSpec) PowerPathDevice(com.iwave.ext.linux.model.PowerPathDevice) PowerPathInquiry(com.iwave.ext.linux.command.powerpath.PowerPathInquiry)

Example 2 with PowerPathInquiry

use of com.iwave.ext.linux.command.powerpath.PowerPathInquiry 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

PowerPathInquiry (com.iwave.ext.linux.command.powerpath.PowerPathInquiry)2 PowerPathDevice (com.iwave.ext.linux.model.PowerPathDevice)2 VolumeSpec (com.emc.sa.service.linux.UnmountBlockVolumeHelper.VolumeSpec)1 PowerPathHDSInquiry (com.iwave.ext.linux.command.powerpath.PowerPathHDSInquiry)1 PowerPathInvistaInquiry (com.iwave.ext.linux.command.powerpath.PowerPathInvistaInquiry)1