Fix for a corner case during fullsync where it tolerates a VM to exist on two clusters by virtue of it’s current host id and last host id (being on two diff clusters).

This commit is contained in:
Abhinandan Prateek 2012-08-23 12:13:53 +05:30
parent e6ef6985f8
commit 6f26894eaf
1 changed files with 1 additions and 0 deletions

View File

@ -117,6 +117,7 @@ public class VMInstanceDaoImpl extends GenericDaoBase<VMInstanceVO, Long> implem
LHVMClusterSearch = createSearchBuilder();
SearchBuilder<HostVO> hostSearch1 = _hostDao.createSearchBuilder();
LHVMClusterSearch.join("hostSearch1", hostSearch1, hostSearch1.entity().getId(), LHVMClusterSearch.entity().getLastHostId(), JoinType.INNER);
LHVMClusterSearch.and("hostid", LHVMClusterSearch.entity().getHostId(), Op.NULL);
hostSearch1.and("clusterId", hostSearch1.entity().getClusterId(), SearchCriteria.Op.EQ);
LHVMClusterSearch.done();