Github user GabrielBrascher commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/797#discussion_r53559299 --- Diff: engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java --- @@ -1776,19 +1773,26 @@ private void orchestrateStorageMigration(final String vmUuid, final StoragePool // If VM was cold migrated between clusters belonging to two different VMware DCs, // unregister the VM from the source host and cleanup the associated VM files. if (vm.getHypervisorType().equals(HypervisorType.VMware)) { + Long srcClusterId = null; + Long srcHostId = vm.getHostId() != null ? vm.getHostId() : vm.getLastHostId(); + if (srcHostId != null) { + HostVO srcHost = _hostDao.findById(srcHostId); --- End diff -- @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**.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---