Fix npe when migrating vm with volume#4698
Conversation
|
@GutoVeronezi which hypervisor this NPE was seen because I didn't face it on VMware. @blueorangutan package |
|
@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2728 |
|
@abhinandanprateek this happens on KVM. I would like to highlight one thing here. The contributor is willing to send the changes/patch to master. We (as the ACS community) can never force the contributor to do anything he/she does not want (and that is not a technical part of the contribution). We can review the code and ask for improvement/changes; we can try to convince the contributor to send the code to an already release version, but we can not say "it is a bug fix, so send it to x.y.z" (this sounds like an order). However, as the name says, it is a contribution. Therefore, it is non-paid work dedicated to ACS that somebody is providing (unless you somehow are providing this contribution by supporting the contributor). I have seen this happening in other PRs, and as a member of the PMC I would like to highlight that this is not part of the Apache Way. If somebody/some company in the community liked the changes and would like to see it in a specific branch, they can cherry-pick/back-port from master to the version branch they want. Please, it is nothing personal or anything. It is just something I noticed, and that we (as a community) should pay attention to. |
2e4d07a to
a6d37b3
Compare
DaanHoogland
left a comment
There was a problem hiding this comment.
clgtm. I also like the logging even though (in some of these cases) if(LOGGER.isDebugEnabled) would make the code more readible!
Pearl1594
left a comment
There was a problem hiding this comment.
Verified behavior. LGTM
Cherry-pick commit 59fba49 and fix conflict.
Cherry-pick commit 59fba49 and fix conflict. Co-authored-by: Daniel Augusto Veronezi Salvador <38945620+GutoVeronezi@users.noreply.github.com>
Description
In the execution flow of the API
migrateVirtualMachineWithVolume, there is a step that copies the volume's template to the target storage, if it is needed.In some cases when the volume is a
datatype, it (the volume) does not have a template; therefore, it is going to generate an NPE when it tries to get the template's ID (Long to long auto conversion).This PR intends to validate if the volume being copied has a template, before trying to copy the template.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
How Has This Been Tested?
It has been tested locally in a test lab.
hostand the volumes to differentstorageto see if it migrates accordingly.