bug 11919: if volume is dettached, instance id is null

status 11919: resolved fixed
Reviewed-by: frank
This commit is contained in:
Edison Su 2011-11-09 10:32:48 -08:00
parent a6d90ca1fd
commit 44218ef07c
1 changed files with 5 additions and 5 deletions

View File

@ -1369,16 +1369,16 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
}
}
UserVmVO vm = _vmDao.findById(volume.getInstanceId());
if (vm.getHypervisorType() == HypervisorType.Ovm) {
throw new InvalidParameterValueException("Ovm won't support taking snapshot");
}
StoragePoolVO storagePoolVO = _storagePoolDao.findById(volume.getPoolId());
if (storagePoolVO == null) {
throw new InvalidParameterValueException("VolumeId: " + volumeId + " please attach this volume to a VM before create snapshot for it");
}
ClusterVO cluster = _clusterDao.findById(storagePoolVO.getClusterId());
if (cluster != null && cluster.getHypervisorType() == HypervisorType.Ovm) {
throw new InvalidParameterValueException("Ovm won't support taking snapshot");
}
// Verify permissions
_accountMgr.checkAccess(caller, null, volume);