Search in sources :

Example 1 with ListMultiPathEntriesCommand

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

the class FindMultiPathEntriesForMountPoint method executeTask.

@Override
public Void executeTask() throws Exception {
    List<MultiPathEntry> allMultiPathEntries = executeCommand(new ListMultiPathEntriesCommand(), SHORT_TIMEOUT);
    for (VolumeSpec volume : volumes) {
        volume.multipathEntries = Lists.newArrayList();
        String device = volume.mountPoint.getDevice();
        if (StringUtils.startsWith(device, "/dev/mapper/")) {
            String deviceName = StringUtils.substringAfterLast(device, "/");
            for (MultiPathEntry entry : allMultiPathEntries) {
                if (StringUtils.equals(deviceName, entry.getName())) {
                    volume.multipathEntries.add(entry);
                    break;
                }
            }
        }
        if (volume.multipathEntries.size() == 0) {
            warn("FindMultiPathEntriesForMountPoint.noMultipathEntries", volume.mountPoint.getPath());
        }
    }
    return null;
}
Also used : VolumeSpec(com.emc.sa.service.linux.UnmountBlockVolumeHelper.VolumeSpec) ListMultiPathEntriesCommand(com.iwave.ext.linux.command.ListMultiPathEntriesCommand) MultiPathEntry(com.iwave.ext.linux.model.MultiPathEntry)

Example 2 with ListMultiPathEntriesCommand

use of com.iwave.ext.linux.command.ListMultiPathEntriesCommand 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 3 with ListMultiPathEntriesCommand

use of com.iwave.ext.linux.command.ListMultiPathEntriesCommand 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 4 with ListMultiPathEntriesCommand

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

the class LinuxSystemCLI method listMultiPathEntries.

public List<MultiPathEntry> listMultiPathEntries() {
    ListMultiPathEntriesCommand command = new ListMultiPathEntriesCommand();
    executeCommand(command);
    return command.getResults();
}
Also used : ListMultiPathEntriesCommand(com.iwave.ext.linux.command.ListMultiPathEntriesCommand)

Aggregations

ListMultiPathEntriesCommand (com.iwave.ext.linux.command.ListMultiPathEntriesCommand)4 MultiPathEntry (com.iwave.ext.linux.model.MultiPathEntry)3 VolumeSpec (com.emc.sa.service.linux.UnmountBlockVolumeHelper.VolumeSpec)1