mirror of https://github.com/apache/cloudstack.git
Merge branch '4.5' of https://git-wip-us.apache.org/repos/asf/cloudstack into 4.5
This commit is contained in:
commit
6df396c9c0
|
|
@ -971,11 +971,11 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager,
|
|||
snapshotStrategy.takeSnapshot(snapshot);
|
||||
|
||||
try {
|
||||
postCreateSnapshot(volume.getId(), snapshotId, payload.getSnapshotPolicyId());
|
||||
|
||||
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_SNAPSHOT_CREATE, snapshot.getAccountId(), snapshot.getDataCenterId(), snapshotId, snapshot.getName(),
|
||||
null, null, volume.getSize(), snapshot.getClass().getName(), snapshot.getUuid());
|
||||
postCreateSnapshot(volume.getId(), snapshotId, payload.getSnapshotPolicyId());
|
||||
SnapshotDataStoreVO snapshotStoreRef = _snapshotStoreDao.findBySnapshot(snapshotId, DataStoreRole.Image);
|
||||
// FIXME - snapshotStoreRef.getSize() refers to physical size, correct that
|
||||
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_SNAPSHOT_CREATE, snapshot.getAccountId(), snapshot.getDataCenterId(), snapshotId, snapshot.getName(),
|
||||
null, null, snapshotStoreRef.getSize(), volume.getSize(), snapshot.getClass().getName(), snapshot.getUuid());
|
||||
// Correct the resource count of snapshot in case of delta snapshots.
|
||||
_resourceLimitMgr.decrementResourceCount(snapshotOwner.getId(), ResourceType.secondary_storage, new Long(volume.getSize() - snapshotStoreRef.getSize()));
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue