CLOUDSTACK-7265: For LXC volumes, show unsupported operation error for volume snapshot

This commit is contained in:
Kishan Kavala 2014-10-23 20:13:56 +05:30
parent d6fdb7c6bc
commit 99010f463b
1 changed files with 4 additions and 0 deletions

View File

@ -1954,6 +1954,10 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
throw new InvalidParameterValueException("VolumeId: " + volumeId + " is not in " + Volume.State.Ready + " state but " + volume.getState() + ". Cannot take snapshot.");
}
if (ImageFormat.DIR.equals(volume.getFormat())){
throw new InvalidParameterValueException("Snapshot not supported for volume:" + volumeId);
}
if (volume.getTemplateId() != null) {
VMTemplateVO template = _templateDao.findById(volume.getTemplateId());
if (template != null && template.getTemplateType() == Storage.TemplateType.SYSTEM) {