use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.
the class VNXPolicyToVolumeProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
try {
@SuppressWarnings("unchecked") final Iterator<CIMObjectPath> it = (Iterator<CIMObjectPath>) resultObj;
// value will be set already always
Object[] arguments = (Object[]) _args.get(0);
CIMObjectPath vnxFastPolicyRule = (CIMObjectPath) arguments[0];
// construct VolumeID-->PolicyRule mapping
while (it.hasNext()) {
CIMObjectPath volumePath = it.next();
String volumeID = volumePath.getKey(Constants.DEVICEID).getValue().toString();
keyMap.put(volumeID, vnxFastPolicyRule);
addPath(keyMap, Constants.STORAGEVOLUMES, volumePath);
}
} catch (Exception e) {
_logger.error("FAST Policy Discovery : DiscoveryExtracting Volumes from Policy failed", e);
}
}
use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.
the class VNXTierDomainToTiersProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
try {
_dbClient = (DbClient) keyMap.get(Constants.dbClient);
@SuppressWarnings("unchecked") final Iterator<CIMInstance> it = (Iterator<CIMInstance>) resultObj;
// indicates ExtremePerformance or Performance or Capacity Tier
Object[] arguments = (Object[]) _args.get(0);
CIMObjectPath tierDomainPath = (CIMObjectPath) arguments[0];
CIMObjectPath storagePoolpath = (CIMObjectPath) keyMap.get(tierDomainPath.getKey(Constants.NAME).getValue());
addTiersToPool(storagePoolpath, it, _dbClient, keyMap);
} catch (Exception e) {
_logger.error("VNX TierDomain to Tier Processing failed :", e);
}
}
use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.
the class VNXVolumesToPoolProcessor method processResult.
/**
* {@inheritDoc}
*/
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
try {
_dbClient = (DbClient) keyMap.get(Constants.dbClient);
@SuppressWarnings("unchecked") final Iterator<CIMObjectPath> it = (Iterator<CIMObjectPath>) resultObj;
// values previously set
Object[] arguments = (Object[]) _args.get(0);
CIMObjectPath volumePath = (CIMObjectPath) arguments[0];
// Mapping had been already constructed between Volumes --> Policy in previous SMI-S Call
// while getting Policy--->Volumes for VNX
CIMObjectPath policyPath = (CIMObjectPath) keyMap.get(volumePath.getKey(Constants.DEVICEID).getValue());
// add Pools to POlicy
// addStoragePoolstoPolicy(policyPath, it, _dbClient,keyMap);
} catch (Exception e) {
_logger.error("Extracting Pools from Volumnes failed on FAST Polciy Discovery", e);
}
}
use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.
the class XIVStorageConfigurationCapabilitiesProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
@SuppressWarnings("unchecked") final Iterator<CIMInstance> it = (Iterator<CIMInstance>) resultObj;
_profile = (AccessProfile) keyMap.get(Constants.ACCESSPROFILE);
_dbClient = (DbClient) keyMap.get(Constants.dbClient);
try {
StorageSystem system = _dbClient.queryObject(StorageSystem.class, _profile.getSystemId());
while (it.hasNext()) {
CIMInstance storageConfigurationInstance = it.next();
UnsignedInteger16[] supportedElementTypeArr = (UnsignedInteger16[]) storageConfigurationInstance.getPropertyValue(SUPPORTED_ELEMENT_TYPES);
String supportedElementTypes = Arrays.toString(supportedElementTypeArr);
if (_logger.isDebugEnabled()) {
_logger.debug("Capability:" + supportedElementTypes);
}
if (supportedElementTypes.contains(THIN_VOLUME_SUPPORTED) && supportedElementTypes.contains(THICK_VOLUME_SUPPORTED)) {
system.setSupportedProvisioningType(SupportedProvisioningTypes.THIN_AND_THICK.name());
} else if (supportedElementTypes.contains(THIN_VOLUME_SUPPORTED)) {
system.setSupportedProvisioningType(SupportedProvisioningTypes.THIN.name());
} else if (supportedElementTypes.contains(THICK_VOLUME_SUPPORTED)) {
system.setSupportedProvisioningType(SupportedProvisioningTypes.THICK.name());
} else {
system.setSupportedProvisioningType(SupportedProvisioningTypes.NONE.name());
}
// should have only one instance
break;
}
_dbClient.persistObject(system);
} catch (Exception e) {
_logger.error("Finding out Storage System Capability on Volume Creation failed: ", e);
}
}
use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.
the class XIVStoragePoolProcessor method processResult.
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
final Iterator<CIMInstance> it = (Iterator<CIMInstance>) resultObj;
_profile = (AccessProfile) keyMap.get(Constants.ACCESSPROFILE);
try {
_newPoolList = new ArrayList<StoragePool>();
_updatePoolList = new ArrayList<StoragePool>();
_dbClient = (DbClient) keyMap.get(Constants.dbClient);
StorageSystem device = getStorageSystem(_dbClient, _profile.getSystemId());
if (SupportedProvisioningTypes.NONE.name().equalsIgnoreCase(device.getSupportedProvisioningType())) {
_logger.info("Storage System doesn't support volume creations :" + device.getLabel());
return;
}
Set<String> protocols = (Set<String>) keyMap.get(Constants.PROTOCOLS);
Map<URI, StoragePool> poolsToMatchWithVpool = new HashMap<URI, StoragePool>();
while (it.hasNext()) {
CIMInstance poolInstance = it.next();
try {
addPath(keyMap, operation.getResult(), poolInstance.getObjectPath());
String hardSizeStr = getCIMPropertyValue(poolInstance, HARD_SIZE);
long hardSize = Long.parseLong(hardSizeStr);
String softSizeStr = getCIMPropertyValue(poolInstance, SOFT_SIZE);
long softSize = Long.parseLong(softSizeStr);
SupportedResourceTypes type = SupportedResourceTypes.THICK_ONLY;
if (hardSize < softSize) {
type = SupportedResourceTypes.THIN_ONLY;
}
createStoragePool(_dbClient, device, poolInstance, PoolClassNames.IBMTSDS_VirtualPool.name(), type.name(), protocols, poolsToMatchWithVpool, _newPoolList, _updatePoolList);
} catch (Exception e) {
_logger.warn("StoragePool Discovery failed for {}", getCIMPropertyValue(poolInstance, Constants.INSTANCEID), getMessage(e));
}
}
// set the pools whose properties got changed.
keyMap.put(Constants.MODIFIED_STORAGEPOOLS, poolsToMatchWithVpool);
_dbClient.createObject(_newPoolList);
_dbClient.updateAndReindexObject(_updatePoolList);
// find the pools not visible in this discovery
List<StoragePool> discoveredPools = new ArrayList<StoragePool>(_newPoolList);
discoveredPools.addAll(_updatePoolList);
List<StoragePool> notVisiblePools = DiscoveryUtils.checkStoragePoolsNotVisible(discoveredPools, _dbClient, device.getId());
for (StoragePool notVisiblePool : notVisiblePools) {
poolsToMatchWithVpool.put(notVisiblePool.getId(), notVisiblePool);
}
// If any storage ports on the storage system are in a transport
// zone, there is an implicit connection to the transport zone
// varray. We need to add these implicit varray
// connections for the new storage pool.
StoragePoolAssociationHelper.setStoragePoolVarrays(device.getId(), _newPoolList, _dbClient);
} catch (Exception e) {
_logger.error("StoragePool Discovery failed", e);
} finally {
_newPoolList = null;
_updatePoolList = null;
}
}
Aggregations