bhouse-nexthop opened a new pull request, #14637: URL: https://github.com/apache/cloudstack/pull/14637
### Description Since #13101 (multiple CD-ROMs per VM), `attachIso` on main refuses an ISO that is already attached, and any ISO beyond the number of CD-ROMs, one by default. `KubernetesClusterActionWorker.attachIsoKubernetesVMs` relied on the attach replacing whatever ISO a node had. So a node left holding the binaries ISO by an operation that didn't finish, for example because the management server stopped, made every later upgrade, scale-up or start fail before it started, with "The specified ISO is already attached to this Instance." Fixes #14630 For each node, `attachIsoKubernetesVMs` now reads the VM again and: - leaves the binaries ISO in place if it is already attached, in the primary CD-ROM or in another one; - otherwise detaches the ISO in the primary CD-ROM, if any, before attaching the binaries ISO, as the attach used to replace it. 4.22 is not affected, so this is for main only. ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [x] Bug fix (non-breaking change which fixes an issue) - [ ] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) - [ ] Build/CI - [x] Test (unit or integration test code) ### Feature/Enhancement Scale or Bug Severity #### Bug Severity - [ ] BLOCKER - [ ] Critical - [x] Major - [ ] Minor - [ ] Trivial ### How Has This Been Tested? New unit tests in `KubernetesClusterActionWorkerIsoTest`: - a node with no ISO gets the binaries ISO attached, and nothing is detached; - a node that already has the binaries ISO, in the primary CD-ROM or in another one, is left as it is; - a node with another ISO has it detached, then the binaries ISO attached. Without the fix, the last three fail. `mvn -pl plugins/integrations/kubernetes-service -am test -Dtest='KubernetesClusterActionWorker*Test'` passes. On a test environment running main, an upgrade failed as described in #14630 while both nodes still held the binaries ISO, and ran once the ISO was detached from both by hand. This PR itself has not been run against a live cluster. #### How did you try to break this feature and the system with this change? - A node with no ISO takes the same path as before. - If the detach fails, the operation fails as an attach failure did before. - If the attach fails after the detach, the node is left with no ISO, and the operation fails as before. - `detachIsoKubernetesVMs` is unchanged. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
