-
Notifications
You must be signed in to change notification settings - Fork 59
✨ add CD-ROM controller support for VMSharedDisks #1261
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
base: main
Are you sure you want to change the base?
✨ add CD-ROM controller support for VMSharedDisks #1261
Conversation
c9c1149 to
209e396
Compare
209e396 to
fc2d256
Compare
fc2d256 to
17ddd0b
Compare
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.
Long PR, thanks for the work! My question is mainly around edge cases.
pkg/providers/vsphere/upgrade/virtualmachine/vm_schema_upgrade.go
Outdated
Show resolved
Hide resolved
3618af2 to
75bec62
Compare
| ) | ||
|
|
||
| const ( | ||
| // IDEControllerMaxSlotCount is the maximum number of slots |
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.
There is a review from https://github.com/vmware-tanzu/vm-operator/pull/1244/files#r2469798582. I will update this as well once the mentioned PR is merged to align with the change.
|
|
||
| ctrlMap, ctrlUsedUnitNumMap := buildControllerMaps(curDevices) | ||
|
|
||
| for bFileName, cdrom := range expectedCdromDevices { |
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.
The api says
// CD-ROM devices can be added, updated, or removed when the VM is powered
// off.
Now here we only handle add I think? Should we at least have a TODO for this?
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.
Previous thread mentioned edit https://github.com/vmware-tanzu/vm-operator/pull/1261/files#r2462256036. I think we are also missing delete
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.
They all handled it with the existing logic. We are not changing anything about how devices (CD-ROMs) are attached, but instead of adding a new device change for a new controller, we just update the vm.spec.hardware.controller.
And let the virtualmachine controller reconciler add the device change for adding a new controller.
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.
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.
Sorry, too dumb that I missed the && at the end and though that's an assignment.
Then just the edit is left over? Since we are not checking whether the current controller has corresponding busNumber/Type/slotNumber
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.
Thank you for the great catch! Just added support for "edit" the CD-ROM controller placement spec
|
Have you verified in a real env? |
75bec62 to
838ecf9
Compare
Not yet since changes are behind FSS. I am thinking about doing end-to-end testing once the majority of the PRs are in. |
e04bf60 to
95b0729
Compare
Add comprehensive CD-ROM controller management for the VMSharedDisks feature including: - CD-ROM controller auto-assignment and validation - Dynamic IDE/SATA controller creation when needed - Webhook mutation for controller spec assignment - Webhook validation for controller configuration - VM schema upgrade reconciliation for existing VMs - Support for CD-ROM placement changes when VM is powered off This enables proper CD-ROM device management when the VMSharedDisks capability is enabled, ensuring CD-ROMs are correctly assigned to available controller slots and new controllers are created as needed. When VMSharedDisks is enabled, the operator now supports changing CD-ROM placement (controller type, bus number, or unit number) when the VM is powered off. Placement changes are handled via a remove-and-add pattern, removing the CD-ROM with outdated placement and recreating it with the new controller assignment. Webhook validation prevents such changes when the VM is powered on.
95b0729 to
62901cd
Compare
Minimum allowed line rate is |
Add comprehensive CD-ROM controller management for the VMSharedDisks
feature including:
This enables proper CD-ROM device management when the VMSharedDisks
capability is enabled, ensuring CD-ROMs are correctly assigned to
available controller slots and new controllers are created as needed.
When VMSharedDisks is enabled, the operator now supports changing CD-ROM
placement (controller type, bus number, or unit number) when the VM is
powered off. Placement changes are handled via a remove-and-add pattern,
removing the CD-ROM with outdated placement and recreating it with the
new controller assignment. Webhook validation prevents such changes when
the VM is powered on.
Which issue(s) is/are addressed by this PR? (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes # N/A
Are there any special notes for your reviewer:
#1241 needs to be merged first.
Please add a release note if necessary: