} else if (pool.getHypervisor() != null && !pool.getHypervisor().equals(HypervisorType.Any) && !(pool.getHypervisor() == dskCh.getHypervisorType())) { if (s_logger.isDebugEnabled()) { s_logger.debug("StoragePool does not have required hypervisorType, skipping this pool");
private void checkDestinationHypervisorType(StoragePool destPool, VMInstanceVO vm) { HypervisorType destHypervisorType = destPool.getHypervisor(); if (destHypervisorType == null) { destHypervisorType = _clusterDao.findById( destPool.getClusterId()).getHypervisorType(); } if (vm.getHypervisorType() != destHypervisorType && destHypervisorType != HypervisorType.Any) { throw new InvalidParameterValueException("hypervisor is not compatible: dest: " + destHypervisorType.toString() + ", vm: " + vm.getHypervisorType().toString()); } }
private HypervisorType getHypervisorType(VMInstanceVO vm, StoragePool srcVolumePool, VirtualMachineProfile profile) { HypervisorType type = null; if (vm == null) { StoragePoolVO poolVo = _poolDao.findById(srcVolumePool.getId()); if (ScopeType.CLUSTER.equals(poolVo.getScope())) { Long clusterId = poolVo.getClusterId(); if (clusterId != null) { ClusterVO cluster = _clusterDao.findById(clusterId); type = cluster.getHypervisorType(); } } else if (ScopeType.ZONE.equals(poolVo.getScope())) { Long zoneId = poolVo.getDataCenterId(); if (zoneId != null) { DataCenterVO dc = _dcDao.findById(zoneId); } } if (null == type) { type = srcVolumePool.getHypervisor(); } } else { type = profile.getHypervisorType(); } return type; }
if (HypervisorType.Any.equals(pool.getHypervisor())) { hosts = _resourceMgr.listAllUpAndEnabledHostsInOneZone(pool.getDataCenterId());