File tree Expand file tree Collapse file tree
engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot
plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,7 +214,8 @@ public SnapshotResult takeSnapshot(SnapshotInfo snap) {
214214 try {
215215 result = future .get ();
216216 if (result .isFailed ()) {
217- s_logger .debug ("Failed to create snapshot:" + result .getResult ());
217+ snapshot .processEvent (Snapshot .Event .OperationFailed );
218+ snapshot .processEvent (Event .OperationFailed );
218219 throw new CloudRuntimeException (result .getResult ());
219220 }
220221 return result ;
@@ -224,8 +225,10 @@ public SnapshotResult takeSnapshot(SnapshotInfo snap) {
224225 } catch (ExecutionException e ) {
225226 s_logger .debug ("Failed to create snapshot" , e );
226227 throw new CloudRuntimeException ("Failed to create snapshot" , e );
228+ } catch (NoTransitionException e ) {
229+ s_logger .debug ("Failed to create snapshot" , e );
230+ throw new CloudRuntimeException ("Failed to create snapshot" , e );
227231 }
228-
229232 }
230233
231234 // if a snapshot has parent snapshot, the new snapshot should be stored in
Original file line number Diff line number Diff line change @@ -352,8 +352,11 @@ public Answer copyVolumeFromImageCacheToPrimary(CopyCommand cmd) {
352352 secondaryStoragePool = storagePoolMgr .getStoragePoolByURI (
353353 secondaryStorageUrl + File .separator + volumeDir
354354 );
355+ if (!srcVolumeName .endsWith (".qcow2" )) {
356+ srcVolumeName = srcVolumeName + ".qcow2" ;
357+ }
355358 KVMPhysicalDisk volume = secondaryStoragePool
356- .getPhysicalDisk (srcVolumeName + ".qcow2" );
359+ .getPhysicalDisk (srcVolumeName );
357360 storagePoolMgr .copyPhysicalDisk (volume , volumeName ,
358361 primaryPool );
359362 VolumeObjectTO newVol = new VolumeObjectTO ();
@@ -414,7 +417,7 @@ public Answer copyVolumeFromPrimaryToSecondary(CopyCommand cmd) {
414417 storagePoolMgr .copyPhysicalDisk (volume ,
415418 destVolumeName ,secondaryStoragePool );
416419 VolumeObjectTO newVol = new VolumeObjectTO ();
417- newVol .setPath (destVolumePath + File .separator + volumeName );
420+ newVol .setPath (destVolumePath + File .separator + destVolumeName );
418421 return new CopyCmdAnswer (newVol );
419422 } catch (CloudRuntimeException e ) {
420423 return new CopyCmdAnswer (e .toString ());
You can’t perform that action at this time.
0 commit comments