cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sate...@apache.org
Subject [2/3] git commit: updated refs/heads/master to 7998413
Date Fri, 31 May 2013 19:04:05 GMT
CLOUDSTACK-2029 zone wide primary storage support for cloudstack over vmware deployments

DB changes to support hypervisor specific zone wide storage pool.
Added method findZoneWideStoragePoolsByHypervisor to PrimaryStorageDaoImpl to find suitable
zone wide storage pool of specific hypervisor type.
Added column 'hypervisor' to table storage_pool. This column can be NULL. Used/populated only
for zone wide primary storage pools.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>


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

Branch: refs/heads/master
Commit: e7d468e221fc85cc21eb5c54d6e9dc3e45f187ee
Parents: 2705f01
Author: Sateesh Chodapuneedi <sateesh@apache.org>
Authored: Wed May 29 00:34:32 2013 +0530
Committer: Sateesh Chodapuneedi <sateesh@apache.org>
Committed: Sat Jun 1 00:05:27 2013 +0530

----------------------------------------------------------------------
 .../storage/datastore/db/PrimaryDataStoreDao.java  |    3 ++
 .../datastore/db/PrimaryDataStoreDaoImpl.java      |   11 ++++++
 .../storage/datastore/db/StoragePoolVO.java        |   13 +++++++
 .../api/query/dao/StoragePoolJoinDaoImpl.java      |    6 +++
 .../com/cloud/api/query/vo/StoragePoolJoinVO.java  |   29 +++++++++++----
 5 files changed, 55 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e7d468e2/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDao.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDao.java
