use of com.emc.storageos.plugins.AccessProfile in project coprhd-controller by CoprHD.
the class SupportedAsynchronousActionsProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
try {
_log.info("***Inside SupportedAsynchronousActionsProcessor****");
_dbClient = (DbClient) keyMap.get(Constants.dbClient);
AccessProfile profile = (AccessProfile) keyMap.get(Constants.ACCESSPROFILE);
Iterator<CIMInstance> iterator = (Iterator<CIMInstance>) resultObj;
while (iterator.hasNext()) {
CIMInstance instance = iterator.next();
UnsignedInteger16[] supportedAsyncActions = (UnsignedInteger16[]) instance.getPropertyValue(Constants.SUPPORTED_ASYNCHRONOUS_ACTIONS);
StorageSystem device = getStorageSystem(_dbClient, profile.getSystemId());
addSupportedAsynchronousActionsToStorageSystem(supportedAsyncActions, device);
StringSet replicationTypes = new StringSet();
replicationTypes.add(SupportedReplicationTypes.LOCAL.toString());
device.setSupportedReplicationTypes(replicationTypes);
}
} catch (Exception e) {
_log.error("Supported asynchronous action processing failed", e);
}
}
use of com.emc.storageos.plugins.AccessProfile in project coprhd-controller by CoprHD.
the class TCPProtocolEndPointProcessor 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);
AccessProfile profile = (AccessProfile) keyMap.get(Constants.ACCESSPROFILE);
StorageSystem device = getStorageSystem(_dbClient, profile.getSystemId());
while (it.hasNext()) {
CIMInstance tcpPointInstance = null;
StoragePort port = null;
try {
tcpPointInstance = it.next();
String portInstanceID = tcpPointInstance.getObjectPath().getKey(SYSTEMNAME).getValue().toString();
port = checkEthernetStoragePortExistsInDB(getCIMPropertyValue(tcpPointInstance, NAME), _dbClient, device);
updateTCPEndPointDetails(keyMap, port, tcpPointInstance, portInstanceID);
} catch (Exception e) {
_logger.warn("Port TCP End Point Discovery failed for {}-->{}", "", getMessage(e));
}
}
} catch (Exception e) {
_logger.error("Port TCP End Point Discovery failed -->{}", getMessage(e));
}
}
use of com.emc.storageos.plugins.AccessProfile in project coprhd-controller by CoprHD.
the class VmaxSLOBookkeepingProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
DbClient dbClient = (DbClient) keyMap.get(Constants.dbClient);
Set<String> policyNames = (Set<String>) keyMap.get(Constants.SLO_NAMES);
AccessProfile profile = (AccessProfile) keyMap.get(Constants.ACCESSPROFILE);
StorageSystem storageSystem = dbClient.queryObject(StorageSystem.class, profile.getSystemId());
boolean isVmax3 = storageSystem.checkIfVmax3();
if (isVmax3 && policyNames != null && !policyNames.isEmpty()) {
try {
performPolicyBookKeeping(dbClient, policyNames, storageSystem);
} catch (IOException e) {
log.error("Exception caught while trying to run bookkeeping on VMAX3 SLO AutoTieringPolicies", e);
}
}
}
use of com.emc.storageos.plugins.AccessProfile in project coprhd-controller by CoprHD.
the class VolumeSizeProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
DbClient _dbClient;
AccessProfile profile = (AccessProfile) keyMap.get(Constants.ACCESSPROFILE);
try {
String minVolSize = null;
String maxVolSize = null;
_dbClient = (DbClient) keyMap.get(Constants.dbClient);
StorageSystem device = getStorageSystem(_dbClient, profile.getSystemId());
if (resultObj instanceof CIMArgument<?>[]) {
CIMArgument<?>[] outputArguments = (CIMArgument<?>[]) resultObj;
for (CIMArgument<?> outArg : outputArguments) {
if (null == outArg) {
continue;
}
if (outArg.getName().equalsIgnoreCase(MINIMUM_VOLUME_SIZE)) {
minVolSize = outArg.getValue().toString();
} else if (outArg.getName().equalsIgnoreCase(MAXIMUM_VOLUME_SIZE)) {
maxVolSize = outArg.getValue().toString();
}
}
// we are setting at compile time, hence value will be there always.
CIMObjectPath poolObjectPath = getObjectPathfromCIMArgument();
String instanceID = poolObjectPath.getKey(Constants.INSTANCEID).getValue().toString();
StoragePool pool = checkStoragePoolExistsInDB(getNativeIDFromInstance(instanceID), _dbClient, device);
if (null != pool) {
Long maxVolumeSize = ControllerUtils.convertBytesToKBytes(maxVolSize);
Long minVolumeSize = ControllerUtils.convertBytesToKBytes(minVolSize);
if (Type.ibmxiv.name().equals((device.getSystemType()))) {
String supportedResourceType = pool.getSupportedResourceTypes();
if (SupportedResourceTypes.THIN_ONLY.name().equals(supportedResourceType)) {
pool.setMaximumThinVolumeSize(maxVolumeSize);
pool.setMinimumThinVolumeSize(minVolumeSize);
} else if (SupportedResourceTypes.THICK_ONLY.name().equals(supportedResourceType)) {
pool.setMaximumThickVolumeSize(maxVolumeSize);
pool.setMinimumThickVolumeSize(minVolumeSize);
}
} else {
// TODO - could this be changed to use the same logic as for IBM pool?
// if the result is obtained from calling on Thick, use thick volume size else thin
String elementType = determineCallType();
if (elementType.equalsIgnoreCase(FIVE)) {
pool.setMaximumThinVolumeSize(maxVolumeSize);
pool.setMinimumThinVolumeSize(minVolumeSize);
} else if (elementType.equalsIgnoreCase(THREE)) {
pool.setMaximumThickVolumeSize(maxVolumeSize);
pool.setMinimumThickVolumeSize(minVolumeSize);
}
}
_logger.info(String.format("Maximum limits for volume capacity in storage pool: %s %n max thin volume capacity: %s, max thick volume capacity: %s ", pool.getId(), pool.getMaximumThinVolumeSize(), pool.getMaximumThickVolumeSize()));
_dbClient.persistObject(pool);
}
}
} catch (Exception e) {
_logger.error("Failed while processing Result : ", e);
}
}
use of com.emc.storageos.plugins.AccessProfile in project coprhd-controller by CoprHD.
the class PoolCapabilitiesProcessor 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);
AccessProfile profile = (AccessProfile) keyMap.get(Constants.ACCESSPROFILE);
StorageSystem device = getStorageSystem(_dbClient, profile.getSystemId());
// Process the response only for vmax3 systems.
if (device.checkIfVmax3()) {
while (it.hasNext()) {
CIMInstance capabilitiesInstance = null;
try {
capabilitiesInstance = it.next();
String instanceID = capabilitiesInstance.getPropertyValue(Constants.INSTANCEID).toString();
addPath(keyMap, operation.getResult(), capabilitiesInstance.getObjectPath());
} catch (Exception e) {
_logger.warn("Pool Capabilities detailed discovery failed for {}-->{}", capabilitiesInstance.getObjectPath(), getMessage(e));
}
}
}
} catch (Exception e) {
_logger.error("Pool Capabilities detailed discovery failed", e);
}
}
Aggregations