use of com.emc.storageos.volumecontroller.impl.smis.CIMPropertyFactory in project coprhd-controller by CoprHD.
the class VmaxExportOperations method setVSAFlagForIG.
private void setVSAFlagForIG(StorageSystem storage, CIMObjectPath initiatorGroupPath, boolean VSAFlag) throws Exception {
WBEMClient client = _helper.getConnection(storage).getCimClient();
CIMPropertyFactory factoryRef = (CIMPropertyFactory) ControllerServiceImpl.getBean("CIMPropertyFactory");
CIMInstance toUpdate = new CIMInstance(initiatorGroupPath, new CIMProperty[] { factoryRef.bool(SmisConstants.CP_EMC_VSA_ENABLED, VSAFlag) });
client.modifyInstance(toUpdate, SmisConstants.PS_EMC_VSA_ENABLED);
}
use of com.emc.storageos.volumecontroller.impl.smis.CIMPropertyFactory in project coprhd-controller by CoprHD.
the class SmisCreateMaskingViewJob method enableRecoverPointTag.
/**
* Method will set the EMCRecoverPointEnabled flag on the device masking group for VMAX.
*
* @param dbClient [in] - Client instance for reading/writing from/to DB
* @param client [in] - WBEMClient used for reading/writing from/to SMI-S
* @param deviceGroupPath [in] - CIMObjectPath referencing the volume
*/
private void enableRecoverPointTag(DbClient dbClient, WBEMClient client, CIMObjectPath deviceGroupPath) {
try {
boolean isRPTagNeeded = false;
// Check if the volumes being protected are RP volumes
for (VolumeURIHLU volUriHlu : _volumeURIHLUs) {
URI volumeURI = volUriHlu.getVolumeURI();
BlockObject bo = null;
if (URIUtil.isType(volumeURI, BlockSnapshot.class)) {
bo = dbClient.queryObject(BlockSnapshot.class, volumeURI);
} else if (URIUtil.isType(volumeURI, Volume.class)) {
bo = dbClient.queryObject(Volume.class, volumeURI);
}
if (bo != null && BlockObject.checkForRP(dbClient, bo.getId())) {
isRPTagNeeded = true;
break;
}
}
// Do nothing and return from if none of the volumes are RP protected
if (isRPTagNeeded) {
_log.info("Attempting to enable RecoverPoint tag on Device Group : " + deviceGroupPath.toString());
CIMPropertyFactory factoryRef = (CIMPropertyFactory) ControllerServiceImpl.getBean("CIMPropertyFactory");
CIMInstance toUpdate = new CIMInstance(deviceGroupPath, new CIMProperty[] { factoryRef.bool(SmisConstants.EMC_RECOVERPOINT_ENABLED, true) });
_log.debug("Params: " + toUpdate.toString());
client.modifyInstance(toUpdate, SmisConstants.CP_EMC_RECOVERPOINT_ENABLED);
_log.info(String.format("Device group has been successfully set with RecoverPoint tag "));
}
} catch (WBEMException e) {
_log.error("Encountered an error while trying to set the RecoverPoint tag", e);
} catch (DatabaseException e) {
_log.error("Encountered an error while trying to set the RecoverPoint tag", e);
}
}
Aggregations