Search in sources :

Example 1 with MultipathException

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

the class LinuxHostDiscoveryAdapter method checkMultipathSoftwareCompatibility.

private void checkMultipathSoftwareCompatibility(Host host) {
    LinuxSystemCLI cli = createLinuxCLI(host);
    String powerpathMessage = null;
    String multipathMessage = null;
    try {
        PowermtCheckRegistrationCommand command = new PowermtCheckRegistrationCommand();
        cli.executeCommand(command, SecureShellSupport.SHORT_TIMEOUT);
        // powerpath is installed
        LOG.info("PowerPath is installed");
        return;
    } catch (PowerPathException e) {
        powerpathMessage = e.getMessage();
        LOG.info("PowerPath is unavailable: " + powerpathMessage);
    } catch (Exception e) {
        LOG.info("Error while checking for powerpath: " + e.getMessage(), e);
    }
    try {
        MultipathCommand command = new MultipathCommand();
        command.addArgument("-l");
        cli.executeCommand(command, SecureShellSupport.SHORT_TIMEOUT);
        // multipath is installed
        LOG.info("Multipath is installed");
        return;
    } catch (MultipathException e) {
        multipathMessage = e.getMessage();
        LOG.info("Multipath is unavailable: " + multipathMessage);
    } catch (Exception e) {
        LOG.info("Error while checking for multipath: " + e.getMessage(), e);
    }
    throw new CompatibilityException("No multipath software available: \n" + powerpathMessage + "\n" + multipathMessage);
}
Also used : LinuxSystemCLI(com.iwave.ext.linux.LinuxSystemCLI) CompatibilityException(com.emc.storageos.computesystemcontroller.exceptions.CompatibilityException) PowermtCheckRegistrationCommand(com.iwave.ext.linux.command.powerpath.PowermtCheckRegistrationCommand) MultipathCommand(com.iwave.ext.linux.command.MultipathCommand) MultipathException(com.iwave.ext.linux.command.MultipathException) PowerPathException(com.iwave.ext.linux.command.powerpath.PowerPathException) MultipathException(com.iwave.ext.linux.command.MultipathException) PowerPathException(com.iwave.ext.linux.command.powerpath.PowerPathException) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) CompatibilityException(com.emc.storageos.computesystemcontroller.exceptions.CompatibilityException) CommandException(com.iwave.ext.command.CommandException) JSchException(com.jcraft.jsch.JSchException) ComputeSystemControllerException(com.emc.storageos.computesystemcontroller.exceptions.ComputeSystemControllerException)

Aggregations

CompatibilityException (com.emc.storageos.computesystemcontroller.exceptions.CompatibilityException)1 ComputeSystemControllerException (com.emc.storageos.computesystemcontroller.exceptions.ComputeSystemControllerException)1 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)1 CommandException (com.iwave.ext.command.CommandException)1 LinuxSystemCLI (com.iwave.ext.linux.LinuxSystemCLI)1 MultipathCommand (com.iwave.ext.linux.command.MultipathCommand)1 MultipathException (com.iwave.ext.linux.command.MultipathException)1 PowerPathException (com.iwave.ext.linux.command.powerpath.PowerPathException)1 PowermtCheckRegistrationCommand (com.iwave.ext.linux.command.powerpath.PowermtCheckRegistrationCommand)1 JSchException (com.jcraft.jsch.JSchException)1