Skip to content

Commit 6a8494b

Browse files
authored
engine-schema,cks: fix finding non removed network vms (apache#9339)
Fixes apache#9331 Only those VMs should be considered network VM which have a NIC entry that is not marked removed. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 2cfb541 commit 6a8494b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

engine/schema/src/main/java/com/cloud/vm/dao/VMInstanceDaoImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,7 @@ public List<VMInstanceVO> listNonRemovedVmsByTypeAndNetwork(long networkId, Virt
856856

857857
SearchBuilder<NicVO> nicSearch = nicDao.createSearchBuilder();
858858
nicSearch.and("networkId", nicSearch.entity().getNetworkId(), SearchCriteria.Op.EQ);
859+
nicSearch.and("removed", nicSearch.entity().getRemoved(), SearchCriteria.Op.NULL);
859860

860861
NetworkTypeSearch = createSearchBuilder();
861862
NetworkTypeSearch.and("types", NetworkTypeSearch.entity().getType(), SearchCriteria.Op.IN);

0 commit comments

Comments
 (0)