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 <rohit.yadav@shapeblue.com>
This commit is contained in:
Likitha Shetty 2014-11-05 14:51:10 +05:30 committed by Rohit Yadav
parent 272f282a05
commit 294f5bf331

View File

@ -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());
}
}
}
}