Update selected vGpus devices adding the provisioned devices

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
Francesco Torchia
2024-10-23 17:01:33 +02:00
parent fa545ad134
commit 8117e99b54
3 changed files with 17 additions and 2 deletions
@@ -1098,6 +1098,16 @@ export default class VirtVm extends HarvesterResource {
return this.spec?.template?.spec?.domain?.devices?.hostDevices || [];
}
get provisionedVGpus() {
try {
const deviceAllocationDetails = JSON.parse(this.metadata?.annotations[HCI_ANNOTATIONS.VM_DEVICE_ALLOCATION_DETAILS] || '{}');
return deviceAllocationDetails?.gpus || {};
} catch (error) {
return {};
}
}
setInstanceLabels(val) {
if ( !this.spec?.template?.metadata?.labels ) {
set(this, 'spec.template.metadata.labels', {});