Uh oh!
There was an error while loading. Please reload this page.
Fix issue with Assign VM operation - #10845
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## 4.20 #10845 +/- ##
=========================================
Coverage 16.13% 16.14% - Complexity 13225 13228 +3
=========================================
Files 5652 5652 Lines 497021 497018 -3 Branches 60222 60222 =========================================
+ Hits 80202 80223 +21 + Misses 407885 407861 -24
Partials 8934 8934
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Pearl1594
commented
May 12, 2025
Thanks @winterhazel - would be great if you can help review this! :) |
…left behind in the DB should there be an exception
Pearl1594
commented
May 13, 2025
There are other issues I can see with this approach, because we delete the network in case of say an exception that occurs, the VM cannot then be expunged, as the network can't be found and the nics are updated to point to the new network. |
Pearl1594
commented
May 13, 2025
After testing multiple approaches and not reaching a desired result which the original PR (#7061) set out to achieve, I've reverted the bit that encloses |
winterhazel
commented
May 13, 2025
@Pearl1594 thanks for looking into the issue. I will have a look into it as well to see if I can come up with another approach, but I'm ok with reverting this bit if we do not find a better way to fix it. |
Pearl1594
commented
May 13, 2025
Sure @winterhazel - thanks! |
DaanHoogland
left a comment
There was a problem hiding this comment.
clgtm, need testing and maybe documentation of the limitations of the assign VM functionality/known issues
winterhazel
commented
May 14, 2025
@Pearl1594 I have submitted a potential (still work in progress) approach to https://github.com/winterhazel/cloudstack/tree/address-assignvm-regression. I have not completely tested it yet, but it seems to be working ok based on some simple tests. It fixes #10825, and does not revert the issue that #7061 fixed. This approach moves the creation of the network to outside the transaction, right before the updates start happening. This way, if an error happens while creating the network, nothing will have been updated yet. And, if an error happens while updating the virtual machine, the changes will be rolledback (we will have a dangling network at the moment, but we can adapt the code to delete it). What do you think? |
@winterhazel on briefly checking the code changes - I believe, it partly reverts what #7061 was set to achieve, but I am completely fine with it, thanks for looking into it. Once you are done with your testing and you see it not causing any major issues other than network component being left behind, then we can proceed with your approach. However, if you foresee any other (new) side-effects than what was originally seen, then we could proceed to just revert. So I'll wait for your PR and confirmation. |
Pearl1594
commented
May 14, 2025
@blueorangutan package |
blueorangutan
commented
May 14, 2025
@Pearl1594 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Pearl1594
commented
May 14, 2025
@winterhazel We're aiming to cut the rc by Friday. If the changes are extensive and need more time for thorough testing, would you be open to targeting them for the next release? |
blueorangutan
commented
May 14, 2025
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13378 |
Pearl1594
commented
May 14, 2025
@blueorangutan test |
blueorangutan
commented
May 14, 2025
@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
winterhazel
commented
May 14, 2025
@Pearl1594 I should be able to finish properly testing until friday, but I will notify if I find out that we need more time to test this approach. By the way, regarding:
It is not reverting what #7061 intended to fix. The original issue was the virtual machine being left in an inconsistent state when there was an error after the updates began (e.g. it would be left assigned to the new account, but still on the previous network). This does not happen anymore because all updates are still inside the transaction. |
DaanHoogland
commented
May 14, 2025
@winterhazel , will your PR be replacing this one are be an addition? |
winterhazel
commented
May 14, 2025
@DaanHoogland it will be replacing this one. |
blueorangutan
commented
May 15, 2025
[SF] Trillian test result (tid-13306)
|
Pearl1594
commented
May 15, 2025
@winterhazel can you please raise a PR atleast, so that we can have the CI simulator tests run and also smoke tests, so that we can have some results by tomorrow? |
weizhouapache
commented
May 16, 2025
@Pearl1594@winterhazel |
winterhazel
commented
May 16, 2025
@weizhouapache the approach in #10875 fixes #10825 without introducing back the bug #7061 intended to fix, so it should be the ideal solution. |
Pearl1594
commented
May 16, 2025
Closing this PR as #10875 address it. Thanks @winterhazel - sorry for the delay, I'm on leave. |
weizhouapache
commented
May 16, 2025
good, thanks both @Pearl1594@winterhazel |



Description
This PR fixes: #10825
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Test 1: Successful assignment of VM to another account in another domain
Test 2: Simulated exception after the network is created in the destination account/domain
Test 3: Simulated exception after after network creation logic, but here, we pass network id - so no new network is created
dom4-netHow did you try to break this feature and the system with this change?