cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ni...@apache.org
Subject [5/5] git commit: updated refs/heads/cs2163 to f84b6ab
Date Mon, 13 May 2013 12:01:37 GMT
merge with master


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

Branch: refs/heads/cs2163
Commit: f84b6abde022b4578acc432f03a81c53839282b4
Parents: 8d53b1e 052c24c
Author: Nitin Mehta <nitin.mehta@citrix.com>
Authored: Mon May 13 17:30:42 2013 +0530
Committer: Nitin Mehta <nitin.mehta@citrix.com>
Committed: Mon May 13 17:30:42 2013 +0530

----------------------------------------------------------------------
 api/src/com/cloud/agent/api/to/DnsmasqTO.java      |   53 +++
 .../exception/MissingParameterValueException.java  |   25 +
 .../cloud/network/element/DhcpServiceProvider.java |    2 +
 api/src/com/cloud/vm/NicIpAlias.java               |   45 ++
 client/tomcatconf/applicationContext.xml.in        |    1 +
 .../agent/api/routing/CreateIpAliasCommand.java    |   36 ++
 .../agent/api/routing/DeleteIpAliasCommand.java    |   50 +++
 .../agent/api/routing/DnsMasqConfigCommand.java    |   65 +++
 .../src/com/cloud/agent/api/routing/IpAliasTO.java |   42 ++
 .../virtualnetwork/VirtualRoutingResource.java     |  117 ++++-
 .../src/com/cloud/network/DnsMasqConfigurator.java |  118 +++++
 engine/schema/src/com/cloud/dc/dao/VlanDao.java    |    6 +-
 .../schema/src/com/cloud/dc/dao/VlanDaoImpl.java   |   38 +-
 .../src/com/cloud/network/dao/IPAddressDao.java    |    8 +-
 .../com/cloud/network/dao/IPAddressDaoImpl.java    |   39 +-
 engine/schema/src/com/cloud/vm/dao/NicDao.java     |    6 +-
 engine/schema/src/com/cloud/vm/dao/NicDaoImpl.java |   19 +-
 .../storage/volume/VolumeServiceImpl.java          |    5 +-
 .../systemvm/debian/config/root/createIpAlias.sh   |   35 ++
 .../systemvm/debian/config/root/deleteIpAlias.sh   |   43 ++
 patches/systemvm/debian/config/root/dnsmasq.sh     |   43 ++
 .../networkservice/BaremetalDhcpElement.java       |   41 +-
 .../hypervisor/vmware/resource/VmwareResource.java |  199 +++++++--
 .../xen/resource/CitrixResourceBase.java           |  166 +++++--
 .../com/cloud/network/element/MidoNetElement.java  |   59 ++-
 scripts/vm/hypervisor/xenserver/createipAlias.sh   |   26 ++
 scripts/vm/hypervisor/xenserver/deleteipAlias.sh   |   25 +
 scripts/vm/hypervisor/xenserver/vmops              |   45 ++-
 scripts/vm/hypervisor/xenserver/xcpserver/patch    |    2 +
 scripts/vm/hypervisor/xenserver/xenserver56/patch  |    2 +
 .../vm/hypervisor/xenserver/xenserver56fp1/patch   |    2 +
 scripts/vm/hypervisor/xenserver/xenserver60/patch  |    2 +
 .../cloud/configuration/ConfigurationManager.java  |    2 -
 .../configuration/ConfigurationManagerImpl.java    |  344 ++++++++++++---
 server/src/com/cloud/network/NetworkManager.java   |    4 +
 .../src/com/cloud/network/NetworkManagerImpl.java  |   30 ++-
 server/src/com/cloud/network/addr/PublicIp.java    |    4 +
 .../network/element/VirtualRouterElement.java      |   59 +++
 .../router/VirtualNetworkApplianceManager.java     |   13 +-
 .../router/VirtualNetworkApplianceManagerImpl.java |  273 ++++++++++--
 server/src/com/cloud/vm/dao/NicIpAliasDao.java     |   61 +++
 server/src/com/cloud/vm/dao/NicIpAliasDaoImpl.java |  186 ++++++++
 server/src/com/cloud/vm/dao/NicIpAliasVO.java      |  226 ++++++++++
 .../cloud/configuration/ValidateIpRangeTest.java   |   71 +++
 .../com/cloud/network/MockNetworkManagerImpl.java  |   11 +
 .../cloud/vpc/MockConfigurationManagerImpl.java    |   71 ++--
 .../test/com/cloud/vpc/MockNetworkManagerImpl.java |   25 +-
 .../vpc/MockVpcVirtualNetworkApplianceManager.java |   10 +
 .../networkoffering/CreateNetworkOfferingTest.java |   29 +-
 server/test/resources/createNetworkOffering.xml    |   21 +-
 setup/db/db/schema-410to420.sql                    |   20 +-
 51 files changed, 2456 insertions(+), 369 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f84b6abd/client/tomcatconf/applicationContext.xml.in
----------------------------------------------------------------------
diff --cc client/tomcatconf/applicationContext.xml.in
index d85839e,1bd2f82..6406660
--- a/client/tomcatconf/applicationContext.xml.in
+++ b/client/tomcatconf/applicationContext.xml.in
@@@ -258,8 -258,8 +258,9 @@@
    <bean id="networkRuleConfigDaoImpl" class="com.cloud.network.dao.NetworkRuleConfigDaoImpl"
/>
    <bean id="networkServiceMapDaoImpl" class="com.cloud.network.dao.NetworkServiceMapDaoImpl"
