vmware: fix migrate vm with volume#5170
vmware: fix migrate vm with volume#5170yadvr merged 3 commits intoapache:mainapache/cloudstack:mainfrom shapeblue:fix-vmw-relocateexceptionshapeblue/cloudstack:fix-vmw-relocateexceptionCopy head branch name to clipboard
Conversation
Recent forward merge of 4.15 branch accidentally brought a bug in VM relocation method for VMware while trying to find datastore for the migrated volume. This PR fixes it by using either of available target or source host. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
| newVol.setDataStoreUuid(entry.second().getUuid()); | ||
| String newPath = vmMo.getVmdkFileBaseName(disk); | ||
| ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(targetHyperHost, entry.second().getUuid()); | ||
| ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(targetHyperHost != null ? targetHyperHost : sourceHyperHost, entry.second().getUuid()); |
There was a problem hiding this comment.
@shwstppr might sourceHyperHost be null as well ?
There was a problem hiding this comment.
@weizhouapache Method gets sourceHyperHost either from caller or the host which is processing the command,
https://github.com/apache/cloudstack/pull/5170/files#diff-77635c5f7eb9cef514aaf69e2fdc9217619afc9005bf8db9585c176e7401a88bR7329-R7331
Cannot be null if the command is being processed
There was a problem hiding this comment.
@shwstppr great, thanks.
no idea if it breaks some features. at least the NPE is fixed by this pr.
There was a problem hiding this comment.
Above ^^ is my understanding. Let me know if there should be additional checks @weizhouapache
There was a problem hiding this comment.
Change was originally introduced here, d2ab350
There was a problem hiding this comment.
@shwstppr if the origin is a merge commit than this should be fixed on the older branch and merged forward.
|
@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. SL-JID 432 |
|
@blueorangutan test centos7 vmware-65u2 |
|
@weizhouapache a Trillian-Jenkins test job (centos7 mgmt + vmware-65u2) has been kicked to run smoke tests |
DaanHoogland
left a comment
There was a problem hiding this comment.
clgtm but please change base branch to 4.15
| newVol.setDataStoreUuid(entry.second().getUuid()); | ||
| String newPath = vmMo.getVmdkFileBaseName(disk); | ||
| ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(targetHyperHost, entry.second().getUuid()); | ||
| ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(targetHyperHost != null ? targetHyperHost : sourceHyperHost, entry.second().getUuid()); |
There was a problem hiding this comment.
@shwstppr if the origin is a merge commit than this should be fixed on the older branch and merged forward.
|
@DaanHoogland 4.15 has a different code. Change that resulted in error was added in d2ab350 to probably address merge conflicts cc @nvazquez |
|
@nvazquez no, I don't think anything was missed. Just that line of code that finds datastore for the migrated volume needed small change as And since the |
|
@blueorangutan test centos7 vmware-65u2 |
|
@shwstppr a Trillian-Jenkins test job (centos7 mgmt + vmware-65u2) has been kicked to run smoke tests |
|
Trillian test result (tid-1185)
|
|
Packaging result: ✔️ centos7 ✔️ centos8 ✔️ debian. SL-JID 455 |
|
Though migration tests from test_vm_lifecycle.py seem to be running fine, re-running tests to verify intermittent failures @blueorangutan test centos7 vmware-65u2 |
|
@shwstppr a Trillian-Jenkins test job (centos7 mgmt + vmware-65u2) has been kicked to run smoke tests |
|
@blueorangutan test centos7 vmware-65u2 |
|
@shwstppr a Trillian-Jenkins test job (centos7 mgmt + vmware-65u2) has been kicked to run smoke tests |
|
Trillian test result (tid-1198)
|
...ns/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
Show resolved
Hide resolved
...ns/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
Outdated
Show resolved
Hide resolved
...ns/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
Outdated
Show resolved
Hide resolved
…vmware/resource/VmwareResource.java Co-authored-by: Daniel Augusto Veronezi Salvador <38945620+GutoVeronezi@users.noreply.github.com>
|
@blueorangutan package |
|
@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 476 |
|
@blueorangutan test centos7 vmware-65u2 |
|
@shwstppr a Trillian-Jenkins test job (centos7 mgmt + vmware-65u2) has been kicked to run smoke tests |
|
Trillian test result (tid-1206)
|
weizhouapache
left a comment
There was a problem hiding this comment.
code lgtm
(did not look through the code changes in debug messages).
Description
Recent forward merge of 4.15 branch accidentally brought a bug in VM relocation method for VMware while trying to find datastore for the migrated volume.
This PR fixes it by using either of available target or source host.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?