You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2015/01/20 11:20:23 UTC

[1/4] git commit: updated refs/heads/4.5 to 45ebdf3

Repository: cloudstack
Updated Branches:
  refs/heads/4.5 31a651740 -> 45ebdf34a


CLOUDSTACK-7582: Update Storage Pool API does not update tags correctly

(cherry picked from commit fc4dceaa991ecacf0d248725decd5370622ea0ed)
Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


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

Branch: refs/heads/4.5
Commit: 45108fdbadaf0e0b8d6a98a730a27ab00bcca3b7
Parents: 31a6517
Author: Saksham Srivastava <sa...@citrix.com>
Authored: Wed Oct 22 13:53:41 2014 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Tue Jan 20 14:38:03 2015 +0530

----------------------------------------------------------------------
 .../cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java  | 3 +++
 server/src/com/cloud/storage/StorageManagerImpl.java              | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/45108fdb/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
index 0c372a5..ae2287e 100644
--- a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
+++ b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
@@ -435,6 +435,9 @@ public class PrimaryDataStoreDaoImpl extends GenericDaoBase<StoragePoolVO, Long>
                 detailsVO.add(new StoragePoolDetailVO(poolId, key, details.get(key), true));
             }
             _detailsDao.saveDetails(detailsVO);
+            if(details.size() == 0) {
+                _detailsDao.removeDetails(poolId);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/45108fdb/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java
index 7de4ea0..5ea44a2 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -803,7 +803,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
             }
         }
 
-        if (updatedDetails.size() > 0) {
+        if (updatedDetails.size() >= 0) {
             _storagePoolDao.updateDetails(id, updatedDetails);
         }
 


[4/4] git commit: updated refs/heads/4.5 to 45ebdf3

Posted by bh...@apache.org.
CLOUDSTACK-7469 Complete simulator build support

The initial commit (f96c65416a2802bcf2a1f8d5a5070ffe6a29111f) missed part of the change to package.sh, so we were not actually passing through the simulator build option to the rpmbuild call. This patch completes the support.

(cherry picked from commit e717450e0edd2406c4c3fc7341b3669c4390d507)
Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


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

Branch: refs/heads/4.5
Commit: 45ebdf34aee51217bf32e58039da16870dd1e5b3
Parents: 9cf05dc
Author: Alex Brett <al...@citrix.com>
Authored: Mon Oct 13 12:18:41 2014 +0100
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Tue Jan 20 15:01:41 2015 +0530

----------------------------------------------------------------------
 packaging/centos63/package.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/45ebdf34/packaging/centos63/package.sh
----------------------------------------------------------------------
diff --git a/packaging/centos63/package.sh b/packaging/centos63/package.sh
index bbc3736..00c1947 100755
--- a/packaging/centos63/package.sh
+++ b/packaging/centos63/package.sh
@@ -79,7 +79,7 @@ function packaging() {
     cp -rf default $RPMDIR/SPECS
     cp -rf rhel7 $RPMDIR/SPECS
 
-    (cd $RPMDIR; rpmbuild --define "_topdir $RPMDIR" "${DEFVER}" "${DEFREL}" ${DEFPRE+"${DEFPRE}"} ${DEFOSSNOSS+"$DEFOSSNOSS"} "${DOS}" -bb SPECS/cloud.spec)
+    (cd $RPMDIR; rpmbuild --define "_topdir $RPMDIR" "${DEFVER}" "${DEFREL}" ${DEFPRE+"${DEFPRE}"} ${DEFOSSNOSS+"$DEFOSSNOSS"} ${DEFSIM+"$DEFSIM"} "${DOS}" -bb SPECS/cloud.spec)
 
     if [ $? -ne 0 ]; then
         echo "RPM Build Failed "


[3/4] git commit: updated refs/heads/4.5 to 45ebdf3

Posted by bh...@apache.org.
CLOUDSTACK-7534: ResetVM for VM with attached datadisk fails when enable.ha.storage.migration is false

Separate global config to enable/disable Storage Migration during normal deployment
Introduced a configuration parameter named enable.storage.migration

(cherry picked from commit c55bc0b2d11be4820a24af426e23da3db54a0cb1)
Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


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

Branch: refs/heads/4.5
Commit: 9cf05dc842f3fb4649746ad536eca1855184e15b
Parents: bf8db0c
Author: Harikrishna Patnala <ha...@citrix.com>
Authored: Thu Sep 11 11:07:43 2014 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Tue Jan 20 14:43:10 2015 +0530

----------------------------------------------------------------------
 api/src/com/cloud/vm/VirtualMachineProfile.java     |  1 +
 .../engine/orchestration/VolumeOrchestrator.java    | 16 +++++++++++++---
 .../com/cloud/ha/HighAvailabilityManagerImpl.java   |  4 ++++
 3 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9cf05dc8/api/src/com/cloud/vm/VirtualMachineProfile.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/VirtualMachineProfile.java b/api/src/com/cloud/vm/VirtualMachineProfile.java
index 29f3164..d0fea49 100644
--- a/api/src/com/cloud/vm/VirtualMachineProfile.java
+++ b/api/src/com/cloud/vm/VirtualMachineProfile.java
@@ -41,6 +41,7 @@ public interface VirtualMachineProfile {
         public static final Param ReProgramGuestNetworks = new Param("RestartNetwork");
         public static final Param PxeSeverType = new Param("PxeSeverType");
         public static final Param HaTag = new Param("HaTag");
+        public static final Param HaOperation = new Param("HaOperation");
 
         private String name;
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9cf05dc8/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
index fd4883b..1a3c0b6 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -1101,7 +1101,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         }
     }
 
-    private List<VolumeTask> getTasks(List<VolumeVO> vols, Map<Volume, StoragePool> destVols) throws StorageUnavailableException {
+    private List<VolumeTask> getTasks(List<VolumeVO> vols, Map<Volume, StoragePool> destVols, VirtualMachineProfile vm) throws StorageUnavailableException {
         boolean recreate = RecreatableSystemVmEnabled.value();
         List<VolumeTask> tasks = new ArrayList<VolumeTask>();
         for (VolumeVO vol : vols) {
@@ -1141,7 +1141,14 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
                                 throw new CloudRuntimeException("Local volume " + vol + " cannot be recreated on storagepool " + assignedPool + " assigned by deploymentPlanner");
                             } else {
                                 //Check if storage migration is enabled in config
-                                if (StorageHAMigrationEnabled.value()) {
+                                Boolean isHAOperation = (Boolean)vm.getParameter(VirtualMachineProfile.Param.HaOperation);
+                                Boolean storageMigrationEnabled = true;
+                                if (isHAOperation != null && isHAOperation) {
+                                    storageMigrationEnabled = StorageHAMigrationEnabled.value();
+                                } else {
+                                    storageMigrationEnabled = StorageMigrationEnabled.value();
+                                }
+                                if(storageMigrationEnabled){
                                     if (s_logger.isDebugEnabled()) {
                                         s_logger.debug("Shared volume " + vol + " will be migrated on storage pool " + assignedPool + " assigned by deploymentPlanner");
                                     }
@@ -1299,7 +1306,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
             s_logger.debug("Checking if we need to prepare " + vols.size() + " volumes for " + vm);
         }
 
-        List<VolumeTask> tasks = getTasks(vols, dest.getStorageForDisks());
+        List<VolumeTask> tasks = getTasks(vols, dest.getStorageForDisks(), vm);
         Volume vol = null;
         StoragePool pool = null;
         for (VolumeTask task : tasks) {
@@ -1350,6 +1357,9 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
     public static final ConfigKey<Boolean> StorageHAMigrationEnabled = new ConfigKey<Boolean>(Boolean.class, "enable.ha.storage.migration", "Storage", "true",
             "Enable/disable storage migration across primary storage during HA", true);
 
+    public static final ConfigKey<Boolean> StorageMigrationEnabled = new ConfigKey<Boolean>(Boolean.class, "enable.storage.migration", "Storage", "true",
+            "Enable/disable storage migration across primary storage", true);
+
     @Override
     public ConfigKey<?>[] getConfigKeys() {
         return new ConfigKey<?>[] {RecreatableSystemVmEnabled, MaxVolumeSize, StorageHAMigrationEnabled, CustomDiskOfferingMaxSize, CustomDiskOfferingMinSize};

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9cf05dc8/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
index a305543..a278750 100755
--- a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
+++ b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
@@ -578,6 +578,10 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai
             if (_haTag != null) {
                 params.put(VirtualMachineProfile.Param.HaTag, _haTag);
             }
+            WorkType wt = work.getWorkType();
+            if (wt.equals(WorkType.HA)) {
+                params.put(VirtualMachineProfile.Param.HaOperation, true);
+            }
 
             try{
                 // First try starting the vm with its original planner, if it doesn't succeed send HAPlanner as its an emergency.


[2/4] git commit: updated refs/heads/4.5 to 45ebdf3

Posted by bh...@apache.org.
CLOUDSTACK-7571 changing value of cpu/mem.overprovisioning.factor for xen cluster is not affecting total memory at zone level

(cherry picked from commit 476733cb92634c8494fe64762d7fbc178292a754)
Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


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

Branch: refs/heads/4.5
Commit: bf8db0c743c94c4540dab2f069d253f1a859eb10
Parents: 45108fd
Author: Bharat Kumar <bh...@citrix.com>
Authored: Wed Sep 17 14:30:33 2014 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Tue Jan 20 14:39:21 2015 +0530

----------------------------------------------------------------------
 .../com/cloud/capacity/dao/CapacityDaoImpl.java | 32 +++++++++++++++-----
 1 file changed, 24 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bf8db0c7/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java b/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
index cea18bd..85740a2 100755
--- a/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
+++ b/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
@@ -113,7 +113,7 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
             + "else sum(total_capacity) end),"
             + "((sum(capacity.used_capacity) + sum(capacity.reserved_capacity)) / ( case capacity_type when 1 then (sum(total_capacity) * (select value from `cloud`.`cluster_details` where cluster_details.name= 'cpuOvercommitRatio' AND cluster_details.cluster_id=capacity.cluster_id))"
             + "when '0' then (sum(total_capacity) * (select value from `cloud`.`cluster_details` where cluster_details.name='memoryOvercommitRatio' AND cluster_details.cluster_id=capacity.cluster_id))else sum(total_capacity) end)) percent,"
-            + "capacity.capacity_type, capacity.data_center_id FROM `cloud`.`op_host_capacity` capacity WHERE  total_capacity > 0 AND data_center_id is not null AND capacity_state='Enabled'";
+            + "capacity.capacity_type, capacity.data_center_id, pod_id, cluster_id FROM `cloud`.`op_host_capacity` capacity WHERE  total_capacity > 0 AND data_center_id is not null AND capacity_state='Enabled'";
 
     private static final String LIST_CAPACITY_GROUP_BY_ZONE_TYPE_PART2 = " GROUP BY data_center_id, capacity_type order by percent desc limit ";
     private static final String LIST_CAPACITY_GROUP_BY_POD_TYPE_PART1 =
@@ -122,7 +122,7 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
             + "when '0' then (sum(total_capacity) * (select value from `cloud`.`cluster_details` where cluster_details.name= 'memoryOvercommitRatio' AND cluster_details.cluster_id=capacity.cluster_id))else sum(total_capacity) end),"
             + "((sum(capacity.used_capacity) + sum(capacity.reserved_capacity)) / ( case capacity_type when 1 then (sum(total_capacity) * (select value from `cloud`.`cluster_details` where cluster_details.name= 'cpuOvercommitRatio' AND cluster_details.cluster_id=capacity.cluster_id)) "
             + "when '0' then (sum(total_capacity) * (select value from `cloud`.`cluster_details` where cluster_details.name= 'memoryOvercommitRatio' AND cluster_details.cluster_id=capacity.cluster_id))else sum(total_capacity) end)) percent,"
-            + "capacity.capacity_type, capacity.data_center_id, pod_id FROM `cloud`.`op_host_capacity` capacity WHERE  total_capacity > 0 AND data_center_id is not null AND capacity_state='Enabled' ";
+            + "capacity.capacity_type, capacity.data_center_id, pod_id, cluster_id  FROM `cloud`.`op_host_capacity` capacity WHERE  total_capacity > 0 AND data_center_id is not null AND capacity_state='Enabled' ";
 
     private static final String LIST_CAPACITY_GROUP_BY_POD_TYPE_PART2 = " GROUP BY pod_id, capacity_type order by percent desc limit ";
 
@@ -134,7 +134,7 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
             + "when '0' then (sum(total_capacity) * (select value from `cloud`.`cluster_details` where cluster_details.name= 'memoryOvercommitRatio' AND cluster_details.cluster_id=capacity.cluster_id))else sum(total_capacity) end)) percent,"
             + "capacity.capacity_type, capacity.data_center_id, pod_id, cluster_id FROM `cloud`.`op_host_capacity` capacity WHERE  total_capacity > 0 AND data_center_id is not null AND capacity_state='Enabled' ";
 
-    private static final String LIST_CAPACITY_GROUP_BY_CLUSTER_TYPE_PART2 = " GROUP BY cluster_id, capacity_type order by percent desc limit ";
+    private static final String LIST_CAPACITY_GROUP_BY_CLUSTER_TYPE_PART2 = " GROUP BY cluster_id, capacity_type, pod_id order by percent desc limit ";
     private static final String UPDATE_CAPACITY_STATE = "UPDATE `cloud`.`op_host_capacity` SET capacity_state = ? WHERE ";
 
     private static final String LIST_CAPACITY_GROUP_BY_CAPACITY_PART1= "SELECT sum(capacity.used_capacity), sum(capacity.reserved_capacity)," +
@@ -317,7 +317,7 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
         StringBuilder finalQuery = new StringBuilder();
         TransactionLegacy txn = TransactionLegacy.currentTxn();
         PreparedStatement pstmt = null;
-        List<SummedCapacity> result = new ArrayList<SummedCapacity>();
+        List<SummedCapacity> results = new ArrayList<SummedCapacity>();
 
         List<Long> resourceIdList = new ArrayList<Long>();
 
@@ -354,11 +354,11 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
 
         switch (level) {
             case 1: // List all the capacities grouped by zone, capacity Type
-                finalQuery.append(LIST_CAPACITY_GROUP_BY_ZONE_TYPE_PART2);
+            finalQuery.append(LIST_CAPACITY_GROUP_BY_CLUSTER_TYPE_PART2);
                 break;
 
             case 2: // List all the capacities grouped by pod, capacity Type
-                finalQuery.append(LIST_CAPACITY_GROUP_BY_POD_TYPE_PART2);
+            finalQuery.append(LIST_CAPACITY_GROUP_BY_CLUSTER_TYPE_PART2);
                 break;
 
             case 3: // List all the capacities grouped by cluster, capacity Type
@@ -387,9 +387,25 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
                 SummedCapacity summedCapacity =
                     new SummedCapacity(rs.getLong(1), rs.getLong(2), rs.getLong(3), rs.getFloat(4), (short)rs.getLong(5), rs.getLong(6), capacityPodId, capacityClusterId);
 
-                result.add(summedCapacity);
+                results.add(summedCapacity);
             }
-            return result;
+
+            HashMap<Integer, SummedCapacity> capacityMap = new HashMap<Integer, SummedCapacity>();
+            for (SummedCapacity result: results) {
+                 if (capacityMap.containsKey(result.getCapacityType().intValue())) {
+                     SummedCapacity tempCapacity = capacityMap.get(result.getCapacityType().intValue());
+                     tempCapacity.setUsedCapacity(tempCapacity.getUsedCapacity()+result.getUsedCapacity());
+                     tempCapacity.setReservedCapacity(tempCapacity.getReservedCapacity()+result.getReservedCapacity());
+                     tempCapacity.setSumTotal(tempCapacity.getTotalCapacity()+result.getTotalCapacity());
+                 }else {
+                     capacityMap.put(result.getCapacityType().intValue(),result);
+                 }
+            }
+            List<SummedCapacity> summedCapacityList = new ArrayList<SummedCapacity>();
+            for (Integer capacity_type : capacityMap.keySet()) {
+                summedCapacityList.add(capacityMap.get(capacity_type));
+            }
+            return summedCapacityList;
         } catch (SQLException e) {
             throw new CloudRuntimeException("DB Exception on: " + finalQuery, e);
         } catch (Throwable e) {