mirror of https://github.com/apache/cloudstack.git
bug CS-16031: marking older snapshots removed in db
This commit is contained in:
parent
45eb035e20
commit
953d0b7c0b
|
|
@ -3507,8 +3507,13 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
_resourceLimitMgr.incrementResourceCount(newAccount.getAccountId(), ResourceType.volume);
|
||||
_usageEventDao.persist(new UsageEventVO(EventTypes.EVENT_VOLUME_CREATE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(),
|
||||
volume.getDiskOfferingId(), volume.getTemplateId(), volume.getSize()));
|
||||
//snapshots: mark these removed in db
|
||||
List<SnapshotVO> snapshots = _snapshotDao.listByVolumeIdIncludingRemoved(volume.getId());
|
||||
for (SnapshotVO snapshot: snapshots){
|
||||
_snapshotDao.remove(snapshot.getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_resourceLimitMgr.incrementResourceCount(newAccount.getAccountId(), ResourceType.user_vm);
|
||||
//generate usage events to account for this change
|
||||
_usageEventDao.persist(new UsageEventVO(EventTypes.EVENT_VM_CREATE, vm.getAccountId(), vm.getDataCenterIdToDeployIn(), vm.getId(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue