-
Notifications
You must be signed in to change notification settings - Fork 454
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
fix: reconfigure vm with multiple pci passthrough devices #2236
Conversation
Signed-off-by: Stoyan Zhelyazkov <[email protected]>
Signed-off-by: Stoyan Zhelyazkov <[email protected]>
Is there an issue that can track the need to refactor this area? |
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.
LGTM - nice detective work! 🕵️ 🔍
good idea, I just logged one |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
Usually when we reconfigure VMs we set negative integers as keys for new devices. vCenter assigns actual keys after the reconfiguration task completes which we then read and reassign to our resource.
This was not the case with PCI passthrough devices. No key was being assigned which meant that every such device got a zero as its key (the default integer value). This is fine if you're adding a single device but if you try with more than one the API fails.
The fix is simple - we simply need to assign a unique negative integer as the device key just like we do for other device types.
Acceptance tests
I had to manually test this one since it requires dedicated devices on the underlying hardware.
There is an important disclaimer to be made here - adding PCI passthrough devices during VM creation does not work. It is does not work out of the box and this is not related to this change.
I am not making an attempt to resolve this problem with this PR as it requires a significant refactoring effort.
Release Note
resource/virtual_machine
: Fixed virtual machine reconfiguration with multiple PCI passthrough devices.References
Closes #1688