/>
    <bean id="nicDaoImpl" class="com.cloud.vm.dao.NicDaoImpl" />
 +  <bean id="nicDetailDaoImpl" class="com.cloud.vm.dao.NicDetailDaoImpl" />
    <bean id="nicSecondaryIpDaoImpl" class="com.cloud.vm.dao.NicSecondaryIpDaoImpl" />
+   <bean id="nicIpAliasDaoImpl" class="com.cloud.vm.dao.NicIpAliasDaoImpl" />
    <bean id="objectInDataStoreDaoImpl" class="org.apache.cloudstack.storage.db.ObjectInDataStoreDaoImpl"
/>
    <bean id="ovsTunnelInterfaceDaoImpl" class="com.cloud.network.ovs.dao.OvsTunnelInterfaceDaoImpl"
/>
    <bean id="ovsTunnelNetworkDaoImpl" class="com.cloud.network.ovs.dao.OvsTunnelNetworkDaoImpl"
/>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f84b6abd/server/src/com/cloud/configuration/ConfigurationManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f84b6abd/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 87fd8ff,ce2493c..55e7b7e
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@@ -2464,11 -2538,69 +2540,69 @@@ public class ConfigurationManagerImpl e
          return vlan;
      }
  
+     public boolean validateIpRange(String startIP, String endIP, String newVlanGateway,
String newVlanNetmask, List<VlanVO> vlans, boolean ipv4, boolean ipv6, String ip6Gateway,
String ip6Cidr, String startIPv6, String endIPv6, Network network) {
+         String vlanGateway;
+         String vlanNetmask;
+         boolean sameSubnet = false;
+         if ( vlans != null && vlans.size() > 0 ) {
+ 
+             for (VlanVO vlan : vlans) {
+                 if (ipv4) {
+                     vlanGateway = vlan.getVlanGateway();
+                     vlanNetmask = vlan.getVlanNetmask();
+                     // Check if ip addresses are in network range
+                     if (!NetUtils.sameSubnet(startIP, vlanGateway, vlanNetmask)) {
+                         if (!NetUtils.sameSubnet(endIP, vlanGateway, vlanNetmask)) {
+                                 // check if the the new subnet is not a superset of the
existing subnets.
+                                 if (NetUtils.isNetworkAWithinNetworkB(NetUtils.getCidrFromGatewayAndNetmask(vlanGateway,vlanNetmask),
NetUtils.ipAndNetMaskToCidr(startIP, newVlanNetmask))){
+                                     throw new InvalidParameterValueException ("The new subnet
is a superset of the existing subnet");
+                                 }
+                                 // check if the new subnet is not a subset of the existing
subnet.
+                                 if (NetUtils.isNetworkAWithinNetworkB(NetUtils.ipAndNetMaskToCidr(startIP,
newVlanNetmask), NetUtils.getCidrFromGatewayAndNetmask(vlanGateway,vlanNetmask))){
+                                     throw  new InvalidParameterValueException("The new subnet
is a subset of the existing subnet");
+                                 }
+                         }
+                     } else if (NetUtils.sameSubnet(endIP, vlanGateway, vlanNetmask)){
+                         // trying to add to the same subnet.
+                         sameSubnet = true;
+                         if (newVlanGateway == null) {
+                             newVlanGateway = vlanGateway;
+                         }
+                         if (!newVlanGateway.equals(vlanGateway)){
+                             throw new InvalidParameterValueException("The gateway of the
ip range is not same as the gateway of the subnet.");
+                         }
+                         break;
+                     }
+                     else {
+                         throw new InvalidParameterValueException("Start ip and End ip is
not in vlan range!");
+                     }
+                 }
+                 if (ipv6) {
+                     if (ip6Gateway != null && !ip6Gateway.equals(network.getIp6Gateway()))
{
+                        throw new InvalidParameterValueException("The input gateway " + ip6Gateway
+ " is not same as network gateway " + network.getIp6Gateway());
+                     }
+                     if (ip6Cidr != null && !ip6Cidr.equals(network.getIp6Cidr()))
{
+                        throw new InvalidParameterValueException("The input cidr " + ip6Cidr
+ " is not same as network ciddr " + network.getIp6Cidr());
+                     }
+                     ip6Gateway = network.getIp6Gateway();
+                     ip6Cidr = network.getIp6Cidr();
+                     _networkModel.checkIp6Parameters(startIPv6, endIPv6, ip6Gateway, ip6Cidr);
+                 }
+             }
+             if (sameSubnet == false) {
+                 if (newVlanGateway ==null)  {
+                     throw  new MissingParameterValueException("The gateway for the new subnet
is not specified.");
+                 }
+             }
+         }
+         return  sameSubnet;
+     }
+ 
      @Override
      @DB
 -    public Vlan createVlanAndPublicIpRange(long zoneId, long networkId, long physicalNetworkId,
boolean forVirtualNetwork, Long podId, 
 -            String startIP, String endIP, String vlanGateway, String vlanNetmask,
 -            String vlanId, Account vlanOwner, String startIPv6, String endIPv6, String vlanIp6Gateway,
String vlanIp6Cidr) {
 +    public Vlan createVlanAndPublicIpRange(long zoneId, long networkId, long physicalNetworkId,
boolean forVirtualNetwork, Long podId,
 +                                           String startIP, String endIP, String vlanGateway,
String vlanNetmask,
 +                                           String vlanId, Account vlanOwner, String startIPv6,
String endIPv6, String vlanIp6Gateway, String vlanIp6Cidr) {
          Network network = _networkModel.getNetwork(networkId);
          
          boolean ipv4 = false, ipv6 = false;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f84b6abd/server/src/com/cloud/network/NetworkManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f84b6abd/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f84b6abd/server/test/com/cloud/network/MockNetworkManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f84b6abd/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f84b6abd/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f84b6abd/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------


Mime
View raw message