From 294f5bf331429c61b10cd426c111e39dd7619b9d Mon Sep 17 00:00:00 2001 From: Likitha Shetty Date: Wed, 5 Nov 2014 14:51:10 +0530 Subject: [PATCH] CLOUDSTACK-8114. Ensure VM stop and then start updates the volume path correctly in the DB. (cherry picked from commit 521258bafb91e30d7bd43fba62cc47a77c078028) Signed-off-by: Rohit Yadav --- .../src/com/cloud/vm/VirtualMachineManagerImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index eed0963449e..8b8c83b14a7 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -1201,7 +1201,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()); + } } } }