Skip to content

Commit c7163df

Browse files
committed
fixup: gpu device capacity calculation
1 parent c0dafa6 commit c7163df

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

server/src/main/java/org/apache/cloudstack/gpu/GpuServiceImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,10 @@ public HashMap<String, HashMap<String, VgpuTypesInfo>> getGpuGroupDetailsFromGpu
832832
device.getManagedState())) {
833833
remainingCapacity = 1L;
834834
}
835-
if (device.getType().equals(GpuDevice.DeviceType.VGPUOnly) || GpuDevice.ManagedState.Unmanaged.equals(device.getManagedState())) {
835+
if (GpuDevice.DeviceType.VGPUOnly.equals(device.getType()) ||
836+
GpuDevice.ManagedState.Unmanaged.equals(device.getManagedState()) ||
837+
GpuDevice.State.Error.equals(device.getState())
838+
) {
836839
maxCapacity = 0L;
837840
remainingCapacity = 0L;
838841
}

ui/src/components/view/GPUSummaryTab.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export default {
227227
if (device.virtualmachineid) {
228228
summary.allocated++
229229
summary.uniqueVMs.add(device.virtualmachineid)
230-
} else if (device.managedstate !== 'Unmanaged') {
230+
} else if (device.managedstate !== 'Unmanaged' && device.state !== 'Error') {
231231
summary.available++
232232
}
233233
})

0 commit comments

Comments
 (0)