-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix issue with Assign VM operation #10845
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
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:
|
bc1fb82
to
277fee1
Compare
Thanks @winterhazel - would be great if you can help review this! :) |
…left behind in the DB should there be an exception
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. |
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 |
|
@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. |
Sure @winterhazel - thanks! |
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.
clgtm, need testing and maybe documentation of the limitations of the assign VM functionality/known issues
@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. |
@blueorangutan package |
@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. |
@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? |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13378 |
@blueorangutan test |
@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
@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. |
@winterhazel , will your PR be replacing this one are be an addition? |
@DaanHoogland it will be replacing this one. |
[SF] Trillian test result (tid-13306)
|
@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? |
@Pearl1594 @winterhazel |
@weizhouapache the approach in #10875 fixes #10825 without introducing back the bug #7061 intended to fix, so it should be the ideal solution. |
Closing this PR as #10875 address it. Thanks @winterhazel - sorry for the delay, I'm on leave. |
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-net
How did you try to break this feature and the system with this change?