Skip to content

Commit 6b9e2ac

Browse files
Merge pull request apache#800 from bvbharatk/CLOUDSTACK-8798
CLOUDSTACK-8798 Fixed the vrrp virtual ip config in case of rvr enablFixed the vrrp virtual ip config in case of rvr enabled isolated networks. changed the CsRedundant.py to bring down the public interface when rvr changes state to backup. Also fixed vrrp authentication for isolated networks. This fix dose not effect the vpc networks. it is only meant for rvr isolated networks. manullay deployed a vm in rvr enabled isolated network and ran the tests below. nosetests --with-marvin --marvin-config=/marvin-config test/integration/component/test_redundant_router_services.py Test redundant router internals ... === TestName: test_enableVPNOverRvR | Status : SUCCESS === ---------------------------------------------------------------------- Ran 1 test in 633.336s nosetests --with-marvin --marvin-config=/marvin-config test/integration/component/test_redundant_router_cleanups.py Test network garbage collection with RVR ... === TestName: test_network_gc | Status : SUCCESS === ok Test restarting RvR network without cleanup ... === TestName: test_restart_ntwk_no_cleanup | Status : SUCCESS === ok Test restart RvR network with cleanup ... === TestName: test_restart_ntwk_with_cleanup | Status : SUCCESS === ---------------------------------------------------------------------- Ran 3 tests in 2120.263s * pr/800: CLOUDSTACK-8798 Fixed the vrrp virtual ip config in case of rvr enabled isolated networks. changed the CsRedundant.py to bring down the public interface when rvr changes state to backup. Also fixed vrrp authentication for isolated networks. Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2 parents b66dcda + 6f68ecc commit 6b9e2ac

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

‎systemvm/patches/debian/config/opt/cloud/bin/cs/CsDatabag.py‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ def get_vpccidr(self):
9797
else:
9898
return "unknown"
9999

100+
def get_eth2_ip(self):
101+
if "eth2ip" in self.idata():
102+
return self.idata()['eth2ip']
103+
else:
104+
return "unknown"
105+
100106
def is_master(self):
101107
if not self.is_redundant():
102108
return False
@@ -130,7 +136,10 @@ def get_router_password(self):
130136
This is slightly difficult to happen, but if it does, destroy the router with the password generated with the
131137
code below and restart the VPC with out the clean up option.
132138
'''
133-
passwd = "%s-%s" % (self.get_vpccidr, self.get_router_id())
139+
if(self.get_type()=='router'):
140+
passwd="%s-%s" % (self.get_eth2_ip(), self.get_router_id())
141+
else:
142+
passwd = "%s-%s" % (self.get_vpccidr(), self.get_router_id())
134143
md5 = hashlib.md5()
135144
md5.update(passwd)
136145
return md5.hexdigest()

‎systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def set_backup(self):
236236
if dev == o.get_device():
237237
continue
238238
logging.info("Bringing public interface %s down" % o.get_device())
239-
cmd2 = "ip link set %s up" % o.get_device()
239+
cmd2 = "ip link set %s down" % o.get_device()
240240
CsHelper.execute(cmd2)
241241
dev = o.get_device()
242242
cmd = "%s -C %s" % (self.CONNTRACKD_BIN, self.CONNTRACKD_CONF)
@@ -306,8 +306,11 @@ def _collect_ips(self):
306306
lines = []
307307
for o in self.address.get_ips():
308308
if o.needs_vrrp():
309-
str = " %s brd %s dev %s\n" % (
310-
o.get_gateway_cidr(), o.get_broadcast(), o.get_device())
309+
cmdline=self.config.get_cmdline_instance()
310+
if(cmdline.get_type()=='router'):
311+
str = " %s brd %s dev %s\n" % (cmdline.get_guest_gw(), o.get_broadcast(), o.get_device())
312+
else:
313+
str = " %s brd %s dev %s\n" % (o.get_ip(), o.get_broadcast(), o.get_device())
311314
lines.append(str)
312315
self.check_is_up(o.get_device())
313316
return lines

0 commit comments

Comments
 (0)