Skip to content

Commit d623db0

Browse files
Srivastava, PiyushSrivastava, Piyush
authored andcommitted
bugfix/CSTACKEX-188: fixed hypervisor for zone scope
1 parent b42f1ca commit d623db0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,14 @@ public boolean attachZone(DataStore dataStore, ZoneScope scope, Hypervisor.Hyper
347347
logger.error("attachZone : Storage Pool not found for id: " + dataStore.getId());
348348
throw new CloudRuntimeException("Storage Pool not found for id: " + dataStore.getId());
349349
}
350+
if(hypervisorType != null && hypervisorType == Hypervisor.HypervisorType.None && storagePool.getHypervisor() == null){
351+
storagePool.setHypervisor(hypervisorType);
352+
storagePoolDao.update(storagePool.getId(),storagePool);
353+
logger.debug("attachZone : Set Hypervisor type for storage pool {} to {}", storagePool.getName(), hypervisorType);
354+
}
350355

351356
PrimaryDataStoreInfo primaryStore = (PrimaryDataStoreInfo)dataStore;
352-
List<HostVO> hostsToConnect = _resourceMgr.getEligibleUpAndEnabledHostsInZoneForStorageConnection(dataStore, scope.getScopeId(), Hypervisor.HypervisorType.KVM);
357+
List<HostVO> hostsToConnect = _resourceMgr.getEligibleUpAndEnabledHostsInZoneForStorageConnection(dataStore, scope.getScopeId(), hypervisorType);
353358
logger.debug(String.format("In createPool. Attaching the pool to each of the hosts in %s.", hostsToConnect));
354359

355360
Map<String, String> details = storagePoolDetailsDao.listDetailsKeyPairs(primaryStore.getId());

0 commit comments

Comments
 (0)