sureshanaparti commented on code in PR #8977:
URL: https://github.com/apache/cloudstack/pull/8977#discussion_r1580544655
##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -7909,7 +7909,7 @@ public Pair<UserVmVO, Volume> doInTransaction(final
TransactionStatus status) th
// Detach, destroy and create the usage event for the old root
volume.
_volsDao.detachVolume(root.getId());
- _volumeService.destroyVolume(root.getId(), caller, expunge,
false);
+ _volumeService.destroyVolume(root.getId(), caller,
root.getState() == Volume.State.Allocated || expunge, false);
Review Comment:
```suggestion
_volumeService.destroyVolume(root.getId(), caller,
Volume.State.Allocated.equals(root.getState()) || expunge, false);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]