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;
}
Aggregations