b/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDao.java
index 4d84525..d436762 100644
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDao.java
+++ b/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDao.java
@@ -22,6 +22,7 @@ import java.util.Map;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.ScopeType;
 
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.storage.StoragePoolStatus;
 import com.cloud.utils.db.GenericDao;
 /**
@@ -109,4 +110,6 @@ public interface PrimaryDataStoreDao extends GenericDao<StoragePoolVO,
Long> {
 			Long clusterId, String[] tags);
 
 	List<StoragePoolVO> findZoneWideStoragePoolsByTags(long dcId, String[] tags);
+
+    List<StoragePoolVO> findZoneWideStoragePoolsByHypervisor(long dataCenterId, HypervisorType
hypervisorType);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e7d468e2/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
b/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
index 7fcddf1..d461d58 100644
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
+++ b/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
@@ -32,6 +32,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.ScopeType;
 import org.springframework.stereotype.Component;
 
 import com.cloud.host.Status;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
 
 import com.cloud.storage.StoragePoolStatus;
 
@@ -427,4 +428,14 @@ public class PrimaryDataStoreDaoImpl extends GenericDaoBase<StoragePoolVO,
Long>
         
         return listBy(sc);
     }
+
+    @Override
+    public List<StoragePoolVO> findZoneWideStoragePoolsByHypervisor(long dataCenterId,
HypervisorType hypervisorType) {
+        SearchCriteriaService<StoragePoolVO, StoragePoolVO> sc =  SearchCriteria2.create(StoragePoolVO.class);
+        sc.addAnd(sc.getEntity().getDataCenterId(), Op.EQ, dataCenterId);
+        sc.addAnd(sc.getEntity().getStatus(), Op.EQ, Status.Up);
+        sc.addAnd(sc.getEntity().getScope(), Op.EQ, ScopeType.ZONE);
+        sc.addAnd(sc.getEntity().getHypervisor(), Op.EQ, hypervisorType);
+        return sc.list();
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e7d468e2/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
b/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
index 55b2314..0262f65 100644
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
+++ b/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
@@ -31,6 +31,7 @@ import javax.persistence.TemporalType;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.ScopeType;
 
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.storage.Storage.StoragePoolType;
 import com.cloud.storage.StoragePool;
 import com.cloud.storage.StoragePoolStatus;
@@ -102,6 +103,10 @@ public class StoragePoolVO implements StoragePool{
     @Enumerated(value = EnumType.STRING)
     private ScopeType scope;
 
+    @Column(name = "hypervisor")
+    @Enumerated(value = EnumType.STRING)
+    private HypervisorType hypervisor;
+
     public long getId() {
         return id;
     }
@@ -276,6 +281,14 @@ public class StoragePoolVO implements StoragePool{
         return this.scope;
     }
 
+    public HypervisorType getHypervisor() {
+        return hypervisor;
+    }
+
+    public void setHypervisor(HypervisorType hypervisor) {
+        this.hypervisor = hypervisor;
+    }
+
     @Override
     public boolean equals(Object obj) {
         if (!(obj instanceof StoragePoolVO) || obj == null) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e7d468e2/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java
index e401f44..e276978 100644
--- a/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java
@@ -85,6 +85,9 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO,
Lo
         poolResponse.setPodName(pool.getPodName());
         poolResponse.setCreated(pool.getCreated());
         poolResponse.setScope(pool.getScope().toString());
+        if (pool.getHypervisor() != null) {
+            poolResponse.setHypervisor(pool.getHypervisor().toString());
+        }
 
 
         long allocatedSize = pool.getUsedCapacity() +  pool.getReservedCapacity();
@@ -143,6 +146,9 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO,
Lo
         poolResponse.setPodName(pool.getPodName());
         poolResponse.setCreated(pool.getCreated());
         poolResponse.setScope(pool.getScope().toString());
+        if (pool.getHypervisor() != null) {
+            poolResponse.setHypervisor(pool.getHypervisor().toString());
+        }
 
 
         long allocatedSize = pool.getUsedCapacity() +  pool.getReservedCapacity();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e7d468e2/server/src/com/cloud/api/query/vo/StoragePoolJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/StoragePoolJoinVO.java b/server/src/com/cloud/api/query/vo/StoragePoolJoinVO.java
index d86726c..29e97f4 100644
--- a/server/src/com/cloud/api/query/vo/StoragePoolJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/StoragePoolJoinVO.java
@@ -24,15 +24,17 @@ import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
 import javax.persistence.Id;
 import javax.persistence.Table;
-import com.cloud.org.Cluster;
-import com.cloud.storage.StoragePoolStatus;
-import com.cloud.storage.Storage.StoragePoolType;
-import com.cloud.utils.db.GenericDao;
 
 import org.apache.cloudstack.api.Identity;
 import org.apache.cloudstack.api.InternalIdentity;
 import org.apache.cloudstack.engine.subsystem.api.storage.ScopeType;
 
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.org.Cluster;
+import com.cloud.storage.Storage.StoragePoolType;
+import com.cloud.storage.StoragePoolStatus;
+import com.cloud.utils.db.GenericDao;
+
 /**
  * Storage Pool DB view.
  *
@@ -99,7 +101,7 @@ public class StoragePoolJoinVO extends BaseViewVO implements InternalIdentity,
I
 
     @Column(name="data_center_type")
     private String zoneType;
-    
+
     @Column(name="pod_id")
     private long podId;
 
@@ -128,11 +130,16 @@ public class StoragePoolJoinVO extends BaseViewVO implements InternalIdentity,
I
 
     @Column(name="job_status")
     private int jobStatus;
-    
+
     @Column(name = "scope")
     @Enumerated(value = EnumType.STRING)
     private ScopeType scope;
 
+
+    @Column(name = "hypervisor")
+    @Enumerated(value = EnumType.STRING)
+    private HypervisorType hypervisor;
+
     /**
      * @return the scope
      */
@@ -147,6 +154,14 @@ public class StoragePoolJoinVO extends BaseViewVO implements InternalIdentity,
I
         this.scope = scope;
     }
 
+    public HypervisorType getHypervisor() {
+        return hypervisor;
+    }
+
+    public void setHypervisor(HypervisorType hypervisor) {
+        this.hypervisor = hypervisor;
+    }
+
     @Override
     public long getId() {
         return id;
@@ -293,7 +308,7 @@ public class StoragePoolJoinVO extends BaseViewVO implements InternalIdentity,
I
     public void setZoneType(String zoneType) {
         this.zoneType = zoneType;
     }
-    
+
     public long getPodId() {
         return podId;
     }


Mime
View raw message