use of com.cloud.agent.api.GetGPUStatsAnswer in project cloudstack by apache.
the class XenServer620SP1GetGPUStatsCommandWrapper method execute.
@Override
public Answer execute(final GetGPUStatsCommand command, final XenServer620SP1Resource xenServer620SP1Resource) {
final Connection conn = xenServer620SP1Resource.getConnection();
HashMap<String, HashMap<String, VgpuTypesInfo>> groupDetails = new HashMap<String, HashMap<String, VgpuTypesInfo>>();
try {
groupDetails = xenServer620SP1Resource.getGPUGroupDetails(conn);
} catch (final Exception e) {
final String msg = "Unable to get GPU stats" + e.toString();
s_logger.warn(msg, e);
return new GetGPUStatsAnswer(command, false, msg);
}
return new GetGPUStatsAnswer(command, groupDetails);
}
use of com.cloud.agent.api.GetGPUStatsAnswer in project cosmic by MissionCriticalCloud.
the class XenServer620SP1GetGPUStatsCommandWrapper method execute.
@Override
public Answer execute(final GetGPUStatsCommand command, final XenServer620SP1Resource xenServer620SP1Resource) {
final Connection conn = xenServer620SP1Resource.getConnection();
HashMap<String, HashMap<String, VgpuTypesInfo>> groupDetails = new HashMap<>();
try {
groupDetails = xenServer620SP1Resource.getGPUGroupDetails(conn);
} catch (final Exception e) {
final String msg = "Unable to get GPU stats" + e.toString();
s_logger.warn(msg, e);
return new GetGPUStatsAnswer(command, false, msg);
}
return new GetGPUStatsAnswer(command, groupDetails);
}
use of com.cloud.agent.api.GetGPUStatsAnswer in project cosmic by MissionCriticalCloud.
the class ResourceManagerImpl method getGPUStatistics.
@Override
public HashMap<String, HashMap<String, VgpuTypesInfo>> getGPUStatistics(final HostVO host) {
final Answer answer = _agentMgr.easySend(host.getId(), new GetGPUStatsCommand(host.getGuid(), host.getName()));
if (answer != null && answer instanceof UnsupportedAnswer) {
return null;
}
if (answer == null || !answer.getResult()) {
final String msg = "Unable to obtain GPU stats for host " + host.getName();
s_logger.warn(msg);
return null;
} else {
// now construct the result object
if (answer instanceof GetGPUStatsAnswer) {
return ((GetGPUStatsAnswer) answer).getGroupDetails();
}
}
return null;
}
use of com.cloud.agent.api.GetGPUStatsAnswer in project cloudstack by apache.
the class ResourceManagerImpl method getGPUStatistics.
@Override
public HashMap<String, HashMap<String, VgpuTypesInfo>> getGPUStatistics(final HostVO host) {
final Answer answer = _agentMgr.easySend(host.getId(), new GetGPUStatsCommand(host.getGuid(), host.getName()));
if (answer != null && answer instanceof UnsupportedAnswer) {
return null;
}
if (answer == null || !answer.getResult()) {
final String msg = String.format("Unable to obtain GPU stats for %s", host);
s_logger.warn(msg);
return null;
} else {
// now construct the result object
if (answer instanceof GetGPUStatsAnswer) {
return ((GetGPUStatsAnswer) answer).getGroupDetails();
}
}
return null;
}
Aggregations