Skip to content

Commit 44218ef

Browse files
Edison SuEdison Su
authored andcommitted
bug 11919: if volume is dettached, instance id is null
status 11919: resolved fixed Reviewed-by: frank
1 parent a6d90ca commit 44218ef

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,16 +1369,16 @@ public SnapshotVO allocSnapshot(Long volumeId, Long policyId) throws ResourceAll
13691369
}
13701370
}
13711371

1372-
UserVmVO vm = _vmDao.findById(volume.getInstanceId());
1373-
if (vm.getHypervisorType() == HypervisorType.Ovm) {
1374-
throw new InvalidParameterValueException("Ovm won't support taking snapshot");
1375-
}
1376-
13771372
StoragePoolVO storagePoolVO = _storagePoolDao.findById(volume.getPoolId());
13781373
if (storagePoolVO == null) {
13791374
throw new InvalidParameterValueException("VolumeId: " + volumeId + " please attach this volume to a VM before create snapshot for it");
13801375
}
13811376

1377+
ClusterVO cluster = _clusterDao.findById(storagePoolVO.getClusterId());
1378+
if (cluster != null && cluster.getHypervisorType() == HypervisorType.Ovm) {
1379+
throw new InvalidParameterValueException("Ovm won't support taking snapshot");
1380+
}
1381+
13821382
// Verify permissions
13831383
_accountMgr.checkAccess(caller, null, volume);
13841384

0 commit comments

Comments
 (0)