cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [09/13] git commit: updated refs/heads/master to 6fe5ae0
Date Tue, 20 Oct 2015 06:01:14 GMT
CLOUDSTACK-8952 - Do not rely in the router state on the json file to report back to ACS

   - If we stop/start a router, the state in the file will still say MASTER, when it is actually
not
   - Checking the state based on the interface (eth1) state
   - Once master.py is called by keepalived, save the state in the json file to BACKUP just
to make sure it's also written there


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

Branch: refs/heads/master
Commit: 5b3c99031ffa1e2f73fc839d054cb88f6abd802b
Parents: 41f4d8b
Author: Wilder Rodrigues <wrodrigues@schubergphilis.com>
Authored: Sat Oct 17 08:09:52 2015 +0200
Committer: Wilder Rodrigues <wrodrigues@schubergphilis.com>
Committed: Sat Oct 17 12:20:41 2015 +0200

----------------------------------------------------------------------
 systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh | 9 +++++----
 systemvm/patches/debian/config/opt/cloud/bin/master.py      | 2 ++
 .../debian/config/opt/cloud/templates/checkrouter.sh.templ  | 9 +++++----
 3 files changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b3c9903/systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh b/systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh
index 12b2da4..1e4335c 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh
+++ b/systemvm/patches/debian/config/opt/cloud/bin/checkrouter.sh
@@ -16,9 +16,10 @@
 # specific language governing permissions and limitations
 # under the License.
 
-STATUS=$(cat /etc/cloudstack/cmdline.json | grep redundant_state | awk '{print $2;}' | sed
-e 's/[,\"]//g')
-if [ "$?" -ne "0" ]
+STATUS=BACKUP
+ETH1_STATE=$(ip addr | grep eth1 | grep state | awk '{print $9;}')
+if [ $ETH1_STATE = "UP" ]
 then
-	   STATUS=MASTER
+           STATUS=MASTER
 fi
-echo "Status: ${STATUS}"
+echo "Status: ${STATUS}"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b3c9903/systemvm/patches/debian/config/opt/cloud/bin/master.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/master.py b/systemvm/patches/debian/config/opt/cloud/bin/master.py
index fb6ef6a..c3a1539 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/master.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/master.py
@@ -42,7 +42,9 @@ logging.basicConfig(filename=config.get_logger(),
                     format=config.get_format())
 config.cmdline()
 cl = CsCmdLine("cmdline", config)
+#Update the configuration to set state as backup and let keepalived decide who is the real
Master
 cl.set_master_state(False)
+cl.save()
 
 config.set_address()
 red = CsRedundant(config)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b3c9903/systemvm/patches/debian/config/opt/cloud/templates/checkrouter.sh.templ
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/templates/checkrouter.sh.templ b/systemvm/patches/debian/config/opt/cloud/templates/checkrouter.sh.templ
index 12b2da4..1e4335c 100755
--- a/systemvm/patches/debian/config/opt/cloud/templates/checkrouter.sh.templ
+++ b/systemvm/patches/debian/config/opt/cloud/templates/checkrouter.sh.templ
@@ -16,9 +16,10 @@
 # specific language governing permissions and limitations
 # under the License.
 
-STATUS=$(cat /etc/cloudstack/cmdline.json | grep redundant_state | awk '{print $2;}' | sed
-e 's/[,\"]//g')
-if [ "$?" -ne "0" ]
+STATUS=BACKUP
+ETH1_STATE=$(ip addr | grep eth1 | grep state | awk '{print $9;}')
+if [ $ETH1_STATE = "UP" ]
 then
-	   STATUS=MASTER
+           STATUS=MASTER
 fi
-echo "Status: ${STATUS}"
+echo "Status: ${STATUS}"
\ No newline at end of file


Mime
View raw message