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/03/17 11:26:04 UTC

[02/50] git commit: updated refs/heads/master to 3c429ee

Vrrp will fail if your own code keeps killing it off


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

Branch: refs/heads/master
Commit: f5ef75ee7eca2b62e59395a5cbb94330d675471d
Parents: ae53d5e
Author: Ian Southam <is...@schubergphilis.com>
Authored: Tue Jan 27 16:58:16 2015 +0100
Committer: wilderrodrigues <wr...@schubergphilis.com>
Committed: Mon Mar 16 11:39:51 2015 +0100

----------------------------------------------------------------------
 .../patches/debian/config/opt/cloud/bin/configure.py     |  7 +++++--
 .../patches/debian/config/opt/cloud/bin/cs/CsAddress.py  | 11 +++++++++++
 .../debian/config/opt/cloud/bin/cs/CsRedundant.py        |  3 ++-
 3 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f5ef75ee/systemvm/patches/debian/config/opt/cloud/bin/configure.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/configure.py b/systemvm/patches/debian/config/opt/cloud/bin/configure.py
index b04da82..b693477 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/configure.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/configure.py
@@ -556,8 +556,8 @@ def main(argv):
     fwd = CsForwardingRules("forwardingrules", config)
     fwd.process()
 
-    vpns = CsSite2SiteVpn("site2sitevpn", config)
-    vpns.process()
+    nf = CsNetfilters()
+    nf.compare(config.get_fw())
 
     red = CsRedundant(config)
     red.set()
@@ -565,6 +565,9 @@ def main(argv):
     nf = CsNetfilters()
     nf.compare(config.get_fw())
 
+    vpns = CsSite2SiteVpn("site2sitevpn", config)
+    vpns.process()
+
     dhcp = CsDhcp("dhcpentry", config)
     dhcp.process()
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f5ef75ee/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
index 9362df1..a3ca801 100644
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
@@ -491,9 +491,20 @@ class CsIP:
                     self.setAddress(address)
                     if self.hasIP(ip):
                         found = True
+                    if self.is_guest_gateway(address, ip):
+                        found = True
             if not found:
                 self.delete(ip)
 
+    def is_guest_gateway(self, bag, ip):
+        """ Exclude the vrrp maintained addresses on a redundant router """
+        if not self.config.cl.is_redundant():
+           return False
+        rip = ip.split('/')[0]
+        if bag['nw_type'] == "guest" and rip == bag['gateway']:
+           return True
+        return False
+
     def delete(self, ip):
         remove = []
         if ip == "all":

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f5ef75ee/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
index 9569f08..4312462 100644
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
@@ -105,6 +105,8 @@ class CsRedundant(object):
         file.search(" virtual_router_id ", "    virtual_router_id %s" % self.cl.get_router_id())
         file.greplace("[RROUTER_BIN_PATH]", self.CS_ROUTER_DIR)
         file.section("virtual_ipaddress {", "}", self._collect_ips())
+        if self.cl.get_state() == 'MASTER':
+            file.search(" priority ", "    priority %s" % 120)
         file.commit()
 
         # conntrackd configuration
@@ -209,7 +211,6 @@ class CsRedundant(object):
         CsHelper.service("cloud-passwd-srvr", "restart")
         CsHelper.service("dnsmasq", "restart")
         self.cl.dbag['config']['redundant_master'] = "true"
-        self._set_priority(self.CS_PRIO_UP)
         self.cl.save()
         #CsHelper.service("keepalived", "restart")
         logging.info("Router switched to master mode")