You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2024/07/15 04:16:34 UTC

(cloudstack) branch 4.19 updated: engine-schema,cks: fix finding non removed network vms (#9339)

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

rohit 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 6a8494be3be engine-schema,cks: fix finding non removed network vms (#9339)
6a8494be3be is described below

commit 6a8494be3be37c58f2b9ff1fb8f8d76d186cc987
Author: Abhishek Kumar <ab...@gmail.com>
AuthorDate: Mon Jul 15 09:46:29 2024 +0530

    engine-schema,cks: fix finding non removed network vms (#9339)
    
    Fixes #9331
    
    Only those VMs should be considered network VM which have a NIC entry
    that is not marked removed.
    
    Signed-off-by: Abhishek Kumar <ab...@gmail.com>
---
 engine/schema/src/main/java/com/cloud/vm/dao/VMInstanceDaoImpl.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/engine/schema/src/main/java/com/cloud/vm/dao/VMInstanceDaoImpl.java b/engine/schema/src/main/java/com/cloud/vm/dao/VMInstanceDaoImpl.java
index e41c706a9cb..a1bd25c2fbc 100755
--- a/engine/schema/src/main/java/com/cloud/vm/dao/VMInstanceDaoImpl.java
+++ b/engine/schema/src/main/java/com/cloud/vm/dao/VMInstanceDaoImpl.java
@@ -856,6 +856,7 @@ public class VMInstanceDaoImpl extends GenericDaoBase<VMInstanceVO, Long> implem
 
             SearchBuilder<NicVO> nicSearch = nicDao.createSearchBuilder();
             nicSearch.and("networkId", nicSearch.entity().getNetworkId(), SearchCriteria.Op.EQ);
+            nicSearch.and("removed", nicSearch.entity().getRemoved(), SearchCriteria.Op.NULL);
 
             NetworkTypeSearch = createSearchBuilder();
             NetworkTypeSearch.and("types", NetworkTypeSearch.entity().getType(), SearchCriteria.Op.IN);