Search in sources :

Example 1 with EmDataCollector

use of com.emc.storageos.driver.dellsc.scapi.objects.EmDataCollector in project coprhd-controller by CoprHD.

the class DellSCDiscovery method discoverStorageProvider.

/**
 * Perform discovery for a storage provider.
 *
 * @param storageProvider The provider.
 * @param storageSystems The storage systems collection to populate.
 * @return The driver task.
 */
public DriverTask discoverStorageProvider(StorageProvider storageProvider, List<StorageSystem> storageSystems) {
    DellSCDriverTask task = new DellSCDriverTask("discover");
    try {
        LOG.info("Getting information for storage provider [{}:{}] as user {}", storageProvider.getProviderHost(), storageProvider.getPortNumber(), storageProvider.getUsername());
        StorageCenterAPI api = connectionManager.getConnection(storageProvider.getProviderHost(), storageProvider.getPortNumber(), storageProvider.getUsername(), storageProvider.getPassword(), true);
        LOG.info("Connected to DSM {} as user {}", storageProvider.getProviderHost(), storageProvider.getUsername());
        // Populate the provider information
        storageProvider.setAccessStatus(AccessStatus.READ_WRITE);
        storageProvider.setManufacturer("Dell");
        storageProvider.setProviderVersion(driverVersion);
        storageProvider.setIsSupportedVersion(true);
        // Get some info about the DSM for debugging purposes
        EmDataCollector em = api.getDSMInfo();
        if (em != null) {
            LOG.info("Connected to {} DSM version {}, Java version {}", em.type, em.version, em.javaVersion);
            storageProvider.setProviderVersion(em.version);
        }
        // Populate the basic SC information
        StorageCenter[] scs = api.getStorageCenterInfo();
        for (StorageCenter sc : scs) {
            StorageSystem storageSystem = util.getStorageSystemFromStorageCenter(api, sc, null);
            storageSystem.setSystemType(driverName);
            storageSystems.add(storageSystem);
        }
        task.setStatus(DriverTask.TaskStatus.READY);
    } catch (Exception e) {
        String msg = String.format("Exception encountered getting storage provider information: %s", e);
        LOG.error(msg);
        task.setFailed(msg);
    }
    return task;
}
Also used : StorageCenterAPI(com.emc.storageos.driver.dellsc.scapi.StorageCenterAPI) EmDataCollector(com.emc.storageos.driver.dellsc.scapi.objects.EmDataCollector) DellSCDriverTask(com.emc.storageos.driver.dellsc.DellSCDriverTask) StorageCenter(com.emc.storageos.driver.dellsc.scapi.objects.StorageCenter) DellSCDriverException(com.emc.storageos.driver.dellsc.DellSCDriverException) StorageCenterAPIException(com.emc.storageos.driver.dellsc.scapi.StorageCenterAPIException) StorageSystem(com.emc.storageos.storagedriver.model.StorageSystem)

Aggregations

DellSCDriverException (com.emc.storageos.driver.dellsc.DellSCDriverException)1 DellSCDriverTask (com.emc.storageos.driver.dellsc.DellSCDriverTask)1 StorageCenterAPI (com.emc.storageos.driver.dellsc.scapi.StorageCenterAPI)1 StorageCenterAPIException (com.emc.storageos.driver.dellsc.scapi.StorageCenterAPIException)1 EmDataCollector (com.emc.storageos.driver.dellsc.scapi.objects.EmDataCollector)1 StorageCenter (com.emc.storageos.driver.dellsc.scapi.objects.StorageCenter)1 StorageSystem (com.emc.storageos.storagedriver.model.StorageSystem)1