mirror of https://github.com/apache/cloudstack.git
For assignVM, marking older snapshots removed in db
This commit is contained in:
parent
6f26894eaf
commit
3298a481a8
|
|
@ -3463,6 +3463,11 @@ 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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue