Search in sources :

Example 1 with IsilonClusterConfig

use of com.emc.storageos.isilon.restapi.IsilonClusterConfig in project coprhd-controller by CoprHD.

the class IsilonCommunicationInterface method discoverCluster.

private void discoverCluster(StorageSystem storageSystem) throws IsilonCollectionException {
    URI storageSystemId = storageSystem.getId();
    try {
        _log.info("discoverCluster information for storage system {} - start", storageSystemId);
        IsilonApi isilonApi = getIsilonDevice(storageSystem);
        IsilonClusterConfig clusterConfig = isilonApi.getClusterConfig();
        storageSystem.setSerialNumber(clusterConfig.getGuid());
        String nativeGuid = NativeGUIDGenerator.generateNativeGuid(DiscoveredDataObject.Type.isilon.toString(), clusterConfig.getGuid());
        storageSystem.setNativeGuid(nativeGuid);
        String clusterReleaseVersion = clusterConfig.getOnefs_version_info().getReleaseVersionNumber();
        storageSystem.setFirmwareVersion(clusterReleaseVersion);
        String minimumSupportedVersion = VersionChecker.getMinimumSupportedVersion(Type.valueOf(storageSystem.getSystemType()));
        _log.info("Verifying version details : Minimum Supported Version {} - Discovered Cluster Version {}", minimumSupportedVersion, clusterReleaseVersion);
        if (VersionChecker.verifyVersionDetails(minimumSupportedVersion, clusterReleaseVersion) < 0) {
            storageSystem.setCompatibilityStatus(DiscoveredDataObject.CompatibilityStatus.INCOMPATIBLE.name());
            storageSystem.setReachableStatus(false);
            DiscoveryUtils.setSystemResourcesIncompatible(_dbClient, _coordinator, storageSystem.getId());
            IsilonCollectionException ice = new IsilonCollectionException(String.format(" ** This version of Isilon firmware is not supported ** Should be a minimum of %s", minimumSupportedVersion));
            throw ice;
        }
        storageSystem.setSupportSoftLimit(false);
        storageSystem.setSupportNotificationLimit(false);
        // Check license status for smart quota and set the support attributes as true
        if (ACTIVATED.equalsIgnoreCase(isilonApi.getLicenseInfo(IsilonLicenseType.SMARTQUOTA)) || EVALUATION.equalsIgnoreCase(isilonApi.getLicenseInfo(IsilonLicenseType.SMARTQUOTA))) {
            storageSystem.setSupportSoftLimit(true);
            storageSystem.setSupportNotificationLimit(true);
        }
        storageSystem.setCompatibilityStatus(DiscoveredDataObject.CompatibilityStatus.COMPATIBLE.name());
        storageSystem.setReachableStatus(true);
        _log.info("discoverCluster information for storage system {} - complete", storageSystemId);
    } catch (Exception e) {
        storageSystem.setReachableStatus(false);
        String errMsg = String.format("discoverCluster failed. %s", e.getMessage());
        _log.error(errMsg, e);
        IsilonCollectionException ice = new IsilonCollectionException(errMsg);
        throw ice;
    }
}
Also used : IsilonClusterConfig(com.emc.storageos.isilon.restapi.IsilonClusterConfig) IsilonCollectionException(com.emc.storageos.plugins.metering.isilon.IsilonCollectionException) URI(java.net.URI) IsilonApi(com.emc.storageos.isilon.restapi.IsilonApi) IsilonException(com.emc.storageos.isilon.restapi.IsilonException) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException) IOException(java.io.IOException) JSONException(org.codehaus.jettison.json.JSONException) URISyntaxException(java.net.URISyntaxException) DatabaseException(com.emc.storageos.db.exceptions.DatabaseException) IsilonCollectionException(com.emc.storageos.plugins.metering.isilon.IsilonCollectionException)

Example 2 with IsilonClusterConfig

use of com.emc.storageos.isilon.restapi.IsilonClusterConfig in project coprhd-controller by CoprHD.

the class IsilonFileStorageDeviceTest method testDiscoverIsilon.

/**
 * Tests Isilon discovery
 *
 * @throws Exception
 */
@Test
public void testDiscoverIsilon() {
    try {
        IsilonApi isilonApi = _isi.getIsilonDevice(_device);
        IsilonClusterConfig clusterConfig = isilonApi.getClusterConfig();
        Assert.assertTrue("Isilon discovery failed " + clusterConfig.getGuid(), false);
    } catch (IsilonException iex) {
        System.out.println("Isilon discovery failed: " + iex.getCause());
    }
}
Also used : IsilonClusterConfig(com.emc.storageos.isilon.restapi.IsilonClusterConfig) IsilonApi(com.emc.storageos.isilon.restapi.IsilonApi) IsilonException(com.emc.storageos.isilon.restapi.IsilonException) Test(org.junit.Test)

Aggregations

IsilonApi (com.emc.storageos.isilon.restapi.IsilonApi)2 IsilonClusterConfig (com.emc.storageos.isilon.restapi.IsilonClusterConfig)2 IsilonException (com.emc.storageos.isilon.restapi.IsilonException)2 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)1 BaseCollectionException (com.emc.storageos.plugins.BaseCollectionException)1 IsilonCollectionException (com.emc.storageos.plugins.metering.isilon.IsilonCollectionException)1 IOException (java.io.IOException)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 JSONException (org.codehaus.jettison.json.JSONException)1 Test (org.junit.Test)1