cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From muralire...@apache.org
Subject [50/50] [abbrv] git commit: updated refs/heads/regionvpc to edf12eb
Date Tue, 11 Mar 2014 14:27:12 GMT
create streched L2 networks if the network offering permits streched L2
subnet capability


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

Branch: refs/heads/regionvpc
Commit: edf12ebc1ea18d0f006f82727d4315e183956848
Parents: a36d31a
Author: Murali Reddy <muralimmreddy@gmail.com>
Authored: Tue Mar 11 19:38:46 2014 +0530
Committer: Murali Reddy <muralimmreddy@gmail.com>
Committed: Tue Mar 11 19:53:26 2014 +0530

----------------------------------------------------------------------
 api/src/com/cloud/network/Network.java                   |  2 ++
 api/src/org/apache/cloudstack/api/ApiConstants.java      |  1 +
 .../apache/cloudstack/api/response/NetworkResponse.java  |  8 ++++++++
 .../service/NetworkOrchestrationService.java             |  6 +++---
 .../src/com/cloud/network/vpc/VpcManager.java            |  2 +-
 .../engine/orchestration/NetworkOrchestrator.java        | 11 ++++++-----
 engine/schema/src/com/cloud/network/dao/NetworkVO.java   | 11 +++++++++++
 server/src/com/cloud/api/ApiResponseHelper.java          |  1 +
 server/src/com/cloud/network/NetworkServiceImpl.java     |  9 +++++----
 server/src/com/cloud/network/vpc/VpcManagerImpl.java     |  2 +-
 server/test/com/cloud/vpc/MockNetworkManagerImpl.java    |  2 +-
 setup/db/db/schema-430to440.sql                          |  1 +
 12 files changed, 41 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edf12ebc/api/src/com/cloud/network/Network.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/Network.java b/api/src/com/cloud/network/Network.java
index 88f23f0..0f5212e 100644
--- a/api/src/com/cloud/network/Network.java
+++ b/api/src/com/cloud/network/Network.java
@@ -338,4 +338,6 @@ public interface Network extends ControlledEntity, StateObject<Network.State>,
I
     Long getNetworkACLId();
 
     void setNetworkACLId(Long networkACLId);
+
+    boolean isStrechedL2Network();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edf12ebc/api/src/org/apache/cloudstack/api/ApiConstants.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java
index 5f87c73..ae6c5b0 100755
--- a/api/src/org/apache/cloudstack/api/ApiConstants.java
+++ b/api/src/org/apache/cloudstack/api/ApiConstants.java
@@ -589,6 +589,7 @@ public class ApiConstants {
     public static final String SUPPORTS_REGION_LEVEL_VPC = "supportsregionLevelvpc";
     public static final String SUPPORTS_STRECHED_L2_SUBNET = "supportsstrechedl2subnet";
     public static final String REGION_LEVEL_VPC = "regionlevelvpc";
+    public static final String STRECHED_L2_SUBNET = "strechedl2subnet";
 
     public enum HostDetails {
         all, capacity, events, stats, min;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edf12ebc/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/NetworkResponse.java b/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
index bf92aa4..197a4ad 100644
--- a/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
@@ -216,6 +216,10 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
     @Param(description = "ACL Id associated with the VPC network")
     private String aclId;
 
+    @SerializedName(ApiConstants.STRECHED_L2_SUBNET)
+    @Param(description = "true if network can span multiple zones")
+    private Boolean strechedL2Subnet;
+
     public Boolean getDisplayNetwork() {
         return displayNetwork;
     }
@@ -412,4 +416,8 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
     public void setAclId(String aclId) {
         this.aclId = aclId;
     }
+
+    public void setStrechedL2Subnet(Boolean strechedL2Subnet) {
+        this.strechedL2Subnet = strechedL2Subnet;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edf12ebc/engine/api/src/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java
b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java
index 1061c4d..75a6f25 100755
--- a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java
+++ b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java
@@ -70,11 +70,11 @@ public interface NetworkOrchestrationService {
     static final ConfigKey<Integer> NetworkThrottlingRate = new ConfigKey<Integer>("Network",
Integer.class, NetworkThrottlingRateCK, "200",
         "Default data transfer rate in megabits per second allowed in network.", true, ConfigKey.Scope.Zone);
 
-    List<? extends Network> setupNetwork(Account owner, NetworkOffering offering, DeploymentPlan
plan, String name, String displayText, boolean isDefault)
+    List<? extends Network> setupNetwork(Account owner, NetworkOffering offering, DeploymentPlan
plan, String name, String displayText, boolean isDefault, boolean strechedL2Subnet)
         throws ConcurrentOperationException;
 
     List<? extends Network> setupNetwork(Account owner, NetworkOffering offering, Network
predefined, DeploymentPlan plan, String name, String displayText,
-        boolean errorIfAlreadySetup, Long domainId, ACLType aclType, Boolean subdomainAccess,
Long vpcId, Boolean isDisplayNetworkEnabled)
+        boolean errorIfAlreadySetup, Long domainId, ACLType aclType, Boolean subdomainAccess,
Long vpcId, Boolean isDisplayNetworkEnabled, boolean strechedL2Subnet)
         throws ConcurrentOperationException;
 
     void allocate(VirtualMachineProfile vm, LinkedHashMap<? extends Network, List<?
extends NicProfile>> networks) throws InsufficientCapacityException,
@@ -129,7 +129,7 @@ public interface NetworkOrchestrationService {
 
     Network createGuestNetwork(long networkOfferingId, String name, String displayText, String
gateway, String cidr, String vlanId, String networkDomain, Account owner,
         Long domainId, PhysicalNetwork physicalNetwork, long zoneId, ACLType aclType, Boolean
subdomainAccess, Long vpcId, String ip6Gateway, String ip6Cidr,
-        Boolean displayNetworkEnabled, String isolatedPvlan) throws ConcurrentOperationException,
InsufficientCapacityException, ResourceAllocationException;
+        Boolean displayNetworkEnabled, String isolatedPvlan, boolean strechedL2Subnet) throws
ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException;
 
     UserDataServiceProvider getPasswordResetProvider(Network network);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edf12ebc/engine/components-api/src/com/cloud/network/vpc/VpcManager.java
----------------------------------------------------------------------
diff --git a/engine/components-api/src/com/cloud/network/vpc/VpcManager.java b/engine/components-api/src/com/cloud/network/vpc/VpcManager.java
index 8539871..e244376 100644
--- a/engine/components-api/src/com/cloud/network/vpc/VpcManager.java
+++ b/engine/components-api/src/com/cloud/network/vpc/VpcManager.java
@@ -109,7 +109,7 @@ public interface VpcManager {
     Network
         createVpcGuestNetwork(long ntwkOffId, String name, String displayText, String gateway,
String cidr, String vlanId, String networkDomain, Account owner,
             Long domainId, PhysicalNetwork pNtwk, long zoneId, ACLType aclType, Boolean subdomainAccess,
long vpcId, Long aclId, Account caller,
-            Boolean displayNetworkEnabled)
+            Boolean displayNetworkEnabled, boolean strechedL2Subnet)
 
             throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException;
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edf12ebc/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index 7853c3b..6b52162 100755
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -589,16 +589,16 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
     }
 
     @Override
-    public List<? extends Network> setupNetwork(Account owner, NetworkOffering offering,
DeploymentPlan plan, String name, String displayText, boolean isDefault)
+    public List<? extends Network> setupNetwork(Account owner, NetworkOffering offering,
DeploymentPlan plan, String name, String displayText, boolean isDefault, boolean strechedL2Subnet)
             throws ConcurrentOperationException {
-        return setupNetwork(owner, offering, null, plan, name, displayText, false, null,
null, null, null, true);
+        return setupNetwork(owner, offering, null, plan, name, displayText, false, null,
null, null, null, true, strechedL2Subnet);
     }
 
     @Override
     @DB
     public List<? extends Network> setupNetwork(final Account owner, final NetworkOffering
offering, final Network predefined, final DeploymentPlan plan, final String name,
             final String displayText, boolean errorIfAlreadySetup, final Long domainId, final
ACLType aclType, final Boolean subdomainAccess, final Long vpcId,
-            final Boolean isDisplayNetworkEnabled) throws ConcurrentOperationException {
+            final Boolean isDisplayNetworkEnabled, final boolean strechedL2Subnet) throws
ConcurrentOperationException {
 
         Account locked = _accountDao.acquireInLockTable(owner.getId());
         if (locked == null) {
@@ -659,6 +659,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
                         NetworkVO vo = new NetworkVO(id, network, offering.getId(), guru.getName(),
owner.getDomainId(), owner.getId(), relatedFile, name, displayText, predefined
                                 .getNetworkDomain(), offering.getGuestType(), plan.getDataCenterId(),
plan.getPhysicalNetworkId(), aclType, offering.getSpecifyIpRanges(), vpcId);
                         vo.setDisplayNetwork(isDisplayNetworkEnabled == null ? true : isDisplayNetworkEnabled);
+                        vo.setStrechedL2Network(strechedL2Subnet);
                         networks.add(_networksDao.persist(vo, vo.getGuestType() == Network.GuestType.Isolated,
                                 finalizeServicesAndProvidersForNetwork(offering, plan.getPhysicalNetworkId())));
 
@@ -1628,7 +1629,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
     @DB
     public Network createGuestNetwork(long networkOfferingId, final String name, final String
displayText, final String gateway, final String cidr, String vlanId,
             String networkDomain, final Account owner, final Long domainId, final PhysicalNetwork
pNtwk, final long zoneId, final ACLType aclType, Boolean subdomainAccess,
-            final Long vpcId, final String ip6Gateway, final String ip6Cidr, final Boolean
isDisplayNetworkEnabled, final String isolatedPvlan)
+            final Long vpcId, final String ip6Gateway, final String ip6Cidr, final Boolean
isDisplayNetworkEnabled, final String isolatedPvlan, boolean strechedL2Subnet)
             throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException
{
 
         final NetworkOfferingVO ntwkOff = _networkOfferingDao.findById(networkOfferingId);
@@ -1895,7 +1896,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
                 }
 
                 List<? extends Network> networks = setupNetwork(owner, ntwkOff, userNetwork,
plan, name, displayText, true, domainId, aclType, subdomainAccessFinal, vpcId,
-                        isDisplayNetworkEnabled);
+                        isDisplayNetworkEnabled, false);
 
                 Network network = null;
                 if (networks == null || networks.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edf12ebc/engine/schema/src/com/cloud/network/dao/NetworkVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/NetworkVO.java b/engine/schema/src/com/cloud/network/dao/NetworkVO.java
index 13e8dbf..67bbd2e 100644
--- a/engine/schema/src/com/cloud/network/dao/NetworkVO.java
+++ b/engine/schema/src/com/cloud/network/dao/NetworkVO.java
@@ -167,6 +167,9 @@ public class NetworkVO implements Network {
     @Column(name = "network_acl_id")
     Long networkACLId;
 
+    @Column(name = "streched_l2")
+    boolean strechedL2Network = false;
+
     public NetworkVO() {
         uuid = UUID.randomUUID().toString();
     }
@@ -588,5 +591,13 @@ public class NetworkVO implements Network {
     @Override
     public IAMEntityType getEntityType() {
         return IAMEntityType.Network;
+
+    @Override
+    public boolean isStrechedL2Network() {
+        return strechedL2Network;
+    }
+
+    public void setStrechedL2Network(boolean strechedL2Network) {
+        this.strechedL2Network = strechedL2Network;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edf12ebc/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index c0ddaf3..75d1db8 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -2188,6 +2188,7 @@ public class ApiResponseHelper implements ResponseGenerator {
             }
         }
 
+        response.setStrechedL2Subnet(network.isStrechedL2Network());
         response.setObjectName("network");
         return response;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edf12ebc/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index ebeb31a..e42f9da 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -1251,7 +1251,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService
{
 
         Network network = commitNetwork(networkOfferingId, gateway, startIP, endIP, netmask,
networkDomain, vlanId, name, displayText, caller, physicalNetworkId, zoneId, domainId,
                 isDomainSpecific, subdomainAccess, vpcId, startIPv6, endIPv6, ip6Gateway,
ip6Cidr, displayNetwork, aclId, isolatedPvlan, ntwkOff, pNtwk, aclType, owner, cidr,
-                createVlan);
+                createVlan, ntwkOff.getSupportsStrechedL2());
 
         // if the network offering has persistent set to true, implement the network
         if (ntwkOff.getIsPersistent()) {
@@ -1284,7 +1284,8 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService
{
             final String vlanId, final String name, final String displayText, final Account
caller, final Long physicalNetworkId, final Long zoneId, final Long domainId,
             final boolean isDomainSpecific, final Boolean subdomainAccessFinal, final Long
vpcId, final String startIPv6, final String endIPv6, final String ip6Gateway,
             final String ip6Cidr, final Boolean displayNetwork, final Long aclId, final String
isolatedPvlan, final NetworkOfferingVO ntwkOff, final PhysicalNetwork pNtwk,
-            final ACLType aclType, final Account ownerFinal, final String cidr, final boolean
createVlan) throws InsufficientCapacityException, ResourceAllocationException {
+            final ACLType aclType, final Account ownerFinal, final String cidr, final boolean
createVlan,
+            final boolean strechedL2Subnet) throws InsufficientCapacityException, ResourceAllocationException
{
         try {
             return Transaction.execute(new TransactionCallbackWithException<Network, Exception>()
{
                 @Override
@@ -1329,7 +1330,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService
{
                             }
                         }
                         network = _vpcMgr.createVpcGuestNetwork(networkOfferingId, name,
displayText, gateway, cidr, vlanId, networkDomain, owner, sharedDomainId, pNtwk, zoneId,
-                                aclType, subdomainAccess, vpcId, aclId, caller, displayNetwork);
+                                aclType, subdomainAccess, vpcId, aclId, caller, displayNetwork,
strechedL2Subnet);
                     } else {
                         if (_configMgr.isOfferingForVpc(ntwkOff)) {
                             throw new InvalidParameterValueException("Network offering can
be used for VPC networks only");
@@ -1339,7 +1340,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService
{
                         }
 
                         network = _networkMgr.createGuestNetwork(networkOfferingId, name,
displayText, gateway, cidr, vlanId, networkDomain, owner, sharedDomainId, pNtwk, zoneId,
-                                aclType, subdomainAccess, vpcId, ip6Gateway, ip6Cidr, displayNetwork,
isolatedPvlan);
+                                aclType, subdomainAccess, vpcId, ip6Gateway, ip6Cidr, displayNetwork,
isolatedPvlan, strechedL2Subnet);
                     }
 
                     if (caller.getType() == Account.ACCOUNT_TYPE_ADMIN && createVlan)
{

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edf12ebc/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 a45abc2..bddad50 100644
--- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
@@ -2189,7 +2189,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager,
VpcProvis
     @Override
     public Network createVpcGuestNetwork(long ntwkOffId, String name, String displayText,
String gateway, String cidr, String vlanId, String networkDomain,
         Account owner, Long domainId, PhysicalNetwork pNtwk, long zoneId, ACLType aclType,
Boolean subdomainAccess, long vpcId, Long aclId, Account caller,
-        Boolean isDisplayNetworkEnabled) throws ConcurrentOperationException, InsufficientCapacityException,
ResourceAllocationException {
+        Boolean isDisplayNetworkEnabled, boolean strechedL2Subnet) throws ConcurrentOperationException,
InsufficientCapacityException, ResourceAllocationException {
 
         Vpc vpc = getActiveVpc(vpcId);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edf12ebc/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
index ac303dd..3b38b78 100644
--- a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
@@ -606,7 +606,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkOrches
     @Override
     public Network createGuestNetwork(long networkOfferingId, String name, String displayText,
String gateway, String cidr, String vlanId, String networkDomain,
         Account owner, Long domainId, PhysicalNetwork physicalNetwork, long zoneId, ACLType
aclType, Boolean subdomainAccess, Long vpcId, String gatewayv6,
-        String cidrv6, Boolean displayNetworkEnabled, String isolatedPvlan) throws ConcurrentOperationException,
InsufficientCapacityException,
+        String cidrv6, Boolean displayNetworkEnabled, String isolatedPvlan, boolean strechedL2Subnet)
throws ConcurrentOperationException, InsufficientCapacityException,
         ResourceAllocationException {
         // TODO Auto-generated method stub
         return null;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edf12ebc/setup/db/db/schema-430to440.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql
index 4b38468..0b4740e 100644
--- a/setup/db/db/schema-430to440.sql
+++ b/setup/db/db/schema-430to440.sql
@@ -614,3 +614,4 @@ CREATE TABLE `cloud`.`vgpu_types` (
 ALTER TABLE `cloud`.`vpc_offerings` ADD COLUMN supports_region_level_vpc boolean default
false;
 ALTER TABLE `cloud`.`network_offerings` ADD COLUMN supports_streched_l2 boolean default false;
 ALTER TABLE `cloud`.`vpc` ADD COLUMN region_level_vpc boolean default false;
+ALTER TABLE `cloud`.`networks` ADD COLUMN streched_l2 boolean default false;


Mime
View raw message