diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVGpuDevices/index.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVGpuDevices/index.vue index d34ce4a765f..5c99657b6a6 100644 --- a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVGpuDevices/index.vue +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVGpuDevices/index.vue @@ -46,10 +46,13 @@ export default { this[key] = res[key]; } - uniq([ + const vGpus = this.vm.isOff ? [ ...(this.value?.domain?.devices?.gpus || []).map(({ name }) => name), + ] : [ ...Object.values(this.vm?.provisionedVGpus).reduce((acc, gpus) => [...acc, ...gpus], []) - ]).forEach((name) => { + ]; + + uniq(vGpus).forEach((name) => { if (this.enabledDevices.find(device => device?.metadata?.name === name)) { this.selectedDevices.push(name); }