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/05/07 13:04:01 UTC

git commit: updated refs/heads/master to d4f1670

Repository: cloudstack
Updated Branches:
  refs/heads/master 25b1c037d -> d4f167032


Fixed vpc private gateway backend issues


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

Branch: refs/heads/master
Commit: d4f167032bc114af7535eca027c18096d8d07602
Parents: 25b1c03
Author: Jayapal <ja...@apache.org>
Authored: Wed May 7 16:16:14 2014 +0530
Committer: Jayapal <ja...@apache.org>
Committed: Wed May 7 16:33:46 2014 +0530

----------------------------------------------------------------------
 .../xen/resource/CitrixResourceBase.java        |  1 +
 .../com/cloud/network/vpc/VpcManagerImpl.java   | 27 ++++++++++++--------
 .../config/opt/cloud/bin/vpc_privategw_acl.sh   |  7 ++++-
 3 files changed, 24 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d4f16703/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index e3fbe2e..d5b70aa 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -559,6 +559,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
     public ExecutionResult executeInVR(String routerIP, String script, String args, int timeout) {
         Pair<Boolean, String> result;
         try {
+            s_logger.debug("Executing command in VR:  /opt/cloud/bin/router_proxy.sh " + script + " " + routerIP + " " + args);
             result = SshHelper.sshExecute(_host.ip, 22, _username, null, _password.peek(), "/opt/cloud/bin/router_proxy.sh " + script + " " + routerIP + " " + args,
                     60000, 60000, timeout * 1000);
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d4f16703/server/src/com/cloud/network/vpc/VpcManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
index 3e20cfe..2e627ce 100644
--- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
@@ -1652,10 +1652,14 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
 
         boolean success = true;
         try {
+            List<Provider> providersToImplement = getVpcProviders(vo.getVpcId());
+
             PrivateGateway gateway = getVpcPrivateGateway(gatewayId);
             for (VpcProvider provider : getVpcElements()) {
-                if (!provider.createPrivateGateway(gateway)) {
-                    success = false;
+                if (providersToImplement.contains(provider.getProvider())) {
+                    if (!provider.createPrivateGateway(gateway)) {
+                        success = false;
+                    }
                 }
             }
             if (success) {
@@ -1714,17 +1718,20 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
             });
 
             //1) delete the gateway on the backend
+            List<Provider> providersToImplement = getVpcProviders(gatewayVO.getVpcId());
             PrivateGateway gateway = getVpcPrivateGateway(gatewayId);
             for (VpcProvider provider : getVpcElements()) {
-                if (provider.deletePrivateGateway(gateway)) {
-                    s_logger.debug("Private gateway " + gateway + " was applied succesfully on the backend");
-                } else {
-                    s_logger.warn("Private gateway " + gateway + " failed to apply on the backend");
-                    gatewayVO.setState(VpcGateway.State.Ready);
-                    _vpcGatewayDao.update(gatewayVO.getId(), gatewayVO);
-                    s_logger.debug("Marked gateway " + gatewayVO + " with state " + VpcGateway.State.Ready);
+                if (providersToImplement.contains(provider.getProvider())) {
+                    if (provider.deletePrivateGateway(gateway)) {
+                        s_logger.debug("Private gateway " + gateway + " was applied succesfully on the backend");
+                    } else {
+                        s_logger.warn("Private gateway " + gateway + " failed to apply on the backend");
+                        gatewayVO.setState(VpcGateway.State.Ready);
+                        _vpcGatewayDao.update(gatewayVO.getId(), gatewayVO);
+                        s_logger.debug("Marked gateway " + gatewayVO + " with state " + VpcGateway.State.Ready);
 
-                    return false;
+                        return false;
+                    }
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d4f16703/systemvm/patches/debian/config/opt/cloud/bin/vpc_privategw_acl.sh
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/vpc_privategw_acl.sh b/systemvm/patches/debian/config/opt/cloud/bin/vpc_privategw_acl.sh
index d4e3eba..b585a36 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/vpc_privategw_acl.sh
+++ b/systemvm/patches/debian/config/opt/cloud/bin/vpc_privategw_acl.sh
@@ -155,10 +155,12 @@ acl_entry_for_guest_network() {
 dflag=0
 gflag=0
 aflag=0
+mflag=0
 rules=""
 rules_list=""
 dev=""
-while getopts 'd:a:' OPTION
+mac=""
+while getopts 'd:a:M:' OPTION
 do
   case $OPTION in
   d)    dflag=1
@@ -167,6 +169,9 @@ do
   a)    aflag=1
         rules="$OPTARG"
         ;;
+  M)    mflag=1
+        mac="$OPTARG"
+        ;;
   ?)    usage
                 unlock_exit 2 $lock $locked
         ;;