Search in sources :

Example 1 with VNXException

use of com.emc.storageos.vnx.xmlapi.VNXException in project coprhd-controller by CoprHD.

the class VNXFileCommunicationInterface method checkCifsEnabled.

private boolean checkCifsEnabled(final StorageSystem system, VNXDataMover mover) throws VNXException {
    boolean cifsSupported = false;
    try {
        Map<String, Object> reqAttributeMap = getRequestParamsMap(system);
        reqAttributeMap.put(VNXFileConstants.MOVER_ID, Integer.toString(mover.getId()));
        reqAttributeMap.put(VNXFileConstants.ISVDM, "false");
        _discExecutor.setKeyMap(reqAttributeMap);
        _discExecutor.execute((Namespace) _discNamespaces.getNsList().get(VNXFileConstants.VNX_FILE_CIFS_CONFIG));
        cifsSupported = (Boolean) _discExecutor.getKeyMap().get(VNXFileConstants.CIFS_SUPPORTED);
    } catch (BaseCollectionException e) {
        throw new VNXException("check CIFS Enabled op failed", e);
    }
    return cifsSupported;
}
Also used : VNXException(com.emc.storageos.vnx.xmlapi.VNXException) DiscoveredDataObject(com.emc.storageos.db.client.model.DiscoveredDataObject) UnManagedDiscoveredObject(com.emc.storageos.db.client.model.UnManagedDiscoveredObject) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException)

Example 2 with VNXException

use of com.emc.storageos.vnx.xmlapi.VNXException in project coprhd-controller by CoprHD.

the class VNXFileCommunicationInterface method getVdmPortGroups.

private List<VNXVdm> getVdmPortGroups(final StorageSystem system) throws VNXException {
    List<VNXVdm> vdms = null;
    try {
        Map<String, Object> reqAttributeMap = getRequestParamsMap(system);
        _discExecutor.setKeyMap(reqAttributeMap);
        _discExecutor.execute((Namespace) _discNamespaces.getNsList().get("vnxfileVdm"));
        vdms = (ArrayList<VNXVdm>) _discExecutor.getKeyMap().get(VNXFileConstants.VDM_INFO);
    } catch (BaseCollectionException e) {
        throw new VNXException("Get Vdm Port Groups op failed", e);
    }
    return vdms;
}
Also used : VNXException(com.emc.storageos.vnx.xmlapi.VNXException) VNXVdm(com.emc.storageos.vnx.xmlapi.VNXVdm) DiscoveredDataObject(com.emc.storageos.db.client.model.DiscoveredDataObject) UnManagedDiscoveredObject(com.emc.storageos.db.client.model.UnManagedDiscoveredObject) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException)

Example 3 with VNXException

use of com.emc.storageos.vnx.xmlapi.VNXException in project coprhd-controller by CoprHD.

the class VNXFileCommunicationInterface method getCifServers.

private List<VNXCifsServer> getCifServers(final StorageSystem system, String moverId, String isVdm) throws VNXException {
    List<VNXCifsServer> cifsServers;
    try {
        Map<String, Object> reqAttributeMap = getRequestParamsMap(system);
        reqAttributeMap.put(VNXFileConstants.MOVER_ID, moverId);
        reqAttributeMap.put(VNXFileConstants.ISVDM, isVdm);
        _discExecutor.setKeyMap(reqAttributeMap);
        _discExecutor.execute((Namespace) _discNamespaces.getNsList().get(VNXFileConstants.VNX_FILE_CIFS_CONFIG));
        cifsServers = (List<VNXCifsServer>) _discExecutor.getKeyMap().get(VNXFileConstants.CIFS_SERVERS);
    } catch (BaseCollectionException e) {
        throw new VNXException("Get CifServers op failed", e);
    }
    return cifsServers;
}
Also used : VNXCifsServer(com.emc.storageos.vnx.xmlapi.VNXCifsServer) VNXException(com.emc.storageos.vnx.xmlapi.VNXException) DiscoveredDataObject(com.emc.storageos.db.client.model.DiscoveredDataObject) UnManagedDiscoveredObject(com.emc.storageos.db.client.model.UnManagedDiscoveredObject) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException)

Example 4 with VNXException

use of com.emc.storageos.vnx.xmlapi.VNXException in project coprhd-controller by CoprHD.

the class VNXFileCommunicationInterface method getPortGroups.

private List<VNXDataMover> getPortGroups(final StorageSystem system) throws VNXException {
    List<VNXDataMover> dataMovers = null;
    try {
        Map<String, Object> reqAttributeMap = getRequestParamsMap(system);
        _discExecutor.setKeyMap(reqAttributeMap);
        _discExecutor.execute((Namespace) _discNamespaces.getNsList().get("vnxfileStoragePortGroup"));
        dataMovers = (ArrayList<VNXDataMover>) _discExecutor.getKeyMap().get(VNXFileConstants.STORAGE_PORT_GROUPS);
    } catch (BaseCollectionException e) {
        throw new VNXException("Get Port Groups op failed", e);
    }
    return dataMovers;
}
Also used : VNXDataMover(com.emc.storageos.vnx.xmlapi.VNXDataMover) VNXException(com.emc.storageos.vnx.xmlapi.VNXException) DiscoveredDataObject(com.emc.storageos.db.client.model.DiscoveredDataObject) UnManagedDiscoveredObject(com.emc.storageos.db.client.model.UnManagedDiscoveredObject) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException)

Example 5 with VNXException

use of com.emc.storageos.vnx.xmlapi.VNXException in project coprhd-controller by CoprHD.

the class VNXFileCommunicationInterface method discoverControlStation.

/**
 * Discover the Control Station for the specified VNX File storage array. Since the StorageSystem object
 * currently exists, this method updates information in the object.
 *
 * @param system
 * @throws VNXFileCollectionException
 */
private void discoverControlStation(StorageSystem system) throws VNXFileCollectionException {
    _logger.info("Start Control Station discovery for storage system {}", system.getId());
    VNXControlStation tmpSystem = null;
    try {
        tmpSystem = getControlStation(system);
    } catch (VNXException e) {
        throw new VNXFileCollectionException("Get control station op failed", e);
    }
    if (tmpSystem != null) {
        String sysNativeGuid = NativeGUIDGenerator.generateNativeGuid(DiscoveredDataObject.Type.vnxfile.toString(), tmpSystem.getSerialNumber());
        system.setNativeGuid(sysNativeGuid);
        system.setSerialNumber(tmpSystem.getSerialNumber());
        String firmwareVersion = tmpSystem.getSoftwareVersion();
        String minimumSupportedVersion = VersionChecker.getMinimumSupportedVersion(Type.valueOf(system.getSystemType()));
        // Example version String for VNX looks like 7.1.56-5.
        firmwareVersion = firmwareVersion.replaceAll("-", ".").trim();
        minimumSupportedVersion = minimumSupportedVersion.replaceAll("-", ".");
        system.setFirmwareVersion(firmwareVersion);
        _logger.info("Verifying version details : Minimum Supported Version {} - Discovered VNX Version {}", minimumSupportedVersion, firmwareVersion);
        if (VersionChecker.verifyVersionDetails(minimumSupportedVersion, firmwareVersion) < 0) {
            system.setCompatibilityStatus(DiscoveredDataObject.CompatibilityStatus.INCOMPATIBLE.name());
            system.setReachableStatus(false);
            DiscoveryUtils.setSystemResourcesIncompatible(_dbClient, _coordinator, system.getId());
            VNXFileCollectionException vnxe = new VNXFileCollectionException(String.format(" ** This version of VNX File is not supported ** Should be a minimum of %s", minimumSupportedVersion));
            throw vnxe;
        }
        system.setCompatibilityStatus(DiscoveredDataObject.CompatibilityStatus.COMPATIBLE.name());
        system.setReachableStatus(true);
    } else {
        _logger.error("Failed to retrieve control station info!");
        system.setReachableStatus(false);
    }
    _logger.info("Control Station discovery for storage system {} complete", system.getId());
}
Also used : VNXFileCollectionException(com.emc.storageos.plugins.metering.vnxfile.VNXFileCollectionException) VNXControlStation(com.emc.storageos.vnx.xmlapi.VNXControlStation) VNXException(com.emc.storageos.vnx.xmlapi.VNXException)

Aggregations

VNXException (com.emc.storageos.vnx.xmlapi.VNXException)43 XMLApiResult (com.emc.storageos.vnx.xmlapi.XMLApiResult)29 VNXFileCommApi (com.emc.storageos.volumecontroller.impl.plugins.provisioning.VNXFileCommApi)16 ApplicationContext (org.springframework.context.ApplicationContext)16 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)16 BiosCommandResult (com.emc.storageos.volumecontroller.impl.BiosCommandResult)15 URISyntaxException (java.net.URISyntaxException)15 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)15 FileObject (com.emc.storageos.db.client.model.FileObject)14 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)14 BaseCollectionException (com.emc.storageos.plugins.BaseCollectionException)11 ArrayList (java.util.ArrayList)11 DiscoveredDataObject (com.emc.storageos.db.client.model.DiscoveredDataObject)10 UnManagedDiscoveredObject (com.emc.storageos.db.client.model.UnManagedDiscoveredObject)10 Checkpoint (com.emc.nas.vnxfile.xmlapi.Checkpoint)8 StorageHADomain (com.emc.storageos.db.client.model.StorageHADomain)8 VNXSnapshot (com.emc.storageos.vnx.xmlapi.VNXSnapshot)7 FileShare (com.emc.storageos.db.client.model.FileShare)6 SMBFileShare (com.emc.storageos.db.client.model.SMBFileShare)6 VNXFileExport (com.emc.storageos.vnx.xmlapi.VNXFileExport)6