Github user rhtyd commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1624#discussion_r77325991 --- Diff: server/src/com/cloud/user/AccountManagerImpl.java --- @@ -677,6 +679,17 @@ public boolean deleteAccount(AccountVO account, long callerUserId, Account calle return cleanupAccount(account, callerUserId, caller); } + protected List<VolumeVO> getExpungedInstanceRootVolume(long instanceId) { + SearchBuilder<VolumeVO> sb = _volumeDao.createSearchBuilder(); + sb.and("instanceId", sb.entity().getInstanceId(), SearchCriteria.Op.EQ); + sb.and("vType", sb.entity().getVolumeType(), SearchCriteria.Op.EQ); + sb.done(); + SearchCriteria<VolumeVO> c = sb.create(); + c.setParameters("instanceId", instanceId); + c.setParameters("vType", Volume.Type.ROOT); + return _volumeDao.customSearchIncludingRemoved(c, null); --- End diff -- This method does not return expunged volume, but root volume of a VM. Could there be a case where a VM can have more than one root volume? If not, let's rename the method to say `getInstanceRootVolume` and return just the VolumeVO instead a list.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---