use of com.emc.storageos.plugins.AccessProfile in project coprhd-controller by CoprHD.
the class VolumeSettingProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
try {
_dbClient = (DbClient) keyMap.get(Constants.dbClient);
AccessProfile profile = (AccessProfile) keyMap.get(Constants.ACCESSPROFILE);
StorageSystem system = _dbClient.queryObject(StorageSystem.class, profile.getSystemId());
final Iterator<CIMInstance> it = (Iterator<CIMInstance>) resultObj;
CIMObjectPath volumePath = getObjectPathfromCIMArgument(_args);
String nativeGuid = getUnManagedVolumeNativeGuidFromVolumePath(volumePath);
UnManagedVolume unManagedVolume = checkUnManagedVolumeExistsInDB(nativeGuid, _dbClient);
if (null == unManagedVolume) {
return;
}
while (it.hasNext()) {
CIMInstance settingInstance = it.next();
String initialTierSetting = settingInstance.getPropertyValue(Constants.INITIAL_STORAGE_TIER_METHODOLOGY).toString();
String policyName = null;
if ("4".equalsIgnoreCase(initialTierSetting)) {
policyName = AutoTieringPolicy.VnxFastPolicy.DEFAULT_START_HIGH_THEN_AUTOTIER.name();
} else {
policyName = AutoTieringPolicy.VnxFastPolicy.DEFAULT_AUTOTIER.name();
}
_logger.info("Adding {} Policy Rule to UnManaged Volume {}", policyName, nativeGuid);
unManagedVolume.getVolumeInformation().put(SupportedVolumeInformation.AUTO_TIERING_POLICIES.toString(), policyName);
unManagedVolume.putVolumeCharacterstics(SupportedVolumeCharacterstics.IS_AUTO_TIERING_ENABLED.toString(), "true");
// StorageVolumeInfoProcessor updated supported_vpool_list based on its pool's presence in vPool
// Now, filter those vPools based on policy associated
DiscoveryUtils.filterSupportedVpoolsBasedOnTieringPolicy(unManagedVolume, policyName, system, _dbClient);
_dbClient.updateAndReindexObject(unManagedVolume);
}
} catch (Exception e) {
_logger.error("Updating Auto Tier Policies failed on unmanaged volumes", e);
}
}
use of com.emc.storageos.plugins.AccessProfile in project coprhd-controller by CoprHD.
the class MaskingPathProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
try {
AccessProfile profile = (AccessProfile) keyMap.get(Constants.ACCESSPROFILE);
String serialIdsStr = profile.getProps().get(Constants.SYSTEM_SERIAL_IDS);
String[] serialIds = serialIdsStr.split(Constants.ID_DELIMITER);
Set<String> serialIdSet = new HashSet<String>(Arrays.asList(serialIds));
Iterator<CIMObjectPath> it = (Iterator<CIMObjectPath>) resultObj;
while (it.hasNext()) {
CIMObjectPath path = it.next();
String systemName = path.getKeyValue(SmisConstants.CP_SYSTEM_NAME).toString();
String serialId = systemName.split(Constants.PATH_DELIMITER_REGEX)[1];
if (serialIdSet.contains(serialId)) {
addPath(keyMap, operation.getResult(), path);
}
}
} catch (Exception e) {
log.error("Masking path discovery failed during array affinity discovery", e);
}
}
use of com.emc.storageos.plugins.AccessProfile in project coprhd-controller by CoprHD.
the class TierBookKeepingProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
try {
final Iterator<CIMInstance> it = (Iterator<CIMInstance>) resultObj;
_dbClient = (DbClient) keyMap.get(Constants.dbClient);
AccessProfile profile = (AccessProfile) keyMap.get(Constants.ACCESSPROFILE);
String serialID = (String) keyMap.get(Constants._serialID);
while (it.hasNext()) {
CIMInstance tierInstance = it.next();
if (tierInstance.getObjectPath().toString().contains(serialID)) {
_tierNativeGuids.add(getTierNativeGuidFromTierInstance(tierInstance));
}
}
performStorageTierBookKeeping(profile.getSystemId());
} catch (Exception e) {
_logger.info("BookKeeping Storage Tiers failed", e);
}
}
use of com.emc.storageos.plugins.AccessProfile in project coprhd-controller by CoprHD.
the class CheckPoolSettingExistenceProcessor method processResult.
@SuppressWarnings("unchecked")
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
@SuppressWarnings("unchecked") final Iterator<CIMInstance> it = (Iterator<CIMInstance>) resultObj;
_dbClient = (DbClient) keyMap.get(Constants.dbClient);
AccessProfile profile = (AccessProfile) keyMap.get(Constants.ACCESSPROFILE);
try {
StorageSystem device = getStorageSystem(_dbClient, profile.getSystemId());
CIMObjectPath poolCapabilitiesPath = getObjectPathfromCIMArgument();
String poolID = getPoolIdFromCapabilities(poolCapabilitiesPath);
// get Pool from DB
StoragePool pool = checkStoragePoolExistsInDB(poolID, _dbClient, device);
List<String> poolSettingsList = (List<String>) keyMap.get(Constants.VNXPOOLCAPABILITIES_TIER);
while (it.hasNext()) {
CIMInstance settingInstance = it.next();
_logger.debug("settingInstance :{}", settingInstance);
int tierMethodology = Integer.parseInt(settingInstance.getPropertyValue(Constants.INITIAL_STORAGE_TIER_METHODOLOGY).toString());
int tierSelection = Integer.parseInt(settingInstance.getPropertyValue(Constants.INITIAL_STORAGE_TIERING_SELECTION).toString());
String poolSettingId = settingInstance.getPropertyValue(Constants.INSTANCEID).toString();
if (checkPoolSettingExistsBasedOnTierMethodology(tierMethodology, pool, poolSettingId) && tierSelection == Constants.RELATIVE_PERFORMANCE_ORDER) {
poolSettingsList.remove(poolCapabilitiesPath.toString() + Constants.HYPHEN + tierMethodology);
}
}
} catch (Exception e) {
_logger.error("CheckPoolExistence Processor failed:", e);
}
}
use of com.emc.storageos.plugins.AccessProfile in project coprhd-controller by CoprHD.
the class XIVStorageProtocolEndPointProcessor 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);
@SuppressWarnings("unchecked") Map<URI, StoragePool> poolsToMatchWithVpool = (Map<URI, StoragePool>) keyMap.get(Constants.MODIFIED_STORAGEPOOLS);
StorageSystem device = _dbClient.queryObject(StorageSystem.class, profile.getSystemId());
List<StoragePort> newPorts = new ArrayList<StoragePort>();
List<StoragePort> existingPorts = new ArrayList<StoragePort>();
while (it.hasNext()) {
CIMInstance endPointInstance = null;
StoragePort port = null;
try {
endPointInstance = it.next();
String name = getCIMPropertyValue(endPointInstance, NAME).toLowerCase();
String portInstanceID = getObjectPathfromCIMArgument(args).toString();
port = checkEthernetStoragePortExistsInDB(name, _dbClient, device);
URI portID = createEthernetStoragePort(keyMap, port, name, portInstanceID, newPorts, existingPorts);
keyMap.put(endPointInstance.getObjectPath().toString(), portID);
addPath(keyMap, operation.getResult(), endPointInstance.getObjectPath());
} catch (Exception e) {
_logger.warn("SCSI End Point Discovery failed for {}-->{}", "", getMessage(e));
}
}
@SuppressWarnings("unchecked") List<List<StoragePort>> portsUsedToRunNetworkConnectivity = (List<List<StoragePort>>) keyMap.get(Constants.STORAGE_PORTS);
portsUsedToRunNetworkConnectivity.add(newPorts);
// discovered ports used later to check for not visible ports
List<StoragePort> discoveredPorts = (List<StoragePort>) keyMap.get(Constants.DISCOVERED_PORTS);
discoveredPorts.addAll(newPorts);
discoveredPorts.addAll(existingPorts);
List<StoragePool> modifiedPools = StoragePoolAssociationHelper.getStoragePoolsFromPorts(_dbClient, newPorts, null);
for (StoragePool pool : modifiedPools) {
// pool matcher will be invoked on this pool
if (!poolsToMatchWithVpool.containsKey(pool.getId())) {
poolsToMatchWithVpool.put(pool.getId(), pool);
}
}
_logger.debug("# Pools used in invoking PoolMatcher during StorageProtoclEndPoint {}", Joiner.on("\t").join(poolsToMatchWithVpool.keySet()));
} catch (Exception e) {
_logger.error("SCSI End Point Discovery failed -->{}", getMessage(e));
}
}
Aggregations