com.cloud.resource.ResourceManager.updateGPUDetails()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中com.cloud.resource.ResourceManager.updateGPUDetails方法的一些代码示例,展示了ResourceManager.updateGPUDetails的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ResourceManager.updateGPUDetails方法的具体详情如下:
包路径:com.cloud.resource.ResourceManager
类名称:ResourceManager
方法名:updateGPUDetails

ResourceManager.updateGPUDetails介绍

[英]Update GPU device details (post VM deployment)
[中]更新GPU设备详细信息(虚拟机部署后)

代码示例

代码示例来源:origin: apache/cloudstack

/**
 * Updates GPU details on hosts supporting GPU.
 */
private void updateGpuEnabledHostsDetails(List<HostVO> hosts) {
  List<HostVO> gpuEnabledHosts = new ArrayList<HostVO>();
  List<Long> hostIds = _hostGpuGroupsDao.listHostIds();
  if (CollectionUtils.isEmpty(hostIds)) {
    return;
  }
  for (HostVO host : hosts) {
    if (hostIds.contains(host.getId())) {
      gpuEnabledHosts.add(host);
    }
  }
  for (HostVO host : gpuEnabledHosts) {
    HashMap<String, HashMap<String, VgpuTypesInfo>> groupDetails = _resourceMgr.getGPUStatistics(host);
    if (MapUtils.isEmpty(groupDetails)) {
      _resourceMgr.updateGPUDetails(host.getId(), groupDetails);
    }
  }
}

代码示例来源:origin: apache/cloudstack

final GPUDeviceTO gpuDevice = stop.getGpuDevice();
if (gpuDevice != null) {
  _resourceMgr.updateGPUDetails(vm.getHostId(), gpuDevice.getGroupDetails());

代码示例来源:origin: apache/cloudstack

_resourceMgr.updateGPUDetails(vm.getHostId(), gpuDevice.getGroupDetails());

代码示例来源:origin: apache/cloudstack

_resourceMgr.updateGPUDetails(destHostId, gpuDevice.getGroupDetails());

相关文章