You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ja...@apache.org on 2014/07/01 11:48:47 UTC
[1/2] git commit: updated refs/heads/4.4-forward to e336796
Repository: cloudstack
Updated Branches:
refs/heads/4.4-forward 285557fb5 -> e336796cd
CLOUDSTACK-7027: Removing left over static nat rule
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a69c1ee3
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a69c1ee3
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a69c1ee3
Branch: refs/heads/4.4-forward
Commit: a69c1ee31d233d4a6f77d68fd70b9cfe3c85f89b
Parents: 285557f
Author: Jayapal <ja...@apache.org>
Authored: Tue Jul 1 12:28:35 2014 +0530
Committer: Jayapal <ja...@apache.org>
Committed: Tue Jul 1 15:16:06 2014 +0530
----------------------------------------------------------------------
.../router/VirtualNetworkApplianceManagerImpl.java | 13 +++++++++++++
1 file changed, 13 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a69c1ee3/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 bf0a6cc..2363841 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -3391,15 +3391,28 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
final IpAddressTO[] ipsToSend = new IpAddressTO[ipAddrList.size()];
int i = 0;
boolean firstIP = true;
+ boolean isSourceNatNw = false;
for (final PublicIpAddress ipAddr : ipAddrList) {
final boolean add = (ipAddr.getState() == IpAddress.State.Releasing ? false : true);
boolean sourceNat = ipAddr.isSourceNat();
+
+ //set the isSourceNatNw from the first ip of ipAddrList
+ //For non source network ips the isSourceNatNw is always false
+ if (sourceNat) {
+ isSourceNatNw = ipAddr.isSourceNat();
+ }
+
/* enable sourceNAT for the first ip of the public interface */
if (firstIP) {
sourceNat = true;
}
+
+ // setting sourceNat=true to make sure the snat rule of the ip is deleted
+ if (!isSourceNatNw && !add ) {
+ sourceNat = true;
+ }
final String vlanId = ipAddr.getVlanTag();
final String vlanGateway = ipAddr.getGateway();
final String vlanNetmask = ipAddr.getNetmask();
[2/2] git commit: updated refs/heads/4.4-forward to e336796
Posted by ja...@apache.org.
CLOUDSTACK-7028: Fixed adding route for additional public nic on fail over
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e336796c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e336796c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e336796c
Branch: refs/heads/4.4-forward
Commit: e336796cd5eae39bf7755d981426160a15bc6e9f
Parents: a69c1ee
Author: Jayapal <ja...@apache.org>
Authored: Tue Jul 1 13:46:44 2014 +0530
Committer: Jayapal <ja...@apache.org>
Committed: Tue Jul 1 15:16:07 2014 +0530
----------------------------------------------------------------------
.../debian/config/etc/init.d/cloud-early-config | 3 +++
.../patches/debian/config/opt/cloud/bin/ipassoc.sh | 7 +++++++
.../config/root/redundant_router/enable_pubip.sh.templ | 13 +++++++++++++
3 files changed, 23 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e336796c/systemvm/patches/debian/config/etc/init.d/cloud-early-config
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/etc/init.d/cloud-early-config b/systemvm/patches/debian/config/etc/init.d/cloud-early-config
index 938e6f8..bbf1998 100755
--- a/systemvm/patches/debian/config/etc/init.d/cloud-early-config
+++ b/systemvm/patches/debian/config/etc/init.d/cloud-early-config
@@ -892,6 +892,9 @@ setup_aesni() {
setup_router() {
log_it "Setting up virtual router system vm"
+ #To save router public interface and gw ip information
+ touch /var/cache/cloud/ifaceGwIp
+
oldmd5=
[ -f "/etc/udev/rules.d/70-persistent-net.rules" ] && oldmd5=$(md5sum "/etc/udev/rules.d/70-persistent-net.rules" | awk '{print $1}')
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e336796c/systemvm/patches/debian/config/opt/cloud/bin/ipassoc.sh
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/ipassoc.sh b/systemvm/patches/debian/config/opt/cloud/bin/ipassoc.sh
index 2a9d780..50f6b4d 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/ipassoc.sh
+++ b/systemvm/patches/debian/config/opt/cloud/bin/ipassoc.sh
@@ -230,6 +230,11 @@ add_first_ip() {
sudo arping -c 1 -I $ethDev -A -U -s $ipNoMask $ipNoMask;
sudo arping -c 1 -I $ethDev -A -U -s $ipNoMask $ipNoMask;
fi
+
+ # add interface gateway ip info into file, used on redundant router fail over for adding routes
+ sed -i /"$ethDev "/d $IFACEGWIPFILE
+ echo "$ethDev $defaultGwIP" >> $IFACEGWIPFILE
+
add_routing $1
return 0
@@ -257,6 +262,7 @@ remove_first_ip() {
sudo ip link set $ethDev down
return 1
fi
+ sed -i /"$ethDev "/d $IFACEGWIPFILE
remove_routing $1
sudo ip link set $ethDev down
return $?
@@ -344,6 +350,7 @@ op=""
is_master=0
is_redundant=0
if_keep_state=0
+IFACEGWIPFILE='/var/cache/cloud/ifaceGwIp'
grep "redundant_router=1" /var/cache/cloud/cmdline > /dev/null
if [ $? -eq 0 ]
then
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e336796c/systemvm/patches/debian/config/root/redundant_router/enable_pubip.sh.templ
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/root/redundant_router/enable_pubip.sh.templ b/systemvm/patches/debian/config/root/redundant_router/enable_pubip.sh.templ
index 0e2d03a..a59cd66 100644
--- a/systemvm/patches/debian/config/root/redundant_router/enable_pubip.sh.templ
+++ b/systemvm/patches/debian/config/root/redundant_router/enable_pubip.sh.templ
@@ -35,3 +35,16 @@ do
fi
done < /tmp/iflist
ip route add default via [GATEWAY] dev eth2
+
+while read line
+do
+dev=$(echo $line | awk '{print $1'})
+gw=$(echo $line | awk '{print $2'})
+
+if [ "$dev" == "eth2" ]
+then
+ continue;
+fi
+ip route add default via $gw table Table_$dev proto static
+
+done < /var/cache/cloud/ifaceGwIp