Updated Branches:
  refs/heads/master eb4a3cf6c -> 79ebffe4f

CS-13594: Download template is unable to handle multiple SSVMs per zone
Reviewed-by: Kishan


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

Branch: refs/heads/master
Commit: 79ebffe4f3ce38340754b1954f1ec3f913cedb7c
Parents: eb4a3cf
Author: Nitin Mehta <[email protected]>
Authored: Wed Aug 29 15:01:31 2012 +0530
Committer: Nitin Mehta <[email protected]>
Committed: Wed Aug 29 15:25:00 2012 +0530

----------------------------------------------------------------------
 .../cloud/storage/upload/UploadMonitorImpl.java    |   27 ++++----------
 1 files changed, 8 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/79ebffe4/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/upload/UploadMonitorImpl.java 
b/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
index 7166504..4231be8 100755
--- a/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
+++ b/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
@@ -234,25 +234,14 @@ public class UploadMonitorImpl implements UploadMonitor {
             }
 
            //Construct actual URL locally now that the symlink exists at SSVM
-           List<SecondaryStorageVmVO> ssVms = 
_secStorageVmDao.getSecStorageVmListInStates(SecondaryStorageVm.Role.templateProcessor,
 dataCenterId, State.Running);
-           if (ssVms.size() > 0) {
-                SecondaryStorageVmVO ssVm = ssVms.get(0);
-                if (ssVm.getPublicIpAddress() == null) {
-                    errorString = "A running secondary storage vm has a null 
public ip?";
-                    s_logger.error(errorString);
-                    throw new CloudRuntimeException(errorString);
-                }
-                String extractURL = generateCopyUrl(ssVm.getPublicIpAddress(), 
uuid);
-                UploadVO vo = _uploadDao.createForUpdate();
-                vo.setLastUpdated(new Date());
-                vo.setUploadUrl(extractURL);
-                vo.setUploadState(Status.DOWNLOAD_URL_CREATED);
-                _uploadDao.update(uploadTemplateObj.getId(), vo);
-                success = true;
-                return _uploadDao.findById(uploadTemplateObj.getId(), true);
-            }
-            errorString = "Couldnt find a running SSVM in the zone" + 
dataCenterId+ ". Couldnt create the extraction URL.";
-            throw new CloudRuntimeException(errorString);
+            String extractURL = generateCopyUrl(ssvm.getPublicIpAddress(), 
uuid);
+            UploadVO vo = _uploadDao.createForUpdate();
+            vo.setLastUpdated(new Date());
+            vo.setUploadUrl(extractURL);
+            vo.setUploadState(Status.DOWNLOAD_URL_CREATED);
+            _uploadDao.update(uploadTemplateObj.getId(), vo);
+            success = true;
+            return _uploadDao.findById(uploadTemplateObj.getId(), true);       
 
            }finally{
            if(!success){
                 UploadVO uploadJob = 
_uploadDao.createForUpdate(uploadTemplateObj.getId());

Reply via email to