@Override public GPUDeviceTO getGPUDevice(final long hostId, final String groupName, final String vgpuType) { final List<HostGpuGroupsVO> gpuDeviceList = listAvailableGPUDevice(hostId, groupName, vgpuType); if (CollectionUtils.isEmpty(gpuDeviceList)) { final String errorMsg = "Host " + hostId + " does not have required GPU device or out of capacity. GPU group: " + groupName + ", vGPU Type: " + vgpuType; s_logger.error(errorMsg); throw new CloudRuntimeException(errorMsg); } return new GPUDeviceTO(gpuDeviceList.get(0).getGroupName(), vgpuType, null); }
@Override public void createVGPU(final Connection conn, final StartCommand cmd, final VM vm, final GPUDeviceTO gpuDevice) throws XenAPIException, XmlRpcException { if (s_logger.isDebugEnabled()) { s_logger.debug("Creating VGPU of VGPU type [ " + gpuDevice.getVgpuType() + " ] in gpu group" + gpuDevice.getGpuGroup() + " for VM " + cmd.getVirtualMachine().getName()); final Set<GPUGroup> groups = GPUGroup.getByNameLabel(conn, gpuDevice.getGpuGroup()); assert groups.size() == 1 : "Should only have 1 group but found " + groups.size(); final GPUGroup gpuGroup = groups.iterator().next(); while (iter.hasNext()) { final VGPUType entry = iter.next(); if (entry.getModelName(conn).equals(gpuDevice.getVgpuType())) { vgpuType = entry; s_logger.debug("Created VGPU of VGPU type [ " + gpuDevice.getVgpuType() + " ] for VM " + cmd.getVirtualMachine().getName()); cmd.getVirtualMachine().getGpuDevice().setGroupDetails(getGPUGroupDetails(conn));
final GPUDeviceTO gpuDevice = vmSpec.getGpuDevice(); if (gpuDevice != null) { s_logger.debug("Creating VGPU for of VGPU type: " + gpuDevice.getVgpuType() + " in GPU group " + gpuDevice.getGpuGroup() + " for VM " + vmName); citrixResourceBase.createVGPU(conn, command, vm, gpuDevice);
final GPUDeviceTO gpuDevice = stop.getGpuDevice(); if (gpuDevice != null) { _resourceMgr.updateGPUDetails(vm.getHostId(), gpuDevice.getGroupDetails());
_resourceMgr.updateGPUDetails(vm.getHostId(), gpuDevice.getGroupDetails());
command.setGpuDevice(new GPUDeviceTO(null, null, groupDetails));
_resourceMgr.updateGPUDetails(destHostId, gpuDevice.getGroupDetails());