You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sw...@apache.org on 2016/05/18 19:53:07 UTC

[1/3] git commit: updated refs/heads/4.7 to ebc70a5

Repository: cloudstack
Updated Branches:
  refs/heads/4.7 9a20ab8bc -> ebc70a51e


Have rVPCs use the router.redundant.vrrp.interval setting

It defaults to 1, which is hardcoded in the template:
./cosmic/cosmic-core/systemvm/patches/debian/config/opt/cloud/templates/keepalived.conf.templ

As non-VPC redundant routers use this setting, I think it makes sense to use it for rVPCs as well.

We also need a change to pickup the cmd_line parameter and use it in the Python code that configures the router.


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

Branch: refs/heads/4.7
Commit: 2bfb12cba994ecf37478a283c873043f2475818e
Parents: bbb2dd0
Author: Remi Bergsma <gi...@remi.nl>
Authored: Wed Mar 23 16:33:20 2016 +0100
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Fri May 13 14:36:23 2016 +0200

----------------------------------------------------------------------
 .../cloud/network/router/VirtualNetworkApplianceManagerImpl.java  | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bfb12cb/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index ac8b868..f7947d5 100644
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -1598,6 +1598,9 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualM
         if (isRedundant) {
             buf.append(" redundant_router=1");
 
+            final int advertInt = NumbersUtil.parseInt(_configDao.getValue(Config.RedundantRouterVrrpInterval.key()), 1);
+            buf.append(" advert_int=").append(advertInt);
+
             final Long vpcId = router.getVpcId();
             final List<DomainRouterVO> routers;
             if (vpcId != null) {


[2/3] git commit: updated refs/heads/4.7 to ebc70a5

Posted by sw...@apache.org.
Configure rVPC for router.redundant.vrrp.interval advert_int setting


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

Branch: refs/heads/4.7
Commit: 9c0eee4387ae2dc0366d0c13f3a3e242d929a3c9
Parents: 2bfb12c
Author: Remi Bergsma <gi...@remi.nl>
Authored: Wed Mar 23 16:56:54 2016 +0100
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Fri May 13 14:37:04 2016 +0200

----------------------------------------------------------------------
 systemvm/patches/debian/config/opt/cloud/bin/cs/CsDatabag.py   | 4 ++++
 systemvm/patches/debian/config/opt/cloud/bin/cs/CsFile.py      | 1 +
 systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py | 3 +++
 3 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9c0eee43/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDatabag.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDatabag.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDatabag.py
index ce490aa..9ccb768 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDatabag.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDatabag.py
@@ -154,3 +154,7 @@ class CsCmdLine(CsDataBag):
             return self.idata()['useextdns']
         return False
 
+    def get_advert_int(self):
+        if 'advert_int' in self.idata():
+            return self.idata()['advert_int']
+        return 1

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9c0eee43/systemvm/patches/debian/config/opt/cloud/bin/cs/CsFile.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsFile.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsFile.py
index 7829c0a..78ad859 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsFile.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsFile.py
@@ -113,6 +113,7 @@ class CsFile:
         self.new_config[sind:eind] = content
 
     def greplace(self, search, replace):
+        logging.debug("Searching for %s and replacing with %s" % (search, replace))
         self.new_config = [w.replace(search, replace) for w in self.new_config]
 
     def search(self, search, replace):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9c0eee43/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 f1ab5f7..f8d2bc2 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
@@ -138,6 +138,9 @@ class CsRedundant(object):
             " router_id ", "    router_id %s" % self.cl.get_name())
         keepalived_conf.search(
             " interface ", "    interface %s" % guest.get_device())
+        keepalived_conf.search(
+            " advert_int ", "    advert_int %s" % self.cl.get_advert_int())
+
         keepalived_conf.greplace("[RROUTER_BIN_PATH]", self.CS_ROUTER_DIR)
         keepalived_conf.section("authentication {", "}", [
                                 "        auth_type AH \n", "        auth_pass %s\n" % self.cl.get_router_password()])


[3/3] git commit: updated refs/heads/4.7 to ebc70a5

Posted by sw...@apache.org.
Merge pull request #1486 from remibergsma/reimplement-vrrp-setting-47

Reimplement router.redundant.vrrp.interval settingGlobal setting `router.redundant.vrrp.interval` is not used any more and it is now set to a hardcoded 1.

This results in a failover from master->backup when the backup doesn't hear from the master in ~3.6sec. This is a bit too tight, as we've seen failovers during live migrations. We could reproduce it in about half of the cases. Setting this to setting to 2 (tested it by hardcoding it in the systemvms) gives twice as much time and we didn't see issues any more. Instead of updating the hardcoded setting from 1 to 2, I reimplemented the global setting by sending it to the router with the cmd_line, as the non-VPC router also does.

Background:
Why is the maximum failover time in the example 3.6 seconds? This comes from the advertisement interval and the skew time. The default advertisement interval is 1 second (configurable in keepalived.conf). The skew time helps to keep everyone from trying to transition at once. It is a number between 0 and 1, based on the formula (256 - priority) / 256

As defined in the RFC, the backup must receive an advertisement from the master every (3 * advert_int) + skew_time seconds. If it doesn't hear anything from the master, it takes over. With a backup router priority of 100 (as in the example), the failover will happen at most 3.6 seconds after the master goes down.

Source: http://www.hollenback.net/KeepalivedForNetworkReliability

* pr/1486:
  Configure rVPC for router.redundant.vrrp.interval advert_int setting
  Have rVPCs use the router.redundant.vrrp.interval setting

Signed-off-by: Will Stevens <wi...@gmail.com>


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

Branch: refs/heads/4.7
Commit: ebc70a51e2c56de6902be7633237613fe8c2df74
Parents: 9a20ab8 9c0eee4
Author: Will Stevens <wi...@gmail.com>
Authored: Wed May 18 15:52:38 2016 -0400
Committer: Will Stevens <wi...@gmail.com>
Committed: Wed May 18 15:52:38 2016 -0400

----------------------------------------------------------------------
 .../cloud/network/router/VirtualNetworkApplianceManagerImpl.java | 3 +++
 systemvm/patches/debian/config/opt/cloud/bin/cs/CsDatabag.py     | 4 ++++
 systemvm/patches/debian/config/opt/cloud/bin/cs/CsFile.py        | 1 +
 systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py   | 3 +++
 4 files changed, 11 insertions(+)
----------------------------------------------------------------------