mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Reword KVM snapshot without memory error message (#6387)
This commit is contained in:
parent
07cabb5890
commit
ea37d757d3
@ -17,6 +17,7 @@
|
||||
|
||||
package org.apache.cloudstack.api.command.user.vmsnapshot;
|
||||
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
|
||||
import org.apache.cloudstack.api.ACL;
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
@ -90,7 +91,13 @@ public class CreateVMSnapshotCmd extends BaseAsyncCreateCmd {
|
||||
|
||||
@Override
|
||||
public void create() throws ResourceAllocationException {
|
||||
VMSnapshot vmsnapshot = _vmSnapshotService.allocVMSnapshot(getVmId(), getDisplayName(), getDescription(), snapshotMemory());
|
||||
VMSnapshot vmsnapshot;
|
||||
try {
|
||||
vmsnapshot = _vmSnapshotService.allocVMSnapshot(getVmId(), getDisplayName(), getDescription(), snapshotMemory());
|
||||
} catch (CloudRuntimeException e) {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create vm snapshot: " + e.getMessage(), e);
|
||||
}
|
||||
|
||||
if (vmsnapshot != null) {
|
||||
setEntityId(vmsnapshot.getId());
|
||||
} else {
|
||||
|
||||
@ -384,7 +384,9 @@ public class VMSnapshotManagerImpl extends MutualExclusiveIdsManagerBase impleme
|
||||
VMSnapshotStrategy snapshotStrategy = storageStrategyFactory.getVmSnapshotStrategy(userVmVo.getId(), rootVolumePool.getId(), snapshotMemory);
|
||||
|
||||
if (snapshotStrategy == null) {
|
||||
throw new CloudRuntimeException("Could not find snapshot strategy for VM snapshot");
|
||||
String message = "KVM does not support the type of snapshot requested";
|
||||
s_logger.debug(message);
|
||||
throw new CloudRuntimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user