cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sate...@apache.org
Subject git commit: updated refs/heads/4.3 to 032888c
Date Wed, 15 Jan 2014 01:38:33 GMT
Updated Branches:
  refs/heads/4.3 7a8c0e3ae -> 032888c46


CLOUDSTACK-5408 [Automation] Failed to deploy vm in vmware environment with error "due to
java.io.IOException: Cannot run program "mount": java.io.IOException: error=12, Cannot allocate
memory"

Bump up RAM size of system offering for SSVM to 512MB

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/032888c4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/032888c4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/032888c4

Branch: refs/heads/4.3
Commit: 032888c46ca70096423ff84b31ce5d99c12442b9
Parents: 7a8c0e3
Author: Sateesh Chodapuneedi <sateesh@apache.org>
Authored: Wed Jan 15 01:38:34 2014 +0530
Committer: Sateesh Chodapuneedi <sateesh@apache.org>
Committed: Wed Jan 15 01:38:34 2014 +0530

----------------------------------------------------------------------
 .../com/cloud/upgrade/dao/Upgrade421to430.java  | 43 ++++++++++++++++++++
 1 file changed, 43 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/032888c4/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java
index 268a27d..bf08e87 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java
@@ -63,6 +63,49 @@ public class Upgrade421to430 implements DbUpgrade {
     @Override
     public void performDataMigration(Connection conn) {
         encryptLdapConfigParams(conn);
+        upgradeMemoryOfSsvmOffering(conn);
+    }
+
+    private void upgradeMemoryOfSsvmOffering(Connection conn) {
+        PreparedStatement updatePstmt = null;
+        PreparedStatement selectPstmt = null;
+        ResultSet selectResultSet = null;
+        int newRamSize = 512; //512MB
+        long serviceOfferingId = 0;
+
+            /**
+             * Pick first row in service_offering table which has system vm type as secondary
storage vm. User added offerings would start from 2nd row onwards.
+             * We should not update/modify any user-defined offering.
+             */
+
+        try {
+            selectPstmt = conn.prepareStatement("SELECT id FROM `cloud`.`service_offering`
WHERE vm_type='secondarystoragevm'");
+            updatePstmt = conn.prepareStatement("UPDATE `cloud`.`service_offering` SET ram_size=?
WHERE id=?'");
+            selectResultSet = selectPstmt.executeQuery();
+            if(selectResultSet.next()) {
+                serviceOfferingId = selectResultSet.getLong("id");
+            }
+
+            updatePstmt.setInt(1, newRamSize);
+            updatePstmt.setLong(2, serviceOfferingId);
+            updatePstmt.executeUpdate();
+        } catch (SQLException e) {
+            throw new CloudRuntimeException("Unable to upgrade ram_size of service offering
for secondary storage vm. ", e);
+        } finally {
+            try {
+                if (selectPstmt != null) {
+                    selectPstmt.close();
+                }
+                if (selectResultSet != null) {
+                    selectResultSet.close();
+                }
+                if (updatePstmt != null) {
+                    updatePstmt.close();
+                }
+            } catch (SQLException e) {
+            }
+        }
+        s_logger.debug("Done upgrading RAM for service offering of Secondary Storage VM to
" + newRamSize);
     }
 
     private void encryptLdapConfigParams(Connection conn) {


Mime
View raw message