diff --git a/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackImageStoreDriverImpl.java b/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackImageStoreDriverImpl.java index 277cbf9f276..8e1511c0b9e 100644 --- a/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackImageStoreDriverImpl.java +++ b/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackImageStoreDriverImpl.java @@ -335,12 +335,12 @@ public class CloudStackImageStoreDriverImpl implements ImageStoreDriver { } try { - String secondaryStoragePoolUrl = secStore.getUri(); + /*String secondaryStoragePoolUrl = secStore.getUri(); Long dcId = snapshot.getDataCenterId(); Long accountId = snapshot.getAccountId(); Long volumeId = snapshot.getVolumeId(); - String backupOfSnapshot = snapshotObj.getBackupSnapshotId(); + String backupOfSnapshot = snapshotObj; if (backupOfSnapshot == null) { callback.complete(result); return; @@ -357,7 +357,7 @@ public class CloudStackImageStoreDriverImpl implements ImageStoreDriver { snapshotDao.update(snapshotObj.getId(), snapshot); } else if (answer != null) { result.setResult(answer.getDetails()); - } + }*/ } catch (Exception e) { s_logger.debug("failed to delete snapshot: " + snapshotObj.getId() + ": " + e.toString()); result.setResult(e.toString()); diff --git a/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java b/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java index f3aefe06a0d..384e7f010e3 100644 --- a/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java +++ b/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java @@ -298,7 +298,7 @@ public class S3ImageStoreDriverImpl implements ImageStoreDriver { Long accountId = snapshot.getAccountId(); Long volumeId = snapshot.getVolumeId(); - String backupOfSnapshot = snapshotObj.getBackupSnapshotId(); + String backupOfSnapshot = snapshotObj.getPath(); if (backupOfSnapshot == null) { callback.complete(result); return; @@ -310,10 +310,7 @@ public class S3ImageStoreDriverImpl implements ImageStoreDriver { EndPoint ep = _epSelector.select(secStore); Answer answer = ep.sendMessage(cmd); - if ((answer != null) && answer.getResult()) { - snapshot.setBackupSnapshotId(null); - snapshotDao.update(snapshotObj.getId(), snapshot); - } else if (answer != null) { + if (answer != null) { result.setResult(answer.getDetails()); } } catch (Exception e) { diff --git a/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java b/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java index e8009fc0239..aa0f3755dd4 100644 --- a/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java +++ b/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java @@ -292,7 +292,7 @@ public class SwiftImageStoreDriverImpl implements ImageStoreDriver { Long accountId = snapshot.getAccountId(); Long volumeId = snapshot.getVolumeId(); - String backupOfSnapshot = snapshotObj.getBackupSnapshotId(); + String backupOfSnapshot = snapshotObj.getPath(); if (backupOfSnapshot == null) { callback.complete(result); return; @@ -304,10 +304,7 @@ public class SwiftImageStoreDriverImpl implements ImageStoreDriver { EndPoint ep = _epSelector.select(secStore); Answer answer = ep.sendMessage(cmd); - if ((answer != null) && answer.getResult()) { - snapshot.setBackupSnapshotId(null); - snapshotDao.update(snapshotObj.getId(), snapshot); - } else if (answer != null) { + if (answer != null) { result.setResult(answer.getDetails()); } } catch (Exception e) { diff --git a/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/driver/SamplePrimaryDataStoreDriverImpl.java b/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/driver/SamplePrimaryDataStoreDriverImpl.java index 73dfa8052f3..a9226c7da39 100644 --- a/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/driver/SamplePrimaryDataStoreDriverImpl.java +++ b/plugins/storage/volume/sample/src/org/apache/cloudstack/storage/datastore/driver/SamplePrimaryDataStoreDriverImpl.java @@ -90,7 +90,7 @@ public class SamplePrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver } public Void createAsyncCallback(AsyncCallbackDispatcher callback, CreateVolumeContext context) { - CreateCmdResult result = null; + /*CreateCmdResult result = null; CreateObjectAnswer volAnswer = (CreateObjectAnswer) callback.getResult(); if (volAnswer.getResult()) { result = new CreateCmdResult(volAnswer.getPath(), volAnswer); @@ -99,7 +99,7 @@ public class SamplePrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver result.setResult(volAnswer.getDetails()); } - context.getParentCallback().complete(result); + context.getParentCallback().complete(result);*/ return null; } @@ -177,7 +177,7 @@ public class SamplePrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver public void createAsync(DataObject vol, AsyncCompletionCallback callback) { EndPoint ep = selector.select(vol); - CreateObjectCommand createCmd = new CreateObjectCommand(vol.getUri()); + CreateObjectCommand createCmd = new CreateObjectCommand(null); CreateVolumeContext context = new CreateVolumeContext(callback, vol); AsyncCallbackDispatcher caller = AsyncCallbackDispatcher.create(this); @@ -197,10 +197,10 @@ public class SamplePrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver if (obj.getPath() == null) { //create an obj EndPoint newEp = selector.select(object); - CreateObjectCommand createCmd = new CreateObjectCommand(uri); + CreateObjectCommand createCmd = new CreateObjectCommand(null); CreateObjectAnswer answer = (CreateObjectAnswer)ep.sendMessage(createCmd); if (answer.getResult()) { - dataObjMgr.update(object, answer.getPath(), answer.getSize()); + //dataObjMgr.update(object, answer.getPath(), answer.getSize()); } else { s_logger.debug("failed to create object" + answer.getDetails()); throw new CloudRuntimeException("failed to create object" + answer.getDetails()); diff --git a/plugins/storage/volume/solidfire/test/org/apache/cloudstack/storage/test/VolumeTest.java b/plugins/storage/volume/solidfire/test/org/apache/cloudstack/storage/test/VolumeTest.java index 91bc7ea0117..5bc929d3efc 100644 --- a/plugins/storage/volume/solidfire/test/org/apache/cloudstack/storage/test/VolumeTest.java +++ b/plugins/storage/volume/solidfire/test/org/apache/cloudstack/storage/test/VolumeTest.java @@ -109,7 +109,7 @@ public class VolumeTest { results.add(host); Mockito.when(hostDao.listAll()).thenReturn(results); Mockito.when(hostDao.findHypervisorHostInCluster(Mockito.anyLong())).thenReturn(results); - CreateObjectAnswer createVolumeFromImageAnswer = new CreateObjectAnswer(null,UUID.randomUUID().toString(), null); + //CreateObjectAnswer createVolumeFromImageAnswer = new CreateObjectAnswer(null,UUID.randomUUID().toString(), null);