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 <abhishek.mrt22@gmail.com>
This commit is contained in:
Abhishek Kumar 2024-07-15 09:46:29 +05:30 committed by GitHub
parent 2cfb541a1d
commit 6a8494be3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);