mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-9113: skip vm with inconsistent state when getVmNetworkStats
This commit is contained in:
parent
047a57ddf2
commit
c03923c7e7
|
|
@ -48,12 +48,16 @@ public final class LibvirtGetVmNetworkStatsCommandWrapper extends CommandWrapper
|
|||
final HashMap<String, List<VmNetworkStatsEntry>> vmNetworkStatsNameMap = new HashMap<String, List<VmNetworkStatsEntry>>();
|
||||
final Connect conn = libvirtUtilitiesHelper.getConnection();
|
||||
for (final String vmName : vmNames) {
|
||||
final List<VmNetworkStatsEntry> statEntry = libvirtComputingResource.getVmNetworkStat(conn, vmName);
|
||||
if (statEntry == null) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
final List<VmNetworkStatsEntry> statEntry = libvirtComputingResource.getVmNetworkStat(conn, vmName);
|
||||
if (statEntry == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
vmNetworkStatsNameMap.put(vmName, statEntry);
|
||||
vmNetworkStatsNameMap.put(vmName, statEntry);
|
||||
} catch (LibvirtException e) {
|
||||
s_logger.warn("Can't get vm network stats: " + e.toString() + ", continue");
|
||||
}
|
||||
}
|
||||
return new GetVmNetworkStatsAnswer(command, "", command.getHostName(), vmNetworkStatsNameMap);
|
||||
} catch (final LibvirtException e) {
|
||||
|
|
@ -61,4 +65,4 @@ public final class LibvirtGetVmNetworkStatsCommandWrapper extends CommandWrapper
|
|||
return new GetVmNetworkStatsAnswer(command, null, null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue