Skip to content

Commit 1aaf2ae

Browse files
committed
scaleio fix
Signed-off-by: Abhishek Kumar <[email protected]>
1 parent 3dccebc commit 1aaf2ae

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

plugins/storage/volume/scaleio/src/main/java/org/apache/cloudstack/storage/datastore/lifecycle/ScaleIOPrimaryDataStoreLifeCycle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public boolean attachZone(DataStore dataStore, ZoneScope scope, Hypervisor.Hyper
285285
}
286286

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

291291
dataStoreHelper.attachZone(dataStore);

plugins/storage/volume/scaleio/src/test/java/org/apache/cloudstack/storage/datastore/lifecycle/ScaleIOPrimaryDataStoreLifeCycleTest.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,7 @@ public void testAttachZone() throws Exception {
137137

138138
final ZoneScope scope = new ZoneScope(1L);
139139

140-
List<HostVO> hostList = new ArrayList<HostVO>();
141-
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,
142-
UUID.randomUUID().toString(), Status.Up, "1.0", null, null, 1L, null, 0, 0, "aa", 0, Storage.StoragePoolType.PowerFlex);
143-
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,
144-
UUID.randomUUID().toString(), Status.Up, "1.0", null, null, 1L, null, 0, 0, "aa", 0, Storage.StoragePoolType.PowerFlex);
145-
146-
host1.setResourceState(ResourceState.Enabled);
147-
host2.setResourceState(ResourceState.Enabled);
148-
hostList.add(host1);
149-
hostList.add(host2);
150-
when(resourceManager.listAllUpAndEnabledHostsInOneZoneByHypervisor(Hypervisor.HypervisorType.KVM, 1L)).thenReturn(hostList);
140+
when(hostDao.listIdsForUpEnabledByZoneAndHypervisor(scope.getScopeId(), Hypervisor.HypervisorType.KVM)).thenReturn(List.of(1L, 2L));
151141

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

0 commit comments

Comments
 (0)