mirror of https://github.com/apache/cloudstack.git
bug 8525: we can't create template from snapshots belonging to one volume at the same time
status 8525: resolved fixed
This commit is contained in:
parent
eb7d531456
commit
893f8b5f73
|
|
@ -1414,9 +1414,15 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
// This can be sent to a KVM host too.
|
||||
StoragePool pool = _storagePoolDao.findById(volume.getPoolId());
|
||||
CreatePrivateTemplateAnswer answer = null;
|
||||
volume = _volsDao.acquireInLockTable(volumeId, 10);
|
||||
if( volume == null ) {
|
||||
throw new CloudRuntimeException("Creating template failed due to volume:" + volumeId + " is being used, try it later ");
|
||||
}
|
||||
try {
|
||||
answer = (CreatePrivateTemplateAnswer)_storageMgr.sendToPool(pool, cmd);
|
||||
} catch (StorageUnavailableException e) {
|
||||
} finally {
|
||||
_volsDao.releaseFromLockTable(volumeId);
|
||||
}
|
||||
|
||||
if ((answer != null) && answer.getResult()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue