You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/11/23 17:49:26 UTC

[GitHub] [cloudstack] weizhouapache commented on a diff in pull request #6868: Set root volume as destroyed when destroying a VM

weizhouapache commented on code in PR #6868:
URL: https://github.com/apache/cloudstack/pull/6868#discussion_r1030736104


##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1325,6 +1328,12 @@ public void cleanupStorage(boolean recurring) {
 
                     List<VolumeVO> vols = _volsDao.listVolumesToBeDestroyed(new Date(System.currentTimeMillis() - ((long)StorageCleanupDelay.value() << 10)));
                     for (VolumeVO vol : vols) {
+                        if (Type.ROOT.equals(vol.getVolumeType()) && userVmManager.getDestroyRootVolumeOnVmDestruction(vol.getDomainId())) {

Review Comment:
   @JoaoJandre 
   the vm state should be checked instead of the global/domain setting, because the setting can be changed.
   if vm state is in Destroyed state, skip it and continue



-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org