use of com.emc.storageos.exceptions.DeviceControllerException in project coprhd-controller by CoprHD.
the class BlockConsistencyGroupUpdateCompleter method error.
@Override
public void error(DbClient dbClient, ServiceCoded serviceCoded) throws DeviceControllerException {
try {
super.error(dbClient, serviceCoded);
BlockConsistencyGroup consistencyGroup = dbClient.queryObject(BlockConsistencyGroup.class, getConsistencyGroupURI());
dbClient.error(BlockConsistencyGroup.class, consistencyGroup.getId(), getOpId(), serviceCoded);
recordBourneBlockConsistencyGroupEvent(dbClient, consistencyGroup.getId(), eventType(Status.error), Status.error, eventMessage(Status.error, consistencyGroup));
} catch (Exception e) {
_log.error("Failed updating status. BlockConsistencyGroupUpdate {}, " + "for task " + getOpId(), getId(), e);
}
}
use of com.emc.storageos.exceptions.DeviceControllerException in project coprhd-controller by CoprHD.
the class BlockMirrorCreateCompleter method complete.
@Override
protected void complete(DbClient dbClient, Operation.Status status, ServiceCoded coded) throws DeviceControllerException {
try {
super.complete(dbClient, status, coded);
List<BlockMirror> mirrorList = dbClient.queryObject(BlockMirror.class, getIds());
for (BlockMirror mirror : mirrorList) {
Volume volume = dbClient.queryObject(Volume.class, mirror.getSource());
switch(status) {
case error:
mirror.setInactive(true);
dbClient.persistObject(mirror);
removeMirrorFromVolume(mirror.getId(), volume, dbClient);
dbClient.error(BlockMirror.class, mirror.getId(), getOpId(), coded);
dbClient.error(Volume.class, volume.getId(), getOpId(), coded);
break;
default:
dbClient.ready(BlockMirror.class, mirror.getId(), getOpId());
dbClient.ready(Volume.class, volume.getId(), getOpId());
}
recordBlockMirrorOperation(dbClient, OperationTypeEnum.CREATE_VOLUME_MIRROR, status, eventMessage(status, volume, mirror), mirror, volume);
}
} catch (Exception e) {
_log.error("Failed updating status. BlockMirrorCreate {}, for task " + getOpId(), Joiner.on("\t").join(getIds()), e);
}
}
use of com.emc.storageos.exceptions.DeviceControllerException in project coprhd-controller by CoprHD.
the class BlockMirrorDeactivateCompleter method complete.
@Override
protected void complete(DbClient dbClient, Operation.Status status, ServiceCoded coded) throws DeviceControllerException {
try {
super.complete(dbClient, status, coded);
List<BlockMirror> mirrorList = dbClient.queryObject(BlockMirror.class, getIds());
for (BlockMirror mirror : mirrorList) {
Volume volume = dbClient.queryObject(Volume.class, mirror.getSource());
switch(status) {
case error:
dbClient.error(BlockMirror.class, mirror.getId(), getOpId(), coded);
dbClient.error(Volume.class, volume.getId(), getOpId(), coded);
break;
default:
dbClient.ready(BlockMirror.class, mirror.getId(), getOpId());
dbClient.ready(Volume.class, volume.getId(), getOpId());
}
recordBlockMirrorOperation(dbClient, OperationTypeEnum.DEACTIVATE_VOLUME_MIRROR, status, eventMessage(status, volume, mirror), mirror, volume);
}
List<URI> promotees = getPromotees();
if (promotees != null && !promotees.isEmpty()) {
List<Volume> promotedVolumes = dbClient.queryObject(Volume.class, promotees);
List<Volume> volumesToUpdate = new ArrayList<Volume>();
for (Volume volume : promotedVolumes) {
switch(status) {
case error:
dbClient.error(Volume.class, volume.getId(), getOpId(), coded);
volume.setInactive(true);
volumesToUpdate.add(volume);
break;
default:
dbClient.ready(Volume.class, volume.getId(), getOpId());
}
}
if (!volumesToUpdate.isEmpty()) {
dbClient.persistObject(volumesToUpdate);
}
}
} catch (Exception e) {
_log.error("Failed updating status. BlockMirrorDeactivate {}, for task " + getOpId(), Joiner.on("\t").join(getIds()), e);
}
}
use of com.emc.storageos.exceptions.DeviceControllerException in project coprhd-controller by CoprHD.
the class BlockMirrorDeleteCompleter method complete.
@Override
protected void complete(DbClient dbClient, Operation.Status status, ServiceCoded coded) throws DeviceControllerException {
try {
super.complete(dbClient, status, coded);
List<BlockMirror> mirrorList = dbClient.queryObject(BlockMirror.class, getIds());
for (BlockMirror mirror : mirrorList) {
Volume volume = dbClient.queryObject(Volume.class, mirror.getSource());
switch(status) {
case error:
dbClient.error(BlockMirror.class, mirror.getId(), getOpId(), coded);
dbClient.error(Volume.class, volume.getId(), getOpId(), coded);
break;
default:
dbClient.ready(BlockMirror.class, mirror.getId(), getOpId());
dbClient.ready(Volume.class, volume.getId(), getOpId());
}
recordBlockMirrorOperation(dbClient, OperationTypeEnum.DELETE_VOLUME_MIRROR, status, eventMessage(status, volume, mirror), mirror, volume);
}
} catch (Exception e) {
_log.error("Failed updating status. BlockMirrorCreate {}, for task " + getOpId(), Joiner.on("\t").join(getIds()), e);
}
}
use of com.emc.storageos.exceptions.DeviceControllerException in project coprhd-controller by CoprHD.
the class BlockSnapshotDeactivateCompleter method complete.
@Override
protected void complete(DbClient dbClient, Operation.Status status, ServiceCoded coded) throws DeviceControllerException {
try {
List<BlockSnapshot> snapshots = dbClient.queryObject(BlockSnapshot.class, snapshotURIs);
for (BlockSnapshot snapshot : snapshots) {
Volume volume = dbClient.queryObject(Volume.class, snapshot.getParent());
switch(status) {
case error:
setErrorOnDataObject(dbClient, BlockSnapshot.class, snapshot, coded);
setErrorOnDataObject(dbClient, Volume.class, volume.getId(), coded);
break;
case ready:
// Only execute the following logic if the snapshot has been deactivated and is tied to a bookmark
if (deactivatedSnapshots.contains(snapshot.getId()) && RPHelper.hasRpBookmark(snapshot)) {
// Note regarding the syncActive field:
// If we are performing a disable image access as part of a snapshot create for an array snapshot + RP bookmark,
// we want to set the syncActive field to true. This will enable us to perform snapshot exports and remove
// snapshots from exports.
// Update the snapshot/volume fields
RPHelper.updateRPSnapshotPostImageAccessChange(snapshot, volume, Volume.VolumeAccessState.NOT_READY, setSnapshotSyncActive, dbClient);
}
default:
setReadyOnDataObject(dbClient, BlockSnapshot.class, snapshot);
setReadyOnDataObject(dbClient, Volume.class, volume.getId());
break;
}
recordBlockSnapshotOperation(dbClient, OperationTypeEnum.DEACTIVATE_VOLUME_SNAPSHOT, status, eventMessage(status, volume, snapshot), snapshot);
}
super.complete(dbClient, status, coded);
_log.info("Done deactivate {}, with Status: {}", getOpId(), status.name());
} catch (Exception e) {
_log.error("Failed updating status. SnapshotDeactivate {}, for task " + getOpId(), getId(), e);
}
}
Aggregations