Search in sources :

Example 1 with VolumeSpec

use of com.emc.sa.service.linux.UnmountBlockVolumeHelper.VolumeSpec in project coprhd-controller by CoprHD.

the class LinuxSupport method findMultipathEntries.

public void findMultipathEntries(List<VolumeSpec> volumes) {
    for (VolumeSpec volume : volumes) {
        MultiPathEntry device = execute(new FindMultiPathEntryForVolume(volume.viprVolume));
        volume.multipathEntries = Lists.newArrayList(device);
    }
}
Also used : VolumeSpec(com.emc.sa.service.linux.UnmountBlockVolumeHelper.VolumeSpec) FindMultiPathEntryForVolume(com.emc.sa.service.linux.tasks.FindMultiPathEntryForVolume) MultiPathEntry(com.iwave.ext.linux.model.MultiPathEntry)

Example 2 with VolumeSpec

use of com.emc.sa.service.linux.UnmountBlockVolumeHelper.VolumeSpec 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 3 with VolumeSpec

use of com.emc.sa.service.linux.UnmountBlockVolumeHelper.VolumeSpec 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 4 with VolumeSpec

use of com.emc.sa.service.linux.UnmountBlockVolumeHelper.VolumeSpec in project coprhd-controller by CoprHD.

the class LinuxSupport method findPowerPathDevices.

public void findPowerPathDevices(List<VolumeSpec> volumes) {
    for (VolumeSpec volume : volumes) {
        PowerPathDevice device = execute(new FindPowerPathEntryForVolume(volume.viprVolume));
        volume.powerpathDevices = Lists.newArrayList(device);
    }
}
Also used : VolumeSpec(com.emc.sa.service.linux.UnmountBlockVolumeHelper.VolumeSpec) RemovePowerPathDevice(com.emc.sa.service.linux.tasks.RemovePowerPathDevice) PowerPathDevice(com.iwave.ext.linux.model.PowerPathDevice) FindPowerPathEntryForVolume(com.emc.sa.service.linux.tasks.FindPowerPathEntryForVolume)

Example 5 with VolumeSpec

use of com.emc.sa.service.linux.UnmountBlockVolumeHelper.VolumeSpec in project coprhd-controller by CoprHD.

the class FindMountPointsForVolumes method executeTask.

@Override
public Void executeTask() throws Exception {
    ListMountPointsCommand command = new ListMountPointsCommand();
    Map<String, MountPoint> results = executeCommand(command, SHORT_TIMEOUT);
    for (VolumeSpec volume : volumes) {
        volume.mountPoint = LinuxUtils.getMountPoint(hostId, results, volume.viprVolume);
    }
    return null;
}
Also used : ListMountPointsCommand(com.iwave.ext.linux.command.ListMountPointsCommand) MountPoint(com.iwave.ext.linux.model.MountPoint) VolumeSpec(com.emc.sa.service.linux.UnmountBlockVolumeHelper.VolumeSpec)

Aggregations

VolumeSpec (com.emc.sa.service.linux.UnmountBlockVolumeHelper.VolumeSpec)5 MultiPathEntry (com.iwave.ext.linux.model.MultiPathEntry)2 PowerPathDevice (com.iwave.ext.linux.model.PowerPathDevice)2 FindMultiPathEntryForVolume (com.emc.sa.service.linux.tasks.FindMultiPathEntryForVolume)1 FindPowerPathEntryForVolume (com.emc.sa.service.linux.tasks.FindPowerPathEntryForVolume)1 RemovePowerPathDevice (com.emc.sa.service.linux.tasks.RemovePowerPathDevice)1 ListMountPointsCommand (com.iwave.ext.linux.command.ListMountPointsCommand)1 ListMultiPathEntriesCommand (com.iwave.ext.linux.command.ListMultiPathEntriesCommand)1 PowerPathInquiry (com.iwave.ext.linux.command.powerpath.PowerPathInquiry)1 MountPoint (com.iwave.ext.linux.model.MountPoint)1