cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [20/51] [abbrv] git commit: VPC : bug fix
Date Fri, 15 Jun 2012 22:38:02 GMT
VPC : bug fix


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

Branch: refs/heads/vpc
Commit: 95faedc09f466566657d6a9bbe7bb9284c3ad0c4
Parents: 6ab7a60
Author: anthony <anthony@cloud.com>
Authored: Mon Jun 11 17:05:51 2012 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Fri Jun 15 14:29:47 2012 -0700

----------------------------------------------------------------------
 .../cloud/agent/api/SetupGuestNetworkCommand.java  |    8 ++++++++
 .../xen/resource/CitrixResourceBase.java           |   10 +++++++++-
 .../xen/resource/XenServer56Resource.java          |   10 +++++-----
 .../debian/config/etc/init.d/cloud-early-config    |   10 +++++-----
 .../debian/config/opt/cloud/bin/guestnw.sh         |    5 ++++-
 .../debian/config/opt/cloud/bin/ipassoc.sh         |    6 ++++++
 wscript                                            |    2 +-
 7 files changed, 38 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/95faedc0/api/src/com/cloud/agent/api/SetupGuestNetworkCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/SetupGuestNetworkCommand.java b/api/src/com/cloud/agent/api/SetupGuestNetworkCommand.java
index f5f57c8..1245e6e 100644
--- a/api/src/com/cloud/agent/api/SetupGuestNetworkCommand.java
+++ b/api/src/com/cloud/agent/api/SetupGuestNetworkCommand.java
@@ -32,6 +32,14 @@ public class SetupGuestNetworkCommand extends NetworkElementCommand{
         return nic;
     }
 
+    public String getDefaultDns1() {
+        return defaultDns1;
+    }
+
+    public String getDefaultDns2() {
+        return defaultDns2;
+    }
+
     public String getNetworkDomain() {
         return networkDomain;
     }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/95faedc0/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 07daa4a..d8c8410 100644
--- a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -7038,7 +7038,15 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
         String gw = cmd.getAccessDetail(NetworkElementCommand.GUEST_NETWORK_GATEWAY);
         String cidr = Long.toString(NetUtils.getCidrSize(nic.getNetmask()));;
         String domainName = cmd.getNetworkDomain();
-        String dns = nic.getDns1();
+        String dns = cmd.getDefaultDns1();
+        if (dns == null || dns.isEmpty()) {
+            dns = cmd.getDefaultDns2();
+        } else {
+            String dns2= cmd.getDefaultDns2();
+            if ( dns2 != null && !dns2.isEmpty()) {
+                dns += "," + dns2;
+            }
+        }
         try {
             Set<VM> vms = VM.getByNameLabel(conn, domrName);
             if ( vms == null || vms.isEmpty() ) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/95faedc0/core/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java b/core/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java
index 264cee5..4ad276f 100644
--- a/core/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java
+++ b/core/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java
@@ -144,16 +144,16 @@ public class XenServer56Resource extends CitrixResourceBase {
     protected String networkUsage(Connection conn, final String privateIpAddress, final String
option, final String vif) {
         String args = "netusage.sh " + privateIpAddress + " ";
         if (option.equals("get")) {
-            args = "-g";
+            args += "-g";
         } else if (option.equals("create")) {
-            args = "-c";
+            args += "-c";
         } else if (option.equals("reset")) {
-            args = "-r";
+            args += "-r";
         } else if (option.equals("addVif")) {
-            args = "-a";
+            args += "-a ";
             args += vif;
         } else if (option.equals("deleteVif")) {
-            args = "-d";
+            args += "-d ";
             args += vif;
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/95faedc0/patches/systemvm/debian/config/etc/init.d/cloud-early-config
----------------------------------------------------------------------
diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config
index aba817a..f88e84a 100755
--- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config
+++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config
@@ -330,7 +330,7 @@ setup_common() {
   fi
 
   ip route delete default
-  if [ "$RROUTER" != "1" ]
+  if [ "$RROUTER" != "1" -a -n $GW ]
   then
       if [ -z "$3" ]
       then
@@ -338,12 +338,12 @@ setup_common() {
       else
           ip route add default via $GW dev $3
       fi
+      # a hacking way to activate vSwitch under VMware
+      ping -n -c 3 $GW &
+      sleep 3
+      pkill ping
   fi
  
-  # a hacking way to activate vSwitch under VMware
-  ping -n -c 3 $GW &
-  sleep 3
-  pkill ping
   if [ -n "$MGMTNET"  -a -n "$LOCAL_GW" ]
   then
       ping -n -c 3 $LOCAL_GW &

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/95faedc0/patches/systemvm/debian/config/opt/cloud/bin/guestnw.sh
----------------------------------------------------------------------
diff --git a/patches/systemvm/debian/config/opt/cloud/bin/guestnw.sh b/patches/systemvm/debian/config/opt/cloud/bin/guestnw.sh
index a97e28a..c2e3592 100755
--- a/patches/systemvm/debian/config/opt/cloud/bin/guestnw.sh
+++ b/patches/systemvm/debian/config/opt/cloud/bin/guestnw.sh
@@ -70,10 +70,13 @@ desetup_dnsmasq() {
 
 create_guest_network() {
   logger -t cloud " $(basename $0): Create network on interface $dev,  gateway $gw, network
$ip/$mask "
-
+  # setup ip configuration
   sudo ip addr add dev $dev $ip/$mask
   sudo ip link set $dev up
   sudo arping -c 3 -I $dev -A -U -s $ip $ip;
+  # setup rules to allow dhcp/dns request
+  sudo iptables -A INPUT -i $dev -p udp -m udp --dport 67 -j ACCEPT
+  sudo iptables -A INPUT -i $dev -p udp -m udp --dport 53 -j ACCEPT
 
   # create inbound acl chain
   if sudo iptables -N ACL_INBOUND_$ip 2>/dev/null

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/95faedc0/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh
----------------------------------------------------------------------
diff --git a/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh b/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh
index cfaa46f..1b7b5bf 100755
--- a/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh
+++ b/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh
@@ -182,6 +182,12 @@ add_snat() {
     sudo iptables -t nat -D POSTROUTING   -j SNAT -o $ethDev --to-source $ipNoMask ;
     return 0;
   fi
+  # setup default gateway 
+  sudo ip route | grep default
+  if [ $? -gt 0 ]
+  then 
+    sudo ip route add default via $defaultGwIP dev $ethDev
+  fi
 
   logger -t cloud "$(basename $0):Added SourceNAT $pubIp on interface $ethDev"
   sudo iptables -t nat -D POSTROUTING   -j SNAT -o $ethDev --to-source $ipNoMask ;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/95faedc0/wscript
----------------------------------------------------------------------
diff --git a/wscript b/wscript
index c675e01..7041a99 100644
--- a/wscript
+++ b/wscript
@@ -5,7 +5,7 @@
 # if you change 'em here, you need to change it also in cloud.spec, add a %changelog entry
there, and add an entry in debian/changelog
 
 
-VERSION = '3.0.3.2012-06-11T23:14:43Z'
+VERSION = '3.0.3.2012-06-11T22:40:12Z'
 APPNAME = 'cloud'
 
 import shutil,os


Mime
View raw message