-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Prevents null pointers when doing consecutive VM migrates #4282
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
Prevents null pointers when doing consecutive VM migrates #4282
Conversation
|
@blueorangutan package |
|
@RodrigoDLopez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-1813 |
|
@blueorangutan test centos7 vmware-67u3 |
|
@shwstppr a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests |
|
Trillian test result (tid-2576)
|
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✖centos7 ✖centos8 ✖debian. JID-1905 |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✖centos8 ✖debian. JID-1945 |
|
@blueorangutan package |
|
@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2045 |
|
@blueorangutan test matrix |
DaanHoogland
left a comment
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.
changes look good, starting tests on assorted platforms as I'm not sure this matters
|
@DaanHoogland a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware67, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests |
|
Trillian test result (tid-2818)
|
engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
Outdated
Show resolved
Hide resolved
|
@RodrigoDLopez I tried migrating same vm like 10 times between 5 hypervisors and never got any NPE. Also the |
|
Hi, @ravening can you report the methodology you used?
If you take a look at the code, a null pointer will for sure happen. Just look at the lines I am changing. Before this PR, the first migration will have cloudstack/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java Lines 2282 to 2283 in d657ef7
Furthermore, some of these parameters were never used for some hypervisors, seems like VMWare needs it, that is why I moved it where they will be used, and did the necessary validations providing information about the process with an appropriate log message |
@RodrigoDLopez im using ACS 4.14 I doing regular VM migration of running VM between multiple hosts. I didn't do migration with storage. Also I'm doing migration on KVM host and not VMware |
|
Hi @ravening, that was my fault.
with these steps, after the first migrate |
@RodrigoDLopez ah ok... So you are just doing volume migration of VM...I will try these steps and let you know the result |
|
@rhtyd, @Ravenin, @DaanHoogland Hello guys, happy new year. Is there something missing here? Everything seems to be ok with the patch. It is a good bug fix, it has no errors, and tests are passing |
|
@ravening @rhtyd @harikrishna-patnala @nvazquez Hello everyone, this PR fixes a bug and is a simple change. |
Will review and test it this week |
nvazquez
left a comment
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.
Looks good, I've left a few comments
engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
Show resolved
Hide resolved
engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
Outdated
Show resolved
Hide resolved
|
@RodrigoDLopez do you want this on latest or on one of the release branches (4.14 or 4.15)? |
I will make this changes. Thanks for the hint |
For me, it's fine to be merged just on the master, since it's a nonreported bug. But if you wanna I can do the necessary changes to merge this fix on 4.14 as well @nvazquez @ravening @rhtyd @harikrishna-patnala |
|
@RodrigoDLopez can you fix the conflict? |
|
I just reproduced this very issue, this PR would be nice to have (4.15.2+, I think hat for 4.15.1 it is not feasible). |
|
I'm okay to get it in 4.15.1 if it's fixing the NPE. cc @shwstppr @Pearl1594 |
|
@GabrielBrascher were you able to reproduce this with 4.15.1 RC? |
|
@rhtyd we got it on a 4.15.0.0, but it seems that the codebase at 4.15.1.0 RC1 did not change at that point. Steps to reproduce: Stack trace: When checking the stack trace + DB it is possible to detect that the issue is indeed caused by the fact of last |
|
@GabrielBrascher I've not tested yet and will try it tomorrow but I feel there has been a change in code that would prevent NPE that you shared, |
|
@RodrigoDLopez can you address the conflict? |
|
@shwstppr thanks for bringing those changes, I might have tested with 4.15.0.0 then instead of RC1. I will take another look at it. |
fdf5f9b to
f22c5a9
Compare
|
@rhtyd @RodrigoDLopez @shwstppr @DaanHoogland I have been running some tests on RC2 and I was not able to reproduce this issue with 4.15.1.0 RC2. This one looks to be fixed. |
|
Thanks for testing @GabrielBrascher, @RodrigoDLopez can you test 4.15.1.0 RC2? |
|
not needed anymore... |
|
@RodrigoDLopez why is this one not needed anymore? Was it addressed somewhere else? |
Description
If a VM gets consecutive migrations, a null pointer exception is thrown because these VMs do not have
host_idorlast_host_id; ACS clears these fields when the first migration is over.With that in mind, this PR prevents the respective null pointer. Additionally, it logs the right context and gives some information to the operator.
Types of changes
Screenshots (if appropriate):
How Has This Been Tested?
To test this, I used the
cloudmonkeyto requestmigrateVirtualMachinecommands