use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.
the class VMAXPolicyToTierProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
try {
@SuppressWarnings("unchecked") final Iterator<CIMInstance> it = (Iterator<CIMInstance>) resultObj;
_dbClient = (DbClient) keyMap.get(Constants.dbClient);
_updateTierList = new ArrayList<StorageTier>();
_newTierList = new ArrayList<StorageTier>();
// value will be set already always
Object[] arguments = (Object[]) _args.get(0);
Set<String> tierNativeGuidsfromProvider = new HashSet<String>();
CIMObjectPath vmaxFastPolicyRule = (CIMObjectPath) arguments[0];
String vmaxPolicyId = getFASTPolicyID(vmaxFastPolicyRule);
AutoTieringPolicy vmaxFastPolicy = getAutoTieringPolicyByNameFromDB(vmaxPolicyId, _dbClient);
// the relationship between Policy--->Pools
while (it.hasNext()) {
CIMInstance vmaxTierInstance = it.next();
CIMObjectPath tierPath = vmaxTierInstance.getObjectPath();
String tierID = tierPath.getKey(Constants.INSTANCEID).getValue().toString();
// For 8.x -+- becomes +, internal DB format uses + only; for 4.6 remains as it is
tierID = tierID.replaceAll(Constants.SMIS_80_STYLE, Constants.SMIS_PLUS_REGEX);
if (keyMap.containsKey(tierID)) {
List<CIMObjectPath> policyPaths = (List<CIMObjectPath>) keyMap.get(tierID);
policyPaths.add(vmaxFastPolicyRule);
} else {
addPath(keyMap, Constants.STORAGETIERS, tierPath);
List<CIMObjectPath> policyPaths = new ArrayList<CIMObjectPath>();
policyPaths.add(vmaxFastPolicyRule);
keyMap.put(tierID, policyPaths);
}
String tierNativeGuid = getTierNativeGuidForVMax(tierID);
tierNativeGuidsfromProvider.add(tierNativeGuid);
StorageTier tierObject = checkStorageTierExistsInDB(tierNativeGuid, _dbClient);
String driveTechnologyIdentifier = vmaxTierInstance.getPropertyValue(Constants.TECHNOLOGY).toString();
String driveType = StorageTier.SupportedTiers.getTier(driveTechnologyIdentifier);
createStorageTier(vmaxTierInstance, tierObject, tierNativeGuid, vmaxFastPolicy.getId(), _newTierList, _updateTierList, driveType);
}
_dbClient.createObject(_newTierList);
_dbClient.persistObject(_updateTierList);
performStorageTierBookKeeping(tierNativeGuidsfromProvider, vmaxFastPolicy.getId());
} catch (Exception e) {
_logger.error("Policy to Tier Processing failed :", e);
}
}
use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.
the class VMAXTiersToPoolProcessor 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;
// value set at runtime already
Object[] arguments = (Object[]) _args.get(0);
CIMObjectPath tierPath = (CIMObjectPath) arguments[0];
String tierID = (String) tierPath.getKey(Constants.INSTANCEID).getValue();
// Mapping had been already constructed between TierID --> Policy
List<CIMObjectPath> policyPaths = (List<CIMObjectPath>) keyMap.get(tierID);
// add Policy to Tier
addFastPolicyToTier(policyPaths, tierID);
// add Pools to Policy
addStoragePoolstoPolicy(policyPaths, it, _dbClient, keyMap, tierID);
} catch (Exception e) {
_logger.error("Tiers to Pool Processing failed:", e);
}
}
use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.
the class CommitedSettingsInstanceProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
try {
CIMInstance modifiedInstance = getObjectPathfromCIMArgument();
DbClient _dbClient = (DbClient) keyMap.get(Constants.dbClient);
AccessProfile profile = (AccessProfile) keyMap.get(Constants.ACCESSPROFILE);
CIMObjectPath poolSettingPath = modifiedInstance.getObjectPath();
String poolSettingId = poolSettingPath.getKey(Constants.INSTANCEID).getValue().toString();
CIMObjectPath poolCapabilities_Associated_With_Setting = CimObjectPathCreator.createInstance(keyMap.get(poolSettingPath.toString()).toString());
String poolID = getNativeIDFromInstance(poolCapabilities_Associated_With_Setting.getKey(Constants.INSTANCEID).getValue().toString());
StorageSystem device = getStorageSystem(_dbClient, profile.getSystemId());
StoragePool pool = checkStoragePoolExistsInDB(poolID, _dbClient, device);
int tierMethodologyUsedForThisCreatedSetting = Integer.parseInt((String) keyMap.get(poolSettingPath.toString() + Constants.HYPHEN + Constants.TIERMETHODOLOGY));
if (null != pool) {
updatePoolSettingId(tierMethodologyUsedForThisCreatedSetting, pool, poolSettingId);
_dbClient.persistObject(pool);
}
} catch (Exception e) {
_logger.error("Commiting Modified Settign Instance failed", e);
}
}
use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.
the class CreatePoolSettingProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
String tierMethodologyToBeUsedForThisCreatedSetting = null;
try {
if (resultObj instanceof CIMArgument<?>[]) {
CIMArgument<?>[] outputArguments = (CIMArgument<?>[]) resultObj;
CIMObjectPath path = (CIMObjectPath) outputArguments[0].getValue();
// always set
int index = (Integer) _args.get(1);
@SuppressWarnings("unchecked") List<String> poolSettingsList = (List<String>) keyMap.get(Constants.VNXPOOLCAPABILITIES_TIER);
String poolSettingToTierMethodology = poolSettingsList.get(index);
tierMethodologyToBeUsedForThisCreatedSetting = poolSettingToTierMethodology.substring(poolSettingToTierMethodology.lastIndexOf(Constants.HYPHEN) + 1, poolSettingToTierMethodology.length());
String poolCapabilitiesPathAssociatedWiththisSetting = poolSettingToTierMethodology.substring(0, poolSettingToTierMethodology.lastIndexOf(Constants.HYPHEN));
keyMap.put(path.toString(), poolCapabilitiesPathAssociatedWiththisSetting);
keyMap.put(path.toString() + Constants.HYPHEN + Constants.TIERMETHODOLOGY, tierMethodologyToBeUsedForThisCreatedSetting);
addPath(keyMap, operation.getResult(), path);
}
} catch (Exception e) {
_logger.error("Error processing Create Pool Setting with Initial Storage Tiering Methodology : {} : ", tierMethodologyToBeUsedForThisCreatedSetting, e);
}
}
use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.
the class SettingsInstanceProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
try {
final CIMInstance poolSettingInstance = (CIMInstance) resultObj;
addInstance(keyMap, operation.getResult(), poolSettingInstance);
} catch (Exception e) {
_logger.error("Processing Pool Setting Instances failed :", e);
}
}
Aggregations