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;
}
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;
}
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;
}
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;
}
}
Aggregations