use of com.emc.storageos.db.client.model.AutoTieringPolicy in project coprhd-controller by CoprHD.
the class SmisCommandHelper method getPolicyByBlockObject.
/**
* Get the policy by BlockObject autoTieringPolicy URI.
*
* @param pool
* @param autoTierPolicyName
* @param policyURI
* @param compressionEnabled - If the compression is enabled at the Virtual pool level, we must honor it.
* @return
*/
private StringBuffer getPolicyByBlockObject(URI pool, String autoTierPolicyName, URI policyURI, Boolean compressionEnabled) {
StoragePool storagePool = _dbClient.queryObject(StoragePool.class, pool);
StringBuffer policyName = new StringBuffer();
if ((null != autoTierPolicyName && Constants.NONE.equalsIgnoreCase(autoTierPolicyName)) || (NullColumnValueGetter.isNullURI(policyURI))) {
if (compressionEnabled) {
// If compression is enabled at the Virtual pool level, the Storage Group has to be fast managed when the SLO is none
policyName = policyName.append(Constants.NONE.toUpperCase()).append(Constants._plusDelimiter).append(Constants.NONE.toUpperCase()).append(Constants._plusDelimiter).append(storagePool.getPoolName());
} else {
policyName = policyName.append(Constants.NONE);
}
} else {
AutoTieringPolicy autoTierPolicy = _dbClient.queryObject(AutoTieringPolicy.class, policyURI);
policyName = policyName.append(autoTierPolicy.getVmaxSLO()).append(Constants._plusDelimiter).append(autoTierPolicy.getVmaxWorkload().toUpperCase()).append(Constants._plusDelimiter).append(storagePool.getPoolName());
}
return policyName;
}
use of com.emc.storageos.db.client.model.AutoTieringPolicy in project coprhd-controller by CoprHD.
the class SmisCommandHelper method getVolumeGroupPath.
/*
* find/create storage group for VMAX V3
*/
public CIMObjectPath getVolumeGroupPath(StorageSystem forProvider, StorageSystem storageSystem, Volume volume, StoragePool storagePool) {
CIMObjectPath volumeGrouptPath = null;
URI policyURI = volume.getAutoTieringPolicyUri();
// Don't create Parking SLO SG if there is no Fast policy associated
if (storageSystem.checkIfVmax3() && !NullColumnValueGetter.isNullURI(policyURI)) {
if (storagePool == null) {
storagePool = _dbClient.queryObject(StoragePool.class, volume.getPool());
}
AutoTieringPolicy policy = _dbClient.queryObject(AutoTieringPolicy.class, policyURI);
String slo = policy.getVmaxSLO();
String workload = policy.getVmaxWorkload().toUpperCase();
String srp = storagePool.getPoolName();
// Try to find existing storage group.
volumeGrouptPath = getVolumeGroupBasedOnSLO(forProvider, storageSystem, slo, workload, srp);
if (volumeGrouptPath == null) {
// Create new storage group.
volumeGrouptPath = createVolumeGroupBasedOnSLO(forProvider, storageSystem, slo, workload, srp);
}
}
return volumeGrouptPath;
}
use of com.emc.storageos.db.client.model.AutoTieringPolicy in project coprhd-controller by CoprHD.
the class StoragePoolSettingProcessor method createOrUpdateSLOBasedAutoTierPolicy.
/**
* Create or update an AutoTieringPolicy object with the passed parameters.
*
* Updates 'newSLOList' and 'updateSLOList'
*
* @param storageSystem [in] - StorageSystem that the AutoTierPolicy will belong to
* @param policy [in] - If null, implies we have to create a new one, otherwise it's an update
* @param sloID [in] - Native ID constructed based on the slo and workload
* @param sloName [in] - SLO + Workload
* @param avgResponseTime [in] - Average Expected Response time for the SLO + Workload @throws IOException
*/
private void createOrUpdateSLOBasedAutoTierPolicy(StorageSystem storageSystem, AutoTieringPolicy policy, String sloID, String sloName, String slo, String workload, String avgResponseTime) {
boolean newPolicy = false;
if (null == policy) {
newPolicy = true;
policy = new AutoTieringPolicy();
policy.setId(URIUtil.createId(AutoTieringPolicy.class));
policy.setStorageSystem(storageSystem.getId());
policy.setNativeGuid(sloID);
policy.setSystemType(storageSystem.getSystemType());
policy.setVmaxSLO(slo);
policy.setVmaxWorkload(workload);
}
policy.setLabel(sloName);
policy.setPolicyName(sloName);
policy.setPolicyEnabled(true);
if (!Constants.NOT_AVAILABLE.equalsIgnoreCase(avgResponseTime)) {
policy.setAvgExpectedResponseTime(Double.parseDouble(avgResponseTime));
}
// SLO is on V3 VMAX, which only supports Thin
policy.setProvisioningType(AutoTieringPolicy.ProvisioningType.ThinlyProvisioned.name());
if (newPolicy) {
newSLOList.add(policy);
} else {
updateSLOList.add(policy);
}
}
use of com.emc.storageos.db.client.model.AutoTieringPolicy in project coprhd-controller by CoprHD.
the class FASTPolicyProcessor method performPolicyBookKeeping.
/**
* if the policy had been deleted from the Array, the rediscovery cycle should set the fast Policy to inactive if that policy
* has no volumes associated.
*
* @param policyNames
* @param storageSystemURI
* @throws IOException
*/
private void performPolicyBookKeeping(Set<String> policyNames, URI storageSystemURI) throws IOException {
URIQueryResultList policyList = new URIQueryResultList();
_dbClient.queryByConstraint(ContainmentConstraint.Factory.getStorageDeviceFASTPolicyConstraint(storageSystemURI), policyList);
Iterator<AutoTieringPolicy> policyIterator = _dbClient.queryIterativeObjects(AutoTieringPolicy.class, policyList, true);
while (policyIterator.hasNext()) {
AutoTieringPolicy policyObject = policyIterator.next();
String policyName = policyObject.getPolicyName();
if (Constants.START_HIGH_THEN_AUTO_TIER_POLICY_NAME.equals(policyName) || // If a VMAX3 SLO AutoTierPolicy, do not process here
!Strings.isNullOrEmpty(policyObject.getVmaxSLO())) {
continue;
}
/**
* Since START_HIGH_THEN_AUTO_TIER_POLICY is ViPR created policy, no need to clean up
*/
if (!policyNames.contains(policyName) && !policyHasVolume(policyObject)) {
policyObject.setPolicyEnabled(false);
if (policyObject.getPools() != null) {
policyObject.getPools().clear();
} else {
_logger.info("Policy {} does not have pools", policyObject.getId());
}
_logger.info("Marking Policy {}({}) inactive as it is not discovered", policyName, policyObject.getId());
policyObject.setInactive(true);
_dbClient.updateObject(policyObject);
}
}
}
use of com.emc.storageos.db.client.model.AutoTieringPolicy in project coprhd-controller by CoprHD.
the class RPBlockServiceApiImpl method logVolumeInfo.
/**
* Helper method to display volume attributes as they are prepared.
*
* @param volume
*/
private String logVolumeInfo(Volume volume) {
StringBuilder buf = new StringBuilder();
if (null != volume && !NullColumnValueGetter.isNullURI(volume.getId())) {
VirtualArray varray = _dbClient.queryObject(VirtualArray.class, volume.getVirtualArray());
VirtualPool vpool = _dbClient.queryObject(VirtualPool.class, volume.getVirtualPool());
ProtectionSystem ps = _dbClient.queryObject(ProtectionSystem.class, volume.getProtectionController());
BlockConsistencyGroup consistencyGroup = _dbClient.queryObject(BlockConsistencyGroup.class, volume.getConsistencyGroup());
buf.append(String.format("%nPreparing RP %s Volume:%n", volume.getPersonality()));
buf.append(String.format("\t Name : [%s] (%s)%n", volume.getLabel(), volume.getId()));
buf.append(String.format("\t Personality : [%s]%n", volume.getPersonality()));
if (RPHelper.isVPlexVolume(volume, _dbClient) && (null != volume.getAssociatedVolumes())) {
buf.append(String.format("\t VPLEX : [%s] %n", ((volume.getAssociatedVolumes().size() > 1) ? "Distributed" : "Local")));
buf.append(String.format("\t\t====="));
for (String uriString : volume.getAssociatedVolumes()) {
Volume backingVolume = _dbClient.queryObject(Volume.class, URI.create(uriString));
VirtualArray backingVolumeVarray = _dbClient.queryObject(VirtualArray.class, backingVolume.getVirtualArray());
VirtualPool backingVolumeVpool = _dbClient.queryObject(VirtualPool.class, backingVolume.getVirtualPool());
StorageSystem backingVolumeStorageSystem = _dbClient.queryObject(StorageSystem.class, backingVolume.getStorageController());
StoragePool backingVolumePool = _dbClient.queryObject(StoragePool.class, backingVolume.getPool());
buf.append(String.format("%n\t\t Backing Volume Name : [%s] (%s)%n", backingVolume.getLabel(), backingVolume.getId()));
buf.append(String.format("\t\t Backing Volume Virtual Array : [%s] (%s) %n", backingVolumeVarray.getLabel(), backingVolumeVarray.getId()));
buf.append(String.format("\t\t Backing Volume Virtual Pool : [%s] (%s) %n", backingVolumeVpool.getLabel(), backingVolumeVpool.getId()));
buf.append(String.format("\t\t Backing Volume Storage System : [%s] (%s) %n", backingVolumeStorageSystem.getLabel(), backingVolumeStorageSystem.getId()));
buf.append(String.format("\t\t Backing Volume Storage Pool : [%s] (%s) %n", backingVolumePool.getLabel(), backingVolumePool.getId()));
if (NullColumnValueGetter.isNotNullValue(backingVolume.getInternalSiteName())) {
String internalSiteName = ((ps.getRpSiteNames() != null) ? ps.getRpSiteNames().get(backingVolume.getInternalSiteName()) : backingVolume.getInternalSiteName());
buf.append(String.format("\t\t Backing Volume RP Internal Site : [%s %s] %n", internalSiteName, backingVolume.getInternalSiteName()));
buf.append(String.format("\t\t Backing Volume RP Copy Name : [%s] %n", backingVolume.getRpCopyName()));
}
}
buf.append(String.format("\t\t=====%n"));
}
buf.append(String.format("\t Consistency Group : [%s] (%s)%n", consistencyGroup.getLabel(), consistencyGroup.getId()));
buf.append(String.format("\t Virtual Array : [%s] (%s)%n", varray.getLabel(), varray.getId()));
buf.append(String.format("\t Virtual Pool : [%s] (%s)%n", vpool.getLabel(), vpool.getId()));
buf.append(String.format("\t Capacity : [%s] %n", volume.getCapacity()));
if (!NullColumnValueGetter.isNullURI(volume.getStorageController())) {
StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, volume.getStorageController());
buf.append(String.format("\t Storage System : [%s] (%s)%n", storageSystem.getLabel(), storageSystem.getId()));
}
if (!NullColumnValueGetter.isNullURI(volume.getPool())) {
StoragePool pool = _dbClient.queryObject(StoragePool.class, volume.getPool());
buf.append(String.format("\t Storage Pool : [%s] (%s)%n", pool.getLabel(), pool.getId()));
}
if (!NullColumnValueGetter.isNullURI(volume.getAutoTieringPolicyUri())) {
AutoTieringPolicy policy = _dbClient.queryObject(AutoTieringPolicy.class, volume.getAutoTieringPolicyUri());
buf.append(String.format("\t Auto Tier Policy : [%s]%n", policy.getPolicyName()));
}
buf.append(String.format("\t RP Protection System : [%s] (%s)%n", ps.getLabel(), ps.getId()));
buf.append(String.format("\t RP Replication Set : [%s]%n", volume.getRSetName()));
if (Volume.PersonalityTypes.SOURCE.name().equals(volume.getPersonality())) {
buf.append(String.format("\t RP MetroPoint enabled : [%s]%n", (VirtualPool.vPoolSpecifiesMetroPoint(vpool) ? "true" : "false")));
}
if (volume.getRpTargets() != null && !volume.getRpTargets().isEmpty()) {
buf.append(String.format("\t RP Target Volume(s) for Source : ["));
for (String targetVolumeId : volume.getRpTargets()) {
Volume targetVolume = _dbClient.queryObject(Volume.class, URI.create(targetVolumeId));
buf.append(String.format("%s, ", targetVolume.getLabel()));
}
int endIndex = buf.length();
buf.delete(endIndex - 2, endIndex);
buf.append(String.format("]%n"));
}
String internalSiteName = ((ps.getRpSiteNames() != null) ? ps.getRpSiteNames().get(volume.getInternalSiteName()) : volume.getInternalSiteName());
buf.append(String.format("\t RP Internal Site : [%s %s]%n", internalSiteName, volume.getInternalSiteName()));
buf.append(String.format("\t RP Copy Name : [%s]%n", volume.getRpCopyName()));
}
return buf.toString();
}
Aggregations