Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Let CloudRuntimeException propagate from copySnapshotToVolume
Remove try/catch in copySnapshotToVolume so that CloudRuntimeException
from createResourceFromSnapshot propagates to the caller, ensuring
CloudStack properly notices and reports the failure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
  • Loading branch information
Kukunin and claude committed Apr 21, 2026
commit c70dee1ff552e183c49f9134273f5dfd88589236
Original file line number Diff line number Diff line change
Expand Up @@ -778,24 +778,15 @@ public boolean canCopy(DataObject srcData, DataObject dstData)
}

private CopyCommandResult copySnapshotToVolume(SnapshotInfo snapshotInfo, VolumeInfo volumeInfo) {
String errMsg = null;
CopyCmdAnswer answer = null;
try {
StoragePoolVO storagePoolVO = _storagePoolDao.findById(snapshotInfo.getDataStore().getId());
String rscName = LinstorUtil.RSC_PREFIX + volumeInfo.getUuid();
createResourceFromSnapshot(snapshotInfo.getId(), rscName, storagePoolVO);

VolumeObjectTO volumeTO = (VolumeObjectTO) volumeInfo.getTO();
volumeTO.setPath(volumeInfo.getUuid());
volumeTO.setSize(volumeInfo.getSize());
answer = new CopyCmdAnswer(volumeTO);
} catch (Exception e) {
errMsg = "Failed to create volume from snapshot: " + e.getMessage();
logger.error(errMsg, e);
}
CopyCommandResult result = new CopyCommandResult(null, answer);
result.setResult(errMsg);
return result;
StoragePoolVO storagePoolVO = _storagePoolDao.findById(snapshotInfo.getDataStore().getId());
String rscName = LinstorUtil.RSC_PREFIX + volumeInfo.getUuid();
createResourceFromSnapshot(snapshotInfo.getId(), rscName, storagePoolVO);

VolumeObjectTO volumeTO = (VolumeObjectTO) volumeInfo.getTO();
volumeTO.setPath(volumeInfo.getUuid());
volumeTO.setSize(volumeInfo.getSize());

return new CopyCommandResult(null, new CopyCmdAnswer(volumeTO));
}

@Override
Expand Down
Loading