diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java index e00dd5de4d0..188915b8125 100755 --- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java +++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java @@ -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);