CLOUDSTACK-8829 : Consecutive cold migration fails - #797
Conversation
|
cloudstack-pull-rats #561 SUCCESS |
|
cloudstack-pull-analysis #496 FAILURE |
| Long srcClusterId = null; | ||
| Long srcHostId = vm.getHostId() != null ? vm.getHostId() : vm.getLastHostId(); | ||
| if (srcHostId != null) { | ||
| HostVO srcHost = _hostDao.findById(srcHostId); |
There was a problem hiding this comment.
Hello @maneesha-p
I got a little confused by this if statement. Are you actually doing anything inside it? If Im not mistaken both variables are local inside this if-block and won't do anything outside it's scope, is this intended?
There was a problem hiding this comment.
@alexandrelimassantana I don't see any problem with that if (line 1778). Both variables (srcHostId and srcClusterId) are used.
The conditional at the line 1784 uses srcClusterId.
The method at line 1793 sends the UnregisterVMCommand to a given host with the srcHostId.
There was a problem hiding this comment.
@alexandrelimassantana 'srcHost' variable is local to the if-block but 'srcClusterId' variable that is populated inside the if-block is outside the scope of it and as @GabrielBrascher mentioned its being used in line 1784.
|
@maneesha-p please rebase against latest master and push -f, update on status of your PR |
ACS CI BVT RunSumarry: Link to logs Folder (search by build_no): https://www.dropbox.com/sh/yj3wnzbceo9uef2/AAB6u-Iap-xztdm6jHX9SjPja?dl=0 Failed tests: Skipped tests: Passed test suits: |
|
superceded by #2056; closing |
Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com> Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Issue - Consecutive VM cold migration fails.
Root Cause Analysis - In case of VMware, if VM is being cold migrated between clusters belonging to two different VMware DCs, Cloudstack unregisters the VM from the source host and cleans up the associated VM files. The check if a VM is being cold migrated across DCs is made using the source host id. In case of consecutive cold migrations since the source host id of a VM is NULL and no VM exists, Cloudstack should skip the check
Proposed Solution - Attempt to unregister a VM in another DC, only if there is a host associated with a VM.