cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ro...@apache.org
Subject [cloudstack] 20/30: rvr fixes
Date Wed, 13 Dec 2017 10:43:34 GMT
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch debian9-systemvmtemplate
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 939466d095169df4c7d3df3dbe19073396f75a1b
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
AuthorDate: Mon Dec 11 18:14:05 2017 +0530

    rvr fixes
    
    Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
---
 systemvm/debian/opt/cloud/bin/cs/CsRedundant.py    | 11 ++--
 systemvm/debian/opt/cloud/bin/setup/common.sh      | 61 ----------------------
 systemvm/debian/opt/cloud/bin/setup/router.sh      |  5 --
 systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh   |  5 --
 .../opt/cloud/templates/keepalived.conf.templ      |  1 -
 5 files changed, 7 insertions(+), 76 deletions(-)

diff --git a/systemvm/debian/opt/cloud/bin/cs/CsRedundant.py b/systemvm/debian/opt/cloud/bin/cs/CsRedundant.py
index 108f337..29b5028 100755
--- a/systemvm/debian/opt/cloud/bin/cs/CsRedundant.py
+++ b/systemvm/debian/opt/cloud/bin/cs/CsRedundant.py
@@ -75,6 +75,10 @@ class CsRedundant(object):
     def _redundant_off(self):
         CsHelper.service("conntrackd", "stop")
         CsHelper.service("keepalived", "stop")
+        CsHelper.umount_tmpfs(self.CS_RAMDISK_DIR)
+        CsHelper.rmdir(self.CS_RAMDISK_DIR)
+        CsHelper.rm(self.CONNTRACKD_CONF)
+        CsHelper.rm(self.KEEPALIVED_CONF)
 
     def _redundant_on(self):
         guest = self.address.get_guest_if()
@@ -107,10 +111,9 @@ class CsRedundant(object):
             CsHelper.service("keepalived", "stop")
             return
 
-        # setup_router should execute this already:
-        # CsHelper.mkdir(self.CS_RAMDISK_DIR, 0755, False)
-        # CsHelper.mount_tmpfs(self.CS_RAMDISK_DIR)
-        # CsHelper.mkdir(self.CS_ROUTER_DIR, 0755, False)
+        CsHelper.mkdir(self.CS_RAMDISK_DIR, 0755, False)
+        CsHelper.mount_tmpfs(self.CS_RAMDISK_DIR)
+        CsHelper.mkdir(self.CS_ROUTER_DIR, 0755, False)
         for s in self.CS_TEMPLATES:
             d = s
             if s.endswith(".templ"):
diff --git a/systemvm/debian/opt/cloud/bin/setup/common.sh b/systemvm/debian/opt/cloud/bin/setup/common.sh
index 76ec826..f1f72f4 100755
--- a/systemvm/debian/opt/cloud/bin/setup/common.sh
+++ b/systemvm/debian/opt/cloud/bin/setup/common.sh
@@ -609,67 +609,6 @@ routing_svcs() {
    fi
 }
 
-setup_redundant_router() {
-    rrouter_bin_path="/ramdisk/rrouter"
-    rrouter_log="/ramdisk/rrouter/keepalived.log"
-    rrouter_bin_path_str="\/ramdisk\/rrouter"
-    rrouter_log_str="\/ramdisk\/rrouter\/keepalived.log"
-    mkdir -p /ramdisk
-    mount tmpfs /ramdisk -t tmpfs
-    mkdir -p /ramdisk/rrouter
-    ip route delete default
-
-    # Seed keepalived
-    if [ "$RROUTER_STATE" == "MASTER" ]
-    then
-        sed -i "s/priority.*/priority 100/g" /opt/cloud/templates/keepalived.conf.templ
-    else
-        sed -i "s/priority.*/priority 50/g" /opt/cloud/templates/keepalived.conf.templ
-    fi
-    cp /opt/cloud/templates/keepalived.conf.templ /etc/keepalived/keepalived.conf # changes!
-    sed -i "s/\[ROUTER_ID\]/$NAME/g" /etc/keepalived/keepalived.conf
-    sed -i "s/\[ROUTER_IP\]/$GUEST_GW\/$GUEST_CIDR_SIZE/g" /etc/keepalived/keepalived.conf
#fixme, multiple ips?
-    sed -i "s/\[BOARDCAST\]/$GUEST_BRD/g" /etc/keepalived/keepalived.conf
-    sed -i "s/\[PRIORITY\]/$ROUTER_PR/g" /etc/keepalived/keepalived.conf
-    sed -i "s/\[PASS\]/$VM_PASSWORD/g" /etc/keepalived/keepalived.conf
-    sed -i "s/\[RROUTER_BIN_PATH\]/$rrouter_bin_path_str/g" /etc/keepalived/keepalived.conf
-    sed -i "s/\[DELTA\]/2/g" /etc/keepalived/keepalived.conf
-    sed -i "s/--exec\ \$DAEMON;/--exec\ \$DAEMON\ --\ --vrrp;/g" /etc/init.d/keepalived
-    if [ $ADVERT_INT ]
-    then
-        sed -i "s/advert_int 1/advert_int $ADVERT_INT/g" /etc/keepalived/keepalived.conf
-    fi
-    chmod -x /etc/keepalived/keepalived.conf
-
-    # Seed conntrackd
-    cp /opt/cloud/templates/conntrackd.conf.templ /etc/conntrackd/conntrackd.conf
-    sed -i "s/\[LINK_IF\]/eth0/g" /etc/conntrackd/conntrackd.conf
-    sed -i "s/\[LINK_IP\]/$ETH0_IP/g" /etc/conntrackd/conntrackd.conf
-    sed -i "s/\[IGNORE_IP1\]/$GUEST_GW/g" /etc/conntrackd/conntrackd.conf # checkme?
-    sed -i "s/\[IGNORE_IP2\]/$ETH0_IP/g" /etc/conntrackd/conntrackd.conf
-    sed -i "s/\[IGNORE_IP3\]/$ETH1_IP/g" /etc/conntrackd/conntrackd.conf
-
-    # ramdisk scripts
-    cp /opt/cloud/templates/heartbeat.sh.templ $rrouter_bin_path/heartbeat.sh
-    cp /opt/cloud/templates/check_heartbeat.sh.templ $rrouter_bin_path/check_heartbeat.sh
-    cp /opt/cloud/templates/arping_gateways.sh.templ $rrouter_bin_path/arping_gateways.sh
-    cp /opt/cloud/templates/check_bumpup.sh $rrouter_bin_path/
-    cp /opt/cloud/templates/checkrouter.sh.templ /opt/cloud/bin/checkrouter.sh # changes!
-    #sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" /opt/cloud/bin/checkrouter.sh
-
-    sed -i "s/\[RROUTER_BIN_PATH\]/$rrouter_bin_path_str/g" $rrouter_bin_path/heartbeat.sh
-    sed -i "s/\[RROUTER_BIN_PATH\]/$rrouter_bin_path_str/g" $rrouter_bin_path/check_heartbeat.sh
-    sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/check_heartbeat.sh
-    sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/arping_gateways.sh
-    chmod a+x $rrouter_bin_path/*.sh
-
-    crontab -l|grep "check_heartbeat.sh"
-    if [ $? -ne 0 ]
-    then
-        (crontab -l; echo -e "SHELL=/bin/bash\nPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n*
* * * * $rrouter_bin_path/check_heartbeat.sh 2>&1 > /dev/null") | crontab
-    fi
-}
-
 parse_cmd_line() {
   CMDLINE=$(cat /var/cache/cloud/cmdline)
   TYPE="unknown"
diff --git a/systemvm/debian/opt/cloud/bin/setup/router.sh b/systemvm/debian/opt/cloud/bin/setup/router.sh
index 3bd4224..c3141f8 100755
--- a/systemvm/debian/opt/cloud/bin/setup/router.sh
+++ b/systemvm/debian/opt/cloud/bin/setup/router.sh
@@ -49,11 +49,6 @@ setup_router() {
       fi
   fi
 
-  if [ -n "$ETH2_IP" -a "$RROUTER" == "1" ]
-  then
-    setup_redundant_router
-  fi
-
   log_it "Checking udev NIC assignment order changes"
   if [ "$NIC_MACS" != "" ]
   then
diff --git a/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh b/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh
index 5ed09c7..106cfd6 100755
--- a/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh
+++ b/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh
@@ -73,11 +73,6 @@ EOF
      fi
   fi
 
-  if [ "$RROUTER" == "1" ]
-  then
-    setup_redundant_router
-  fi
-
   ip route delete default
   # create route table for static route
 
diff --git a/systemvm/debian/opt/cloud/templates/keepalived.conf.templ b/systemvm/debian/opt/cloud/templates/keepalived.conf.templ
index bf896f9..722a9e7 100644
--- a/systemvm/debian/opt/cloud/templates/keepalived.conf.templ
+++ b/systemvm/debian/opt/cloud/templates/keepalived.conf.templ
@@ -28,7 +28,6 @@ vrrp_instance inside_network {
     state BACKUP
     interface eth2
     virtual_router_id 51
-    priority 50
     nopreempt
 
     advert_int 1

-- 
To stop receiving notification emails like this one, please contact
"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>.

Mime
View raw message