You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mt...@apache.org on 2015/01/26 07:57:51 UTC
[1/2] git commit: updated refs/heads/master to 8204a44
Repository: cloudstack
Updated Branches:
refs/heads/master ebd7a7be5 -> 8204a4489
Provide a more detailed snapshot name on the SAN side
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f23c5ded
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f23c5ded
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f23c5ded
Branch: refs/heads/master
Commit: f23c5ded0b611a3a4edb17b20ba5af4c057babfd
Parents: ebd7a7b
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Sun Jan 25 22:48:30 2015 -0700
Committer: Mike Tutkowski <mi...@solidfire.com>
Committed: Sun Jan 25 22:51:16 2015 -0700
----------------------------------------------------------------------
.../datastore/driver/SolidFirePrimaryDataStoreDriver.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f23c5ded/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidFirePrimaryDataStoreDriver.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidFirePrimaryDataStoreDriver.java b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidFirePrimaryDataStoreDriver.java
index 485cffa..064bb1a 100644
--- a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidFirePrimaryDataStoreDriver.java
+++ b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidFirePrimaryDataStoreDriver.java
@@ -549,7 +549,9 @@ public class SolidFirePrimaryDataStoreDriver implements PrimaryDataStoreDriver {
storagePool.setUsedBytes(usedBytes);
- long sfNewVolumeId = SolidFireUtil.createSolidFireVolume(sfConnection, snapshotInfo.getUuid(), sfVolume.getAccountId(), sfVolumeSize,
+ String volumeName = volumeInfo.getName() + "-" + snapshotInfo.getUuid();
+
+ long sfNewVolumeId = SolidFireUtil.createSolidFireVolume(sfConnection, volumeName, sfVolume.getAccountId(), sfVolumeSize,
sfVolume.isEnable512e(), NumberFormat.getInstance().format(volumeInfo.getSize()), sfVolume.getMinIops(), 50000, 75000);
// Now that we have successfully created a volume, update the space usage in the storage_pool table
[2/2] git commit: updated refs/heads/master to 8204a44
Posted by mt...@apache.org.
When creating a template from a managed-storage snapshot, put the snapshot in the Copying state before performing the copy (don't want to do anything with the snapshot until this process has completed)
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8204a448
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8204a448
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8204a448
Branch: refs/heads/master
Commit: 8204a448900c09fa81c1c4c867ac84e1f59f4457
Parents: f23c5de
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Sun Jan 25 22:50:47 2015 -0700
Committer: Mike Tutkowski <mi...@solidfire.com>
Committed: Sun Jan 25 23:29:27 2015 -0700
----------------------------------------------------------------------
.../motion/StorageSystemDataMotionStrategy.java | 33 +++++++++++++++-----
1 file changed, 26 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8204a448/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
----------------------------------------------------------------------
diff --git a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
index de98f55..26a631b 100644
--- a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
+++ b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
@@ -177,6 +177,13 @@ public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
}
private Void handleCreateTemplateFromSnapshot(SnapshotInfo snapshotInfo, TemplateInfo templateInfo, AsyncCompletionCallback<CopyCommandResult> callback) {
+ try {
+ snapshotInfo.processEvent(Event.CopyingRequested);
+ }
+ catch (Exception ex) {
+ throw new CloudRuntimeException("This snapshot is not currently in a state where it can be used to create a template.");
+ }
+
HostVO hostVO = getHost(snapshotInfo.getDataStore().getId());
DataStore srcDataStore = snapshotInfo.getDataStore();
@@ -184,6 +191,8 @@ public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
int primaryStorageDownloadWait = NumbersUtil.parseInt(value, Integer.parseInt(Config.PrimaryStorageDownloadWait.getDefaultValue()));
CopyCommand copyCommand = new CopyCommand(snapshotInfo.getTO(), templateInfo.getTO(), primaryStorageDownloadWait, VirtualMachineManager.ExecuteInSequence.value());
+ String errMsg = null;
+
CopyCmdAnswer copyCmdAnswer = null;
try {
@@ -205,16 +214,26 @@ public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
catch (Exception ex) {
s_logger.debug(ex.getMessage(), ex);
}
- }
- String errMsg = null;
+ if (copyCmdAnswer == null || !copyCmdAnswer.getResult()) {
+ if (copyCmdAnswer != null && copyCmdAnswer.getDetails() != null && !copyCmdAnswer.getDetails().isEmpty()) {
+ errMsg = copyCmdAnswer.getDetails();
+ }
+ else {
+ errMsg = "Unable to perform host-side operation";
+ }
+ }
- if (copyCmdAnswer == null || !copyCmdAnswer.getResult()) {
- if (copyCmdAnswer != null && copyCmdAnswer.getDetails() != null && !copyCmdAnswer.getDetails().isEmpty()) {
- errMsg = copyCmdAnswer.getDetails();
+ try {
+ if (errMsg == null) {
+ snapshotInfo.processEvent(Event.OperationSuccessed);
+ }
+ else {
+ snapshotInfo.processEvent(Event.OperationFailed);
+ }
}
- else {
- errMsg = "Unable to perform host-side operation";
+ catch (Exception ex) {
+ s_logger.debug(ex.getMessage(), ex);
}
}