Skip to content
Open
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
8 changes: 8 additions & 0 deletions server/src/main/java/com/cloud/server/StatsCollector.java
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,14 @@ protected void runInContext() {

Map<Object, Object> metrics = new HashMap<>();
for (HostVO host : hosts) {
if (host.getHypervisorType() == HypervisorType.KVM && ManagementServerNode.getManagementServerId() != host.getManagementServerId()) {
// When there are multiple Management Server nodes on the environment, all of them request stat collections for the same VM in different moments; with that,
// the interval from "vm.stats.interval" is not respected. Also, the stats commands are routed to the Management Server connected to the Agent where the VM is running.
// Furthermore, the number of stat entries on the DB scales with the number of Management Servers. Therefore, we only request the stat collections from
// hosts connected to the Management Server, honoring the interval, presenting the correct data, and reducing the necessary storage to store the VMs stats.
logger.debug("Skipping VM stat collection for [{}] as it is connected to another Management Server node [{}].", host, host.getManagementServerId());
continue;
}
Date timestamp = new Date();
Pair<Map<Long, VMInstanceVO>, Map<String, Long>> vmsAndMap = getVmMapForStatsForHost(host);
Map<Long, VMInstanceVO> vmMap = vmsAndMap.first();
Expand Down
Loading