This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch 4.19
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.19 by this push:
     new abbc61c01ec engine-orchestration: expunge destroyed system vm volume 
(#9197)
abbc61c01ec is described below

commit abbc61c01ecef93d575efd6945746f4cb6edae63
Author: Abhishek Kumar <[email protected]>
AuthorDate: Thu Jun 13 13:30:22 2024 +0530

    engine-orchestration: expunge destroyed system vm volume (#9197)
    
    Signed-off-by: Abhishek Kumar <[email protected]>
---
 .../org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
 
b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
index 565c3f2101a..5ad9f5e5ddf 100644
--- 
a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ 
b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -1186,7 +1186,8 @@ public class VolumeOrchestrator extends ManagerBase 
implements VolumeOrchestrati
                     s_logger.error(String.format("Unable to destroy existing 
volume [%s] due to [%s].", volumeToString, e.getMessage()));
                 }
                 // In case of VMware VM will continue to use the old root disk 
until expunged, so force expunge old root disk
-                if (vm.getHypervisorType() == HypervisorType.VMware) {
+                // For system VM we do not need volume entry in Destroy state
+                if (vm.getHypervisorType() == HypervisorType.VMware || 
vm.getType().isUsedBySystem()) {
                     s_logger.info(String.format("Trying to expunge volume [%s] 
from primary data storage.", volumeToString));
                     AsyncCallFuture<VolumeApiResult> future = 
volService.expungeVolumeAsync(volFactory.getVolume(existingVolume.getId()));
                     try {

Reply via email to