You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2013/04/30 18:52:25 UTC

[1/2] git commit: updated refs/heads/internallb to 63bb98e

Updated Branches:
  refs/heads/internallb ed50caa01 -> 63bb98ebe


InternalLb: DB upgrade - update existing physical networks with InternalLbVm provider


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

Branch: refs/heads/internallb
Commit: ca1c313c2901a2ce1e7e6e3ce3a566bbf4c817b4
Parents: ed50caa
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Mon Apr 29 17:58:45 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Mon Apr 29 17:58:45 2013 -0700

----------------------------------------------------------------------
 .../src/com/cloud/upgrade/dao/Upgrade410to420.java |   51 +++++++++++++++
 1 files changed, 51 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ca1c313c/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/upgrade/dao/Upgrade410to420.java b/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
index 7e07245..3a164c4 100644
--- a/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
+++ b/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
@@ -68,6 +68,7 @@ public class Upgrade410to420 implements DbUpgrade {
         addEgressFwRulesForSRXGuestNw(conn);
         upgradeEIPNetworkOfferings(conn);
         upgradeDefaultVpcOffering(conn);
+        upgradePhysicalNtwksWithInternalLbProvider(conn);
     }
 	
 	private void updateSystemVmTemplates(Connection conn) {
@@ -435,4 +436,54 @@ public class Upgrade410to420 implements DbUpgrade {
             }
         }
     }
+    
+    
+    private void upgradePhysicalNtwksWithInternalLbProvider(Connection conn) {
+
+        PreparedStatement pstmt = null;
+        ResultSet rs = null;
+
+        try {
+            pstmt = conn.prepareStatement("SELECT id FROM `cloud`.`physical_network` where removed is null");
+            rs = pstmt.executeQuery();
+            while (rs.next()) {
+                long pNtwkId = rs.getLong(1);
+                String uuid = UUID.randomUUID().toString();
+                //Add internal LB VM to the list of physical network service providers
+                pstmt = conn.prepareStatement("INSERT INTO `cloud`.`physical_network_service_providers` " +
+                		"(uuid, physical_network_id, provider_name, state, load_balance_service_provided, destination_physical_network_id)" +
+                		" VALUES (?, ?, 'InternalLbVm', 'Enabled', 1, 0)");
+                pstmt.setString(1, uuid);
+                pstmt.setLong(2, pNtwkId);
+                pstmt.executeUpdate();
+                
+                //Add internal lb vm to the list of physical network elements
+                PreparedStatement pstmt1 = conn.prepareStatement("SELECT id FROM `cloud`.`physical_network_service_providers`" +
+                		" WHERE physical_network_id=? AND provider_name='InternalLbVm'");
+                ResultSet rs1 = pstmt1.executeQuery();
+                while (rs1.next()) {
+                    long providerId = rs1.getLong(1);
+                    uuid = UUID.randomUUID().toString();
+                    pstmt1 = conn.prepareStatement("INSERT INTO `cloud`.`virtual_router_providers` (nsp_id, uuid, type, enabled) VALUES (?, ?, 'InternalLbVm', 1)");
+                    pstmt1.setLong(1, providerId);
+                    pstmt1.setString(2, uuid);
+                    pstmt1.executeUpdate();
+                }
+            }
+            
+        } catch (SQLException e) {
+            throw new CloudRuntimeException("Unable existing physical networks with internal lb provider", e);
+        } finally {
+            try {
+                if (rs != null) {
+                    rs.close();
+                }
+                if (pstmt != null) {
+                    pstmt.close();
+                }
+            } catch (SQLException e) {
+            }
+        }
+        
+    }
 }


[2/2] git commit: updated refs/heads/internallb to 63bb98e

Posted by al...@apache.org.
allow ssh on eth1

Signed-off-by: Chiradeep Vittal <ch...@apache.org>


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

Branch: refs/heads/internallb
Commit: 63bb98ebe2fa8279138f8b32aa4264b547726224
Parents: ca1c313
Author: Chiradeep Vittal <ch...@apache.org>
Authored: Mon Apr 29 18:29:25 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Tue Apr 30 09:27:34 2013 -0700

----------------------------------------------------------------------
 .../debian/config/etc/init.d/cloud-early-config    |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63bb98eb/patches/systemvm/debian/config/etc/init.d/cloud-early-config
----------------------------------------------------------------------
diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config
index bdba38d..c95d400 100755
--- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config
+++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config
@@ -904,13 +904,9 @@ setup_ilbvm() {
   setup_common eth0 eth1
   #eth0 = guest network, eth1=control network
 
+  cp /etc/iptables/iptables-ilbvm /etc/iptables/rules.v4
   cp /etc/iptables/iptables-ilbvm /etc/iptables/rules
-  if [ "$SSHONGUEST" == "true" ]
-  then
-    setup_sshd $ETH0_IP "eth0"
-  else
-    setup_sshd $ETH1_IP "eth1"
-  fi
+  setup_sshd $ETH1_IP "eth1"
   
   enable_fwding 0
   enable_svc haproxy 1