You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by re...@apache.org on 2015/10/28 11:57:05 UTC

[1/2] git commit: updated refs/heads/master to f8e40ad

Repository: cloudstack
Updated Branches:
  refs/heads/master d538e438e -> f8e40ad43


CLOUDSTACK-8941: fix NPE when migrate vm to other zone-wide pools the second time


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1efcc19d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1efcc19d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1efcc19d

Branch: refs/heads/master
Commit: 1efcc19dbd0e609733f93089ce5cb2a5be84209b
Parents: f241455
Author: Wei Zhou <w....@tech.leaseweb.com>
Authored: Fri Oct 9 13:20:41 2015 +0200
Committer: Wei Zhou <w....@tech.leaseweb.com>
Committed: Mon Oct 26 07:29:59 2015 +0100

----------------------------------------------------------------------
 .../src/com/cloud/vm/VirtualMachineManagerImpl.java            | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1efcc19d/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index 9dea90a..f972539 100644
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -1748,6 +1748,10 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
         final HostVO srcHost = _hostDao.findById(srchostId);
         final Long srcClusterId = srcHost.getClusterId();
 
+        if (destPool == null) {
+            throw new CloudRuntimeException("Unable to migrate vm: missing destination storage pool");
+        }
+
         try {
             stateTransitTo(vm, VirtualMachine.Event.StorageMigrationRequested, null);
         } catch (final NoTransitionException e) {
@@ -1763,7 +1767,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
             if (migrationResult) {
                 //if the vm is migrated to different pod in basic mode, need to reallocate ip
 
-                if (!vm.getPodIdToDeployIn().equals(destPool.getPodId())) {
+                if (destPool.getPodId() != null && !destPool.getPodId().equals(vm.getPodIdToDeployIn())) {
                     final DataCenterDeployment plan = new DataCenterDeployment(vm.getDataCenterId(), destPool.getPodId(), null, null, null, null);
                     final VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vm, null, null, null, null);
                     _networkMgr.reallocate(vmProfile, plan);


[2/2] git commit: updated refs/heads/master to f8e40ad

Posted by re...@apache.org.
Merge pull request #918 from ustcweizhou/NPE-storage-migration

CLOUDSTACK-8941: fix NPE when migrate vm to other zone-wide pools the second timeThis is because the pod_id is set to NULL at the first time when I migrate the instance to a zone-wide pool (not cluster-wide).

* pr/918:
  CLOUDSTACK-8941: fix NPE when migrate vm to other zone-wide pools the second time

Signed-off-by: Remi Bergsma <gi...@remi.nl>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f8e40ad4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f8e40ad4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f8e40ad4

Branch: refs/heads/master
Commit: f8e40ad43ffd6ead9cf764426c1684bf3b679367
Parents: d538e43 1efcc19
Author: Remi Bergsma <gi...@remi.nl>
Authored: Wed Oct 28 11:56:22 2015 +0100
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Wed Oct 28 11:56:22 2015 +0100

----------------------------------------------------------------------
 .../src/com/cloud/vm/VirtualMachineManagerImpl.java            | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------