Commit d5e5b48
Ranier Amorim
fix: skip VMs with host passthrough during DRS plan generation
When iterating over VMs in getBestMigration, the call to
listHostsForMigrationOfVM throws InvalidParameterValueException
for VMs using a vGPU passthrough profile. This exception was not
caught inside the loop, causing it to propagate up and abort the
entire DRS plan generation for the cluster, leaving all other
eligible VMs without a migration plan.
Fix wraps the listHostsForMigrationOfVM call in a try-catch block.
When the exception is caught, the VM is skipped with a debug log
message and the loop continues evaluating the remaining VMs.
Also adds unit test testGetBestMigrationSkipsPassthroughVm to verify
that a VM throwing InvalidParameterValueException is skipped while
other eligible VMs are still considered for migration.
Fixes: #130981 parent f9513b4 commit d5e5b48
2 files changed
Lines changed: 52 additions & 3 deletions
File tree
- server/src
- main/java/org/apache/cloudstack/cluster
- test/java/org/apache/cloudstack/cluster
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
452 | | - | |
453 | | - | |
454 | | - | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
455 | 461 | | |
456 | 462 | | |
457 | 463 | | |
| |||
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
407 | 450 | | |
408 | 451 | | |
409 | 452 | | |
| |||
0 commit comments