Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import javax.inject.Inject;
import javax.naming.ConfigurationException;

import com.cloud.storage.ScopeType;
import org.apache.cloudstack.acl.ControlledEntity.ACLType;
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
import org.apache.cloudstack.affinity.AffinityGroupService;
Expand Down Expand Up @@ -1942,14 +1943,23 @@ public HashMap<Long, VmStatsEntry> getVirtualMachineStatistics(long hostId, Stri
@Override
public HashMap<String, VolumeStatsEntry> getVolumeStatistics(long clusterId, String poolUuid, StoragePoolType poolType, List<String> volumeLocators, int timeout) {
List<HostVO> neighbors = _resourceMgr.listHostsInClusterByStatus(clusterId, Status.Up);
StoragePool storagePool = _storagePoolDao.findPoolByUUID(poolUuid);
StoragePoolVO storagePool = _storagePoolDao.findPoolByUUID(poolUuid);
for (HostVO neighbor : neighbors) {
if (storagePool.isManaged()) {
// apply filters:
// - managed storage
// - local storage
if (storagePool.isManaged() || storagePool.isLocal()) {

volumeLocators = getVolumesByHost(neighbor, storagePool);

}

// - zone wide storage for specific hypervisortypes
if (ScopeType.ZONE.equals(storagePool.getScope()) && storagePool.getHypervisor() != neighbor.getHypervisorType()) {
// skip this neighbour if their hypervisor type is not the same as that of the store
continue;
}

GetVolumeStatsCommand cmd = new GetVolumeStatsCommand(poolType, poolUuid, volumeLocators);

if (timeout > 0) {
Expand Down