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:19 UTC
[17/50] git commit: updated refs/heads/master to 3c429ee
Switch control interface for vrrp to guest network
Fix rRouter that was deleting the gateway interface
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7a9a3560
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7a9a3560
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7a9a3560
Branch: refs/heads/master
Commit: 7a9a3560941e0f6d31fd8a3ed4c20edc32f826c8
Parents: e350f1e
Author: Ian Southam <is...@schubergphilis.com>
Authored: Tue Feb 3 17:21:11 2015 +0100
Committer: wilderrodrigues <wr...@schubergphilis.com>
Committed: Mon Mar 16 11:39:57 2015 +0100
----------------------------------------------------------------------
.../patches/debian/config/opt/cloud/bin/cs/CsAddress.py | 4 +++-
.../debian/config/opt/cloud/bin/cs/CsRedundant.py | 12 +++++++-----
2 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7a9a3560/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 193c6f6..9e4e687 100644
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
@@ -502,10 +502,12 @@ class CsIP:
def is_guest_gateway(self, bag, ip):
""" Exclude the vrrp maintained addresses on a redundant router """
+ interface = CsInterface(bag, self.config)
if not self.config.cl.is_redundant():
return False
rip = ip.split('/')[0]
- if bag['nw_type'] == "guest" and rip == bag['gateway']:
+ gw = interface.get_gateway()
+ if bag['nw_type'] == "guest" and rip == gw:
return True
return False
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7a9a3560/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 aed19d1..8561e8d 100644
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
@@ -78,6 +78,11 @@ class CsRedundant(object):
CsHelper.rm(self.KEEPALIVED_CONF)
def _redundant_on(self):
+ guest = self.address.get_guest_if()
+ # No redundancy if there is no guest network
+ if guest is None:
+ self._redundant_off()
+ return
CsHelper.mkdir(self.CS_RAMDISK_DIR, 0755, False)
CsHelper.mount_tmpfs(self.CS_RAMDISK_DIR)
CsHelper.mkdir(self.CS_ROUTER_DIR, 0755, False)
@@ -107,7 +112,8 @@ class CsRedundant(object):
i = i + 1
file.search(" router_id ", " router_id %s" % self.cl.get_name())
file.search(" priority ", " priority %s" % self.cl.get_priority())
- file.search(" weight ", " weight %s" % 2)
+ file.search(" interface ", " interface %s" % guest.get_device())
+ #file.search(" weight ", " weight %s" % 2)
# file.search(" state ", " state %s" % self.cl.get_state())
file.search(" state ", " state %s" % "EQUAL")
# file.search(" virtual_router_id ", " virtual_router_id %s" % self.cl.get_router_id())
@@ -116,7 +122,6 @@ class CsRedundant(object):
file.commit()
# conntrackd configuration
- guest = self.address.get_guest_if()
connt = CsFile(self.CONNTRACKD_CONF)
if guest is not None:
connt.section("Multicast {", "}", [
@@ -136,9 +141,6 @@ class CsRedundant(object):
if file.is_changed():
CsHelper.service("keepalived", "restart")
- # FIXME
- # enable/disable_pubip/master/slave etc. will need rewriting to use the new python config
-
# Configure heartbeat cron job
cron = CsFile("/etc/cron.d/heartbeat")
cron.add("SHELL=/bin/bash", 0)