CLOUDSTACK-2276: NPE while attaching the volume to the instance which is created from ROOT Disk Snapshot

The NPE comes as the storage pool id is set to null in the in-memory volume object which is not in sync with the db. entry. Reloading the volume from db. fixes the issue
This commit is contained in:
Koushik Das 2013-05-30 17:20:44 +05:30
parent 3115ddf007
commit fd79f6b602

View File

@ -1725,6 +1725,8 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
}
}
// reload the volume from db
volumeOnPrimaryStorage = volFactory.getVolume(volumeOnPrimaryStorage.getId());
boolean moveVolumeNeeded = needMoveVolume(rootVolumeOfVm, volumeOnPrimaryStorage);
if (moveVolumeNeeded) {