-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NAS-128601 / 25.04 / Fixes the process to assign GPUs to VMs when creating or editing #10838
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #10838 +/- ##
==========================================
+ Coverage 81.55% 81.56% +0.01%
==========================================
Files 1579 1585 +6
Lines 54012 54136 +124
Branches 5792 5814 +22
==========================================
+ Hits 44050 44158 +108
- Misses 9962 9978 +16 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When testing on the machine in question, creating or editing a VM takes a lot of time to the point where I start to think that it's frozen. Please verify that we are calling endpoints correctly here.
@@ -8,9 +8,11 @@ import { MapOption, Option } from 'app/interfaces/option.interface'; | |||
* Convert choices to options | |||
* @returns Option[] | |||
*/ | |||
export function choicesToOptions(): OperatorFunction<Choices, Option[]> { | |||
export function choicesToOptions(reverseValueAndLabels = false): OperatorFunction<Choices, Option[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is obscure. It's better to create a new function for this local to vms module, like in GpuService.
switchMap(() => { | ||
return forkJoin([ | ||
this.vmGpuService.updateVmGpus(vm, gpusIds), | ||
this.gpuService.addIsolatedGpuPciIds(gpusIds), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you call system.advanced.update_gpu_pci_ids
and then you call addIsolatedGpuPciIds
which also calls the same endpoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Adding / removing gpus from a vm appears to be working correctly.
updateVmRequest$ = this.gpuService.getIsolatedGpuPciIds().pipe( | ||
take(1), | ||
switchMap((isolatedPciIds) => { | ||
const gpuPciIds = new Set([...isolatedPciIds, ...gpusIds]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like code inside of addIsolatedGpuPciIds
.
isLoading = false; | ||
timeOptions$ = of(mapToOptions(vmTimeNames, this.translate)); | ||
bootloaderOptions$ = this.ws.call('vm.bootloader_options').pipe(choicesToOptions()); | ||
cpuModeOptions$ = of(mapToOptions(vmCpuModeLabels, this.translate)); | ||
cpuModelOptions$ = this.ws.call('vm.cpu_model_choices').pipe(choicesToOptions()); | ||
gpuOptions$ = this.gpuService.getGpuOptions(); | ||
gpuOptions$ = this.ws.call('system.advanced.get_gpu_pci_choices').pipe( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getGpuOptions
in GpuService
is now unused and could hold this code.
JIRA ticket https://ixsystems.atlassian.net/browse/NAS-128601 is targeted to the following versions which have not received their corresponding PRs: 24.10.0 |
This PR has been merged and conversations have been locked. |
backport |
Changes:
Uses new API end points and filtering process to get the right data to be passed to the middleware endpoints
Testing:
Create a VM with one or more GPUs.
Edit a VM by removing GPUs and changing them.
Test on the system mentioned in the ticket comments.