cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject git commit: updated refs/heads/4.2-forward to 143fb72
Date Tue, 24 Sep 2013 18:59:08 GMT
Updated Branches:
  refs/heads/4.2-forward 5225bd434 -> 143fb72e8


System vm not coming up in multizone upgraded enviornment if a system vm
template is register twice per zone.

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

Branch: refs/heads/4.2-forward
Commit: 143fb72e8bf6dac9f9e0765943bc28d001a7f1d1
Parents: 5225bd4
Author: Min Chen <min.chen@citrix.com>
Authored: Tue Sep 24 11:58:34 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Tue Sep 24 11:58:34 2013 -0700

----------------------------------------------------------------------
 .../src/com/cloud/storage/dao/VMTemplateDaoImpl.java  | 14 +++++++++++++-
 .../secondary/SecondaryStorageManagerImpl.java        |  2 +-
 2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/143fb72e/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
index 2aca203..7abb58c 100755
--- a/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
@@ -30,6 +30,9 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import com.cloud.storage.VMTemplateStorageResourceAssoc;
+
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
 import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO;
 import org.apache.log4j.Logger;
@@ -70,6 +73,8 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long>
implem
     VMTemplateZoneDao _templateZoneDao;
     @Inject
     VMTemplateDetailsDao _templateDetailsDao;
+    @Inject
+    DataStoreManager _dataStoreMgr;    
 
     @Inject
     ConfigurationDao _configDao;
@@ -338,6 +343,7 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO,
Long> implem
         readySystemTemplateSearch.and("templateType", readySystemTemplateSearch.entity().getTemplateType(),
SearchCriteria.Op.EQ);
         SearchBuilder<TemplateDataStoreVO>  templateDownloadSearch = _templateDataStoreDao.createSearchBuilder();
         templateDownloadSearch.and("downloadState", templateDownloadSearch.entity().getDownloadState(),
SearchCriteria.Op.EQ);
+        templateDownloadSearch.and("dataStoreId", templateDownloadSearch.entity().getDataStoreId(),
SearchCriteria.Op.EQ);
         readySystemTemplateSearch.join("vmTemplateJoinTemplateStoreRef", templateDownloadSearch,
templateDownloadSearch.entity().getTemplateId(),
                 readySystemTemplateSearch.entity().getId(), JoinBuilder.JoinType.INNER);
         SearchBuilder<HostVO> hostHyperSearch2 = _hostDao.createSearchBuilder();
@@ -795,7 +801,13 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO,
Long> implem
         sc.setJoinParameters("tmplHyper", "type", Host.Type.Routing);
         sc.setJoinParameters("tmplHyper", "zoneId", zoneId);
         sc.setJoinParameters("vmTemplateJoinTemplateStoreRef", "downloadState", VMTemplateStorageResourceAssoc.Status.DOWNLOADED);
-
+        DataStore secStore = this._dataStoreMgr.getImageStore(zoneId);
+        if (secStore != null) {
+            sc.setJoinParameters("vmTemplateJoinTemplateStoreRef", "dataStoreId", secStore.getId());
+        } else{
+            s_logger.warn("No secondary storage is available in data center " + zoneId);
+        }
+        
         // order by descending order of id
         List<VMTemplateVO> tmplts = listBy(sc, new Filter(VMTemplateVO.class, "id",
false, null, null));
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/143fb72e/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
index ba677a0..04fb844 100755
--- a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
+++ b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
@@ -743,7 +743,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements
Secondar
             DataStore store = templateMgr.getImageStore(dataCenterId, template.getId());
             if (store == null) {
                 if (s_logger.isDebugEnabled()) {
-                    s_logger.debug("No secondary storage available in zone " + dataCenterId
+ ", wait until it is ready to launch secondary storage vm");
+                    s_logger.debug("Secondary storage VM template " + template.getId() +
" is not available in zone " + dataCenterId + ", wait until it is ready to launch secondary
storage vm");
                 }
                 return false;
             }


Mime
View raw message