Skip to content

Commit 87d73e2

Browse files
committed
CLOUDSTACK-1192: GetVmDiskStatsCommand return null as disk I/O statistics does not support xen/vmware
(cherry picked from commit 3121133)
1 parent b220403 commit 87d73e2

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@
154154
import com.cloud.agent.api.GetHostStatsCommand;
155155
import com.cloud.agent.api.GetStorageStatsAnswer;
156156
import com.cloud.agent.api.GetStorageStatsCommand;
157+
import com.cloud.agent.api.GetVmDiskStatsAnswer;
158+
import com.cloud.agent.api.GetVmDiskStatsCommand;
157159
import com.cloud.agent.api.GetVmStatsAnswer;
158160
import com.cloud.agent.api.GetVmStatsCommand;
159161
import com.cloud.agent.api.GetVncPortAnswer;
@@ -444,6 +446,8 @@ public Answer executeRequest(Command cmd) {
444446
answer = execute((GetHostStatsCommand) cmd);
445447
} else if (clz == GetVmStatsCommand.class) {
446448
answer = execute((GetVmStatsCommand) cmd);
449+
} else if (clz == GetVmDiskStatsCommand.class) {
450+
answer = execute((GetDiskVmStatsCommand) cmd);
447451
} else if (clz == CheckHealthCommand.class) {
448452
answer = execute((CheckHealthCommand) cmd);
449453
} else if (clz == StopCommand.class) {
@@ -3523,6 +3527,10 @@ protected Answer execute(GetVmStatsCommand cmd) {
35233527
return answer;
35243528
}
35253529

3530+
protected Answer execute(GetVmDiskStatsCommand cmd) {
3531+
return new GetVmDiskStatsAnswer(cmd, null, null, null);
3532+
}
3533+
35263534
protected Answer execute(CheckHealthCommand cmd) {
35273535
if (s_logger.isInfoEnabled()) {
35283536
s_logger.info("Executing resource CheckHealthCommand: " + _gson.toJson(cmd));

‎plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
import com.cloud.agent.api.GetHostStatsCommand;
5757
import com.cloud.agent.api.GetStorageStatsAnswer;
5858
import com.cloud.agent.api.GetStorageStatsCommand;
59+
import com.cloud.agent.api.GetVmDiskStatsAnswer;
60+
import com.cloud.agent.api.GetVmDiskStatsCommand;
5961
import com.cloud.agent.api.GetVmStatsAnswer;
6062
import com.cloud.agent.api.GetVmStatsCommand;
6163
import com.cloud.agent.api.GetVncPortAnswer;
@@ -489,6 +491,8 @@ public Answer executeRequest(Command cmd) {
489491
return execute((GetHostStatsCommand) cmd);
490492
} else if (clazz == GetVmStatsCommand.class) {
491493
return execute((GetVmStatsCommand) cmd);
494+
} else if (clazz == GetVmDiskStatsCommand.class) {
495+
return execute((GetVmDiskStatsCommand) cmd);
492496
} else if (clazz == CheckHealthCommand.class) {
493497
return execute((CheckHealthCommand) cmd);
494498
} else if (clazz == StopCommand.class) {
@@ -2745,6 +2749,10 @@ protected HashMap<String, VmStatsEntry> getVmStats(Connection conn, GetVmStatsCo
27452749
return vmResponseMap;
27462750
}
27472751

2752+
protected GetVmDiskStatsAnswer execute(GetVmDiskStatsCommand cmd) {
2753+
return new GetVmDiskStatsAnswer(cmd, null, null, null);
2754+
}
2755+
27482756
protected Object[] getRRDData(Connection conn, int flag) {
27492757

27502758
/*

0 commit comments

Comments
 (0)