Search in sources :

Example 6 with MultiPathEntry

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

the class FindMultiPathEntryForDmName method executeTask.

@Override
public MultiPathEntry executeTask() throws Exception {
    List<MultiPathEntry> entries = executeCommand(new ListMultiPathEntriesCommand(), SHORT_TIMEOUT);
    MultiPathEntry entry = findMultiPathEntry(dmName, entries);
    if (entry == null) {
        throw stateException("FindMultiPathEntryForDmName.illegalState.couldNotFindEntry", dmName);
    }
    logInfo("find.multipath.dm.name", entry.toString());
    checkStatus(entry);
    return entry;
}
Also used : ListMultiPathEntriesCommand(com.iwave.ext.linux.command.ListMultiPathEntriesCommand) MultiPathEntry(com.iwave.ext.linux.model.MultiPathEntry)

Example 7 with MultiPathEntry

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

the class FindMultiPathEntryForVolume method executeTask.

@Override
public MultiPathEntry executeTask() throws Exception {
    List<MultiPathEntry> entries = executeCommand(new ListMultiPathEntriesCommand(), SHORT_TIMEOUT);
    MultiPathEntry entry = findMultiPathEntry(volume, entries);
    if (entry == null) {
        throw stateException("FindMultiPathEntryForVolume.illegalState.couldNotFindEntry", volume.getWwn().toLowerCase());
    }
    logInfo("find.multipath.wwn", entry.toString());
    checkStatus(entry);
    return entry;
}
Also used : ListMultiPathEntriesCommand(com.iwave.ext.linux.command.ListMultiPathEntriesCommand) MultiPathEntry(com.iwave.ext.linux.model.MultiPathEntry)

Example 8 with MultiPathEntry

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

the class FindMultiPathEntryForVolume method findMultiPathEntry.

protected MultiPathEntry findMultiPathEntry(BlockObjectRestRep blockVolume, List<MultiPathEntry> multipathEntries) {
    for (MultiPathEntry entry : multipathEntries) {
        String entryWwn = stripWwnPrefix(entry.getWwid());
        logDebug("FindMultiPathEntryForVolume.checking", entry.getName(), entryWwn, blockVolume.getWwn());
        if (VolumeWWNUtils.wwnMatches(entryWwn, volume.getWwn())) {
            return entry;
        }
    }
    logDebug("FindMultiPathEntryForVolume.noEntries", blockVolume.getWwn());
    return null;
}
Also used : MultiPathEntry(com.iwave.ext.linux.model.MultiPathEntry)

Example 9 with MultiPathEntry

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

the class ListMultiPathEntriesCommand method readEntry.

private MultiPathEntry readEntry(String textBlock) {
    Matcher m = ENTRY_PATTERN.matcher(textBlock);
    if (m.find()) {
        MultiPathEntry entry = new MultiPathEntry();
        entry.setName(m.group(1));
        // If there is no WWID group, it is the same as the name
        if (m.group(2) != null) {
            entry.setWwid(m.group(2));
        } else {
            entry.setWwid(entry.getName());
        }
        entry.setDmName(m.group(3));
        entry.setPaths(readPaths(textBlock));
        return entry;
    } else {
        return null;
    }
}
Also used : Matcher(java.util.regex.Matcher) MultiPathEntry(com.iwave.ext.linux.model.MultiPathEntry)

Aggregations

MultiPathEntry (com.iwave.ext.linux.model.MultiPathEntry)9 ListMultiPathEntriesCommand (com.iwave.ext.linux.command.ListMultiPathEntriesCommand)3 VolumeSpec (com.emc.sa.service.linux.UnmountBlockVolumeHelper.VolumeSpec)2 FindMultiPathEntryForDmName (com.emc.sa.service.linux.tasks.FindMultiPathEntryForDmName)1 FindMultiPathEntryForVolume (com.emc.sa.service.linux.tasks.FindMultiPathEntryForVolume)1 GetMultipathPrimaryPartitionDeviceParentDmName (com.emc.sa.service.linux.tasks.GetMultipathPrimaryPartitionDeviceParentDmName)1 TextParser (com.iwave.ext.text.TextParser)1 Matcher (java.util.regex.Matcher)1