cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kous...@apache.org
Subject [8/8] git commit: updated refs/heads/volume-upload to 121ff19
Date Sat, 31 Jan 2015 12:08:19 GMT
volume-upload: Attaching uploaded volume to an instance failing while copying from secondary
to primary storage
The volume/template size and install path was not getting updated properly.
The upload status response should return these properties on completion of upload.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/121ff19c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/121ff19c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/121ff19c

Branch: refs/heads/volume-upload
Commit: 121ff19cbaa05a7b6f690c6bb38a9cdc5d445bfe
Parents: 6ff8752
Author: Koushik Das <koushik@apache.org>
Authored: Fri Jan 30 17:36:13 2015 +0530
Committer: Koushik Das <koushik@apache.org>
Committed: Sat Jan 31 17:27:46 2015 +0530

----------------------------------------------------------------------
 .../storage/command/UploadStatusAnswer.java     | 26 ++++++++++++++++++++
 .../storage/ImageStoreUploadMonitorImpl.java    |  8 ++++++
 2 files changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/121ff19c/core/src/org/apache/cloudstack/storage/command/UploadStatusAnswer.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/command/UploadStatusAnswer.java b/core/src/org/apache/cloudstack/storage/command/UploadStatusAnswer.java
index 00be941..a5ef53b 100644
--- a/core/src/org/apache/cloudstack/storage/command/UploadStatusAnswer.java
+++ b/core/src/org/apache/cloudstack/storage/command/UploadStatusAnswer.java
@@ -27,6 +27,9 @@ public class UploadStatusAnswer extends Answer {
     }
 
     private UploadStatus status;
+    private long virtualSize = 0;
+    private long physicalSize = 0;
+    private String installPath = null;
 
     protected UploadStatusAnswer() {
     }
@@ -50,4 +53,27 @@ public class UploadStatusAnswer extends Answer {
         return status;
     }
 
+    public long getVirtualSize() {
+        return virtualSize;
+    }
+
+    public void setVirtualSize(long virtualSize) {
+        this.virtualSize = virtualSize;
+    }
+
+    public long getPhysicalSize() {
+        return physicalSize;
+    }
+
+    public void setPhysicalSize(long physicalSize) {
+        this.physicalSize = physicalSize;
+    }
+
+    public String getInstallPath() {
+        return installPath;
+    }
+
+    public void setInstallPath(String installPath) {
+        this.installPath = installPath;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/121ff19c/server/src/com/cloud/storage/ImageStoreUploadMonitorImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/ImageStoreUploadMonitorImpl.java b/server/src/com/cloud/storage/ImageStoreUploadMonitorImpl.java
index 736f8c6..cd8985f 100755
--- a/server/src/com/cloud/storage/ImageStoreUploadMonitorImpl.java
+++ b/server/src/com/cloud/storage/ImageStoreUploadMonitorImpl.java
@@ -262,6 +262,10 @@ public class ImageStoreUploadMonitorImpl extends ManagerBase implements
ImageSto
                         case COMPLETED:
                             tmpVolumeDataStore.setDownloadState(VMTemplateStorageResourceAssoc.Status.DOWNLOADED);
                             tmpVolumeDataStore.setState(State.Ready);
+                            tmpVolumeDataStore.setInstallPath(answer.getInstallPath());
+                            tmpVolumeDataStore.setPhysicalSize(answer.getPhysicalSize());
+                            tmpVolumeDataStore.setSize(answer.getVirtualSize());
+                            tmpVolumeDataStore.setDownloadPercent(100);
                             stateMachine.transitTo(tmpVolume, Event.OperationSucceeded, null,
_volumeDao);
                             if (s_logger.isDebugEnabled()) {
                                 s_logger.debug("Volume " + tmpVolume.getUuid() + " uploaded
successfully");
@@ -322,6 +326,10 @@ public class ImageStoreUploadMonitorImpl extends ManagerBase implements
ImageSto
                         case COMPLETED:
                             tmpTemplateDataStore.setDownloadState(VMTemplateStorageResourceAssoc.Status.DOWNLOADED);
                             tmpTemplateDataStore.setState(State.Ready);
+                            tmpTemplateDataStore.setInstallPath(answer.getInstallPath());
+                            tmpTemplateDataStore.setPhysicalSize(answer.getPhysicalSize());
+                            tmpTemplateDataStore.setSize(answer.getVirtualSize());
+                            tmpTemplateDataStore.setDownloadPercent(100);
                             stateMachine.transitTo(tmpTemplate, VirtualMachineTemplate.Event.OperationSucceeded,
null, _templateDao);
                             if (s_logger.isDebugEnabled()) {
                                 s_logger.debug("Template " + tmpTemplate.getUuid() + " uploaded
successfully");


Mime
View raw message