Repository: cloudstack
Updated Branches:
  refs/heads/4.4-forward 648a724df -> 99f75db1e


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/99f75db1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/99f75db1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/99f75db1

Branch: refs/heads/4.4-forward
Commit: 99f75db1ebd35f5afa897e9d94ed176668e04cd5
Parents: 648a724
Author: Jayapal <[email protected]>
Authored: Wed May 7 16:16:14 2014 +0530
Committer: Jayapal <[email protected]>
Committed: Wed May 7 16:17:22 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/99f75db1/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 d01076a..49ffaa5 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
@@ -563,6 +563,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/99f75db1/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 da9cc9b..ad078fc 100644
--- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
@@ -1653,10 +1653,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) {
@@ -1715,17 +1719,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/99f75db1/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
         ;;

Reply via email to