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:17 UTC
[1/2] git commit: updated refs/heads/master to f45c9f9
Repository: cloudstack
Updated Branches:
refs/heads/master d5e686f2e -> f45c9f9d2
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/2f1b40d2
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2f1b40d2
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2f1b40d2
Branch: refs/heads/master
Commit: 2f1b40d2e89a0e7416897d19bcf12ac1398bb781
Parents: d5e686f
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:27 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/2f1b40d2/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/2f1b40d2/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/2f1b40d2/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
[2/2] git commit: updated refs/heads/master to f45c9f9
Posted by ja...@apache.org.
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/f45c9f9d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f45c9f9d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f45c9f9d
Branch: refs/heads/master
Commit: f45c9f9d2f4185a5e8fb631065700d6dc5987ae4
Parents: 2f1b40d
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:35 2014 +0530
----------------------------------------------------------------------
.../router/VirtualNetworkApplianceManagerImpl.java | 13 +++++++++++++
1 file changed, 13 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f45c9f9d/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 885de83..1068a2f 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -3389,15 +3389,28 @@ VirtualMachineGuru, Listener, Configurable, StateListener<State, VirtualMachine.
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();