You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pr...@apache.org on 2013/09/19 01:57:50 UTC

[1/3] git commit: updated refs/heads/master to 62d60c2

Updated Branches:
  refs/heads/master 723ef6e49 -> 62d60c2b7


CLOUDSTACK-4668: Upgrade to 4.2 fails with NullPointerException when hypervisor_type is null for a cluster entry

Changes:
- Care for null value during comparing the hypervisor_type
- Do not consider removed clusters
- Method rename according to coding conventions


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

Branch: refs/heads/master
Commit: f2ea699d12e0b58f25f86b38a6018fa1c0a5d2f9
Parents: 723ef6e
Author: Prachi Damle <pr...@cloud.com>
Authored: Fri Sep 13 13:46:29 2013 -0700
Committer: Prachi Damle <pr...@cloud.com>
Committed: Wed Sep 18 16:52:01 2013 -0700

----------------------------------------------------------------------
 engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f2ea699d/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
index 02dd9c5..9bd6116 100755
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
@@ -84,7 +84,7 @@ public class Upgrade410to420 implements DbUpgrade {
         createPlaceHolderNics(conn);
         updateRemoteAccessVpn(conn);
         updateSystemVmTemplates(conn);
-        updateCluster_details(conn);
+        updateOverCommitRatioClusterDetails(conn);
         updatePrimaryStore(conn);
         addEgressFwRulesForSRXGuestNw(conn);
         upgradeEIPNetworkOfferings(conn);
@@ -853,7 +853,7 @@ public class Upgrade410to420 implements DbUpgrade {
     }
 
     //update the cluster_details table with default overcommit ratios.
-    private void updateCluster_details(Connection conn) {
+    private void updateOverCommitRatioClusterDetails(Connection conn) {
         PreparedStatement pstmt = null;
         PreparedStatement pstmt1 = null;
         PreparedStatement pstmt2 =null;
@@ -862,7 +862,7 @@ public class Upgrade410to420 implements DbUpgrade {
         ResultSet rscpu_global = null;
         ResultSet rsmem_global = null;
         try {
-            pstmt = conn.prepareStatement("select id, hypervisor_type from `cloud`.`cluster`");
+            pstmt = conn.prepareStatement("select id, hypervisor_type from `cloud`.`cluster` WHERE removed IS NULL");
             pstmt1=conn.prepareStatement("INSERT INTO `cloud`.`cluster_details` (cluster_id, name, value)  VALUES(?, 'cpuOvercommitRatio', ?)");
             pstmt2=conn.prepareStatement("INSERT INTO `cloud`.`cluster_details` (cluster_id, name, value)  VALUES(?, 'memoryOvercommitRatio', ?)");
             pstmt3=conn.prepareStatement("select value from `cloud`.`configuration` where name=?");
@@ -881,7 +881,7 @@ public class Upgrade410to420 implements DbUpgrade {
             while (rs1.next()) {
                 long id = rs1.getLong(1);
                 String hypervisor_type = rs1.getString(2);
-                if (hypervisor_type.equalsIgnoreCase(HypervisorType.VMware.toString())) {
+                if (HypervisorType.VMware.toString().equalsIgnoreCase(hypervisor_type)) {
                     pstmt1.setLong(1,id);
                     pstmt1.setString(2,global_cpu_overprovisioning_factor);
                     pstmt1.execute();


[3/3] git commit: updated refs/heads/master to 62d60c2

Posted by pr...@apache.org.
CLOUDSTACK-4664: [ZWPS] High delay to start a stopped VM which has ROOT/DATA volumes migrated to Second Zone wide primary Storage(More than 10 mins)

Changes:
- DeploymentPlanningManager needs to reuse the zone wide primary storage pool when VM's volume is READY


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

Branch: refs/heads/master
Commit: 62d60c2b77db872e0f7d1a32e9286b4f7680e950
Parents: 7416383
Author: Prachi Damle <pr...@cloud.com>
Authored: Fri Sep 13 14:37:00 2013 -0700
Committer: Prachi Damle <pr...@cloud.com>
Committed: Wed Sep 18 16:52:07 2013 -0700

----------------------------------------------------------------------
 .../deploy/DeploymentPlanningManagerImpl.java    | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/62d60c2b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
index 8b0257f..8cd44f4 100644
--- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
+++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
@@ -37,6 +37,7 @@ import org.apache.cloudstack.affinity.dao.AffinityGroupDao;
 import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao;
 import org.apache.cloudstack.engine.cloud.entity.api.db.VMReservationVO;
 import org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMReservationDao;
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
 import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
@@ -78,6 +79,7 @@ import com.cloud.org.Cluster;
 import com.cloud.org.Grouping;
 import com.cloud.resource.ResourceState;
 import com.cloud.storage.DiskOfferingVO;
+import com.cloud.storage.ScopeType;
 import com.cloud.storage.StorageManager;
 import com.cloud.storage.StoragePool;
 import com.cloud.storage.StoragePoolHostVO;
@@ -1081,11 +1083,24 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy
                 if (!pool.isInMaintenance()) {
                     if (!avoid.shouldAvoid(pool)) {
                         long exstPoolDcId = pool.getDataCenterId();
-
                         long exstPoolPodId = pool.getPodId() != null ? pool.getPodId() : -1;
                         long exstPoolClusterId = pool.getClusterId() != null ? pool.getClusterId() : -1;
+                        boolean canReusePool = false;
                         if (plan.getDataCenterId() == exstPoolDcId && plan.getPodId() == exstPoolPodId
                                 && plan.getClusterId() == exstPoolClusterId) {
+                            canReusePool = true;
+                        } else if (plan.getDataCenterId() == exstPoolDcId) {
+                            DataStore dataStore = this.dataStoreMgr.getPrimaryDataStore(pool.getId());
+                            if (dataStore != null && dataStore.getScope() != null
+                                    && dataStore.getScope().getScopeType() == ScopeType.ZONE) {
+                                canReusePool = true;
+                            }
+                        } else {
+                            s_logger.debug("Pool of the volume does not fit the specified plan, need to reallocate a pool for this volume");
+                            canReusePool = false;
+                        }
+
+                        if (canReusePool) {
                             s_logger.debug("Planner need not allocate a pool for this volume since its READY");
                             suitablePools.add(pool);
                             suitableVolumeStoragePools.put(toBeCreated, suitablePools);
@@ -1093,8 +1108,6 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy
                                 readyAndReusedVolumes.add(toBeCreated);
                             }
                             continue;
-                        } else {
-                            s_logger.debug("Pool of the volume does not fit the specified plan, need to reallocate a pool for this volume");
                         }
                     } else {
                         s_logger.debug("Pool of the volume is in avoid set, need to reallocate a pool for this volume");


[2/3] git commit: updated refs/heads/master to 62d60c2

Posted by pr...@apache.org.
CLOUDSTACK-4651: Restarting management server when volume Snapshot is still in progress for root volume of a VM , then there is no way to restart VM since the startVM job is stuck forever since the volume is in "Snapshoting" state.

Change:
-If no volume of the VM is usable, VM cannot be deployed or started. Atleast ROOT volume should always be in usable state to start up the VM


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

Branch: refs/heads/master
Commit: 7416383fcd540d039b068e86d346265a25795263
Parents: f2ea699
Author: Prachi Damle <pr...@cloud.com>
Authored: Fri Sep 13 14:56:43 2013 -0700
Committer: Prachi Damle <pr...@cloud.com>
Committed: Wed Sep 18 16:52:04 2013 -0700

----------------------------------------------------------------------
 server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7416383f/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
index cdd46ce..8b0257f 100644
--- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
+++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
@@ -1052,6 +1052,11 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy
         Map<Volume, List<StoragePool>> suitableVolumeStoragePools = new HashMap<Volume, List<StoragePool>>();
         List<Volume> readyAndReusedVolumes = new ArrayList<Volume>();
 
+        // There should be atleast the ROOT volume of the VM in usable state
+        if (volumesTobeCreated.isEmpty()) {
+            throw new CloudRuntimeException("Unable to create deployment, no usable volumes found for the VM");
+        }
+
         // for each volume find list of suitable storage pools by calling the
         // allocators
         for (VolumeVO toBeCreated : volumesTobeCreated) {