Search in sources :

Example 6 with PowerPathDevice

use of com.iwave.ext.linux.model.PowerPathDevice in project coprhd-controller by CoprHD.

the class FindPowerPathEntryForVolume method executeTask.

@Override
public PowerPathDevice executeTask() throws Exception {
    PowerPathDevice entry = findPowerPathEntry(volume);
    if (entry == null) {
        throw stateException("FindPowerPathEntryForVolume.illegalState.noEntries", volume.getWwn().toLowerCase());
    }
    logInfo("find.powerpath.wwn", entry);
    return entry;
}
Also used : PowerPathDevice(com.iwave.ext.linux.model.PowerPathDevice)

Example 7 with PowerPathDevice

use of com.iwave.ext.linux.model.PowerPathDevice 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)

Example 8 with PowerPathDevice

use of com.iwave.ext.linux.model.PowerPathDevice in project coprhd-controller by CoprHD.

the class PowerPathHDSInquiryParser method parseDevice.

private PowerPathDevice parseDevice(String deviceBlock) {
    Matcher deviceMatcher = DEVICE_PATTERN.matcher(deviceBlock);
    if (deviceMatcher.find()) {
        PowerPathDevice device = new PowerPathDevice();
        device.setDevice(deviceMatcher.group(1));
        device.setVendor("HITACHI");
        device.setProduct("HDS");
        device.setWwn(deviceMatcher.group(3));
        return device;
    }
    return null;
}
Also used : PowerPathDevice(com.iwave.ext.linux.model.PowerPathDevice) Matcher(java.util.regex.Matcher)

Example 9 with PowerPathDevice

use of com.iwave.ext.linux.model.PowerPathDevice in project coprhd-controller by CoprHD.

the class PowerPathInvistaInquiryParser method parseDevice.

private PowerPathDevice parseDevice(String deviceBlock) {
    Matcher deviceMatcher = DEVICE_PATTERN.matcher(deviceBlock);
    if (deviceMatcher.find()) {
        PowerPathDevice device = new PowerPathDevice();
        device.setDevice(deviceMatcher.group(1));
        device.setVendor("EMC");
        device.setProduct("Invista");
        device.setWwn(deviceMatcher.group(5));
        return device;
    }
    return null;
}
Also used : PowerPathDevice(com.iwave.ext.linux.model.PowerPathDevice) Matcher(java.util.regex.Matcher)

Aggregations

PowerPathDevice (com.iwave.ext.linux.model.PowerPathDevice)9 Matcher (java.util.regex.Matcher)3 VolumeSpec (com.emc.sa.service.linux.UnmountBlockVolumeHelper.VolumeSpec)2 PowerPathInquiry (com.iwave.ext.linux.command.powerpath.PowerPathInquiry)2 ListHDisksCommand (com.emc.aix.command.ListHDisksCommand)1 PowerPathInquiry (com.emc.aix.command.PowerPathInquiry)1 VolumeSpec (com.emc.sa.service.aix.UnmountBlockVolumeHelper.VolumeSpec)1 FindPowerPathEntryForVolume (com.emc.sa.service.linux.tasks.FindPowerPathEntryForVolume)1 RemovePowerPathDevice (com.emc.sa.service.linux.tasks.RemovePowerPathDevice)1 PowerPathHDSInquiry (com.iwave.ext.linux.command.powerpath.PowerPathHDSInquiry)1 PowerPathInvistaInquiry (com.iwave.ext.linux.command.powerpath.PowerPathInvistaInquiry)1