mirror of https://github.com/apache/cloudstack.git
bug 9778: Log snapshot create event only if the snapshot is in not removed state after backingUp to secondary. Log snapshot delete event for backed up snapshots only
status 9778: resolved fixed
This commit is contained in:
parent
5928a9b370
commit
b30827a0ec
|
|
@ -419,8 +419,9 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
|
|||
// Cleanup jobs to do after the snapshot has been created; decrement resource count
|
||||
if (snapshot != null) {
|
||||
postCreateSnapshot(volumeId, snapshot.getId(), policyId, backedUp);
|
||||
|
||||
if (backedUp && (snapshot.getRemoved() == null)) {
|
||||
//Check if the snapshot was removed while backingUp. If yes, do not log snapshot create usage event
|
||||
SnapshotVO freshSnapshot = _snapshotDao.findById(snapshot.getId());
|
||||
if ((freshSnapshot != null) && backedUp) {
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_SNAPSHOT_CREATE, snapshot.getAccountId(), snapshot.getDataCenterId(), snapshotId, snapshot.getName(), null, null,
|
||||
v.getSize());
|
||||
_usageEventDao.persist(usageEvent);
|
||||
|
|
|
|||
Loading…
Reference in New Issue