Skip to content

Commit

Permalink
scaleio fix
Browse files Browse the repository at this point in the history
Signed-off-by: Abhishek Kumar <[email protected]>
  • Loading branch information
shwstppr committed Oct 23, 2024
1 parent 3dccebc commit 1aaf2ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public boolean attachZone(DataStore dataStore, ZoneScope scope, Hypervisor.Hyper
}

LOGGER.debug("Attaching the pool to each of the hosts in the zone: " + scope.getScopeId());
List<Long> hostIds = hostDao.listIdsForUpRouting(null, null, scope.getScopeId());
List<Long> hostIds = hostDao.listIdsForUpEnabledByZoneAndHypervisor(scope.getScopeId(), hypervisorType);
storageMgr.connectHostsToPool(dataStore, hostIds, scope, false, false);

dataStoreHelper.attachZone(dataStore);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,7 @@ public void testAttachZone() throws Exception {

final ZoneScope scope = new ZoneScope(1L);

List<HostVO> hostList = new ArrayList<HostVO>();
HostVO host1 = new HostVO(1L, "host01", Host.Type.Routing, "192.168.1.1", "255.255.255.0", null, null, null, null, null, null, null, null, null, null,
UUID.randomUUID().toString(), Status.Up, "1.0", null, null, 1L, null, 0, 0, "aa", 0, Storage.StoragePoolType.PowerFlex);
HostVO host2 = new HostVO(2L, "host02", Host.Type.Routing, "192.168.1.2", "255.255.255.0", null, null, null, null, null, null, null, null, null, null,
UUID.randomUUID().toString(), Status.Up, "1.0", null, null, 1L, null, 0, 0, "aa", 0, Storage.StoragePoolType.PowerFlex);

host1.setResourceState(ResourceState.Enabled);
host2.setResourceState(ResourceState.Enabled);
hostList.add(host1);
hostList.add(host2);
when(resourceManager.listAllUpAndEnabledHostsInOneZoneByHypervisor(Hypervisor.HypervisorType.KVM, 1L)).thenReturn(hostList);
when(hostDao.listIdsForUpEnabledByZoneAndHypervisor(scope.getScopeId(), Hypervisor.HypervisorType.KVM)).thenReturn(List.of(1L, 2L));

when(dataStoreMgr.getDataStore(anyLong(), eq(DataStoreRole.Primary))).thenReturn(store);
when(store.getId()).thenReturn(1L);
Expand Down

0 comments on commit 1aaf2ae

Please sign in to comment.