CLOUDSTACK-8114. Ensure VM stop and then start updates the volume path correctly in the DB.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/521258ba Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/521258ba Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/521258ba Branch: refs/heads/reporter Commit: 521258bafb91e30d7bd43fba62cc47a77c078028 Parents: ceae978 Author: Likitha Shetty <[email protected]> Authored: Wed Nov 5 14:51:10 2014 +0530 Committer: Likitha Shetty <[email protected]> Committed: Wed Dec 24 09:56:06 2014 +0530 ---------------------------------------------------------------------- .../src/com/cloud/vm/VirtualMachineManagerImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/521258ba/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 07b2277..be5ea63 100644 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -1207,7 +1207,11 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac // Use getPath() from VolumeVO to get a fresh copy of what's in the DB. // Before doing this, in a certain situation, getPath() from VolumeObjectTO // returned null instead of an actual path (because it was out of date with the DB). - volumeMgr.updateVolumeDiskChain(vol.getId(), volume.getPath(), vol.getChainInfo()); + if(vol.getPath() != null) { + volumeMgr.updateVolumeDiskChain(vol.getId(), vol.getPath(), vol.getChainInfo()); + } else { + volumeMgr.updateVolumeDiskChain(vol.getId(), volume.getPath(), vol.getChainInfo()); + } } } }
