incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mlsoren...@apache.org
Subject [14/50] [abbrv] Merge branch 'master' into network-refactor-merge2
Date Fri, 18 Jan 2013 22:23:44 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cadca5fc/server/src/com/cloud/network/firewall/FirewallManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/network/firewall/FirewallManagerImpl.java
index 60c5bf3,340e872..7bab1ba
--- a/server/src/com/cloud/network/firewall/FirewallManagerImpl.java
+++ b/server/src/com/cloud/network/firewall/FirewallManagerImpl.java
@@@ -75,10 -66,8 +75,9 @@@ import com.cloud.user.Account
  import com.cloud.user.AccountManager;
  import com.cloud.user.DomainManager;
  import com.cloud.user.UserContext;
- import com.cloud.utils.IdentityProxy;
  import com.cloud.utils.Pair;
  import com.cloud.utils.Ternary;
 +import com.cloud.utils.component.Adapters;
  import com.cloud.utils.component.Inject;
  import com.cloud.utils.component.Manager;
  import com.cloud.utils.db.DB;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cadca5fc/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cadca5fc/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 2a2a625,717da05..e1c78e1
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@@ -803,15 -823,18 +826,18 @@@ public class VirtualNetworkApplianceMan
                      String privateIP = router.getPrivateIpAddress();
  
                      if (privateIP != null) {
+                         boolean forVpc = router.getVpcId() != null;
                          List<? extends Nic> routerNics = _nicDao.listByVmId(router.getId());
                          for (Nic routerNic : routerNics) {
 -                            Network network = _networkMgr.getNetwork(routerNic.getNetworkId());
 +                            Network network = _networkModel.getNetwork(routerNic.getNetworkId());
-                             if (network.getTrafficType() == TrafficType.Public) {
-                                 boolean forVpc = router.getVpcId() != null;
+                             //Send network usage command for public nic in VPC VR
+                             //Send network usage command for isolated guest nic of non VPC
VR                            
+                             if ((forVpc && network.getTrafficType() == TrafficType.Public)
|| (!forVpc && network.getTrafficType() == TrafficType.Guest && network.getGuestType()
== Network.GuestType.Isolated)) {
                                  final NetworkUsageCommand usageCmd = new NetworkUsageCommand(privateIP,
router.getHostName(),
                                          forVpc, routerNic.getIp4Address());
-                                 UserStatisticsVO previousStats = _statsDao.findBy(router.getAccountId(),

-                                         router.getDataCenterIdToDeployIn(), network.getId(),
null, router.getId(), router.getType().toString());
+                                 String routerType = router.getType().toString();
+                                 UserStatisticsVO previousStats = _statsDao.findBy(router.getAccountId(),
+                                         router.getDataCenterIdToDeployIn(), network.getId(),
(forVpc ? routerNic.getIp4Address() : null), router.getId(), routerType);
                                  NetworkUsageAnswer answer = null;
                                  try {
                                      answer = (NetworkUsageAnswer) _agentMgr.easySend(router.getHostId(),
usageCmd);
@@@ -1653,8 -1697,15 +1702,15 @@@
              if (hasGuestNetwork) {
                  defaultNic.setDeviceId(2);
              }
 -            NetworkOfferingVO publicOffering = _networkMgr.getSystemAccountNetworkOfferings(NetworkOfferingVO.SystemPublicNetwork).get(0);
 +            NetworkOffering publicOffering = _networkModel.getSystemAccountNetworkOfferings(NetworkOffering.SystemPublicNetwork).get(0);
              List<NetworkVO> publicNetworks = _networkMgr.setupNetwork(_systemAcct,
publicOffering, plan, null, null, false);
+             String publicIp = defaultNic.getIp4Address();
+             // We want to use the identical MAC address for RvR on public interface if possible
+             NicVO peerNic = _nicDao.findByIp4AddressAndNetworkId(publicIp, publicNetworks.get(0).getId());
+             if (peerNic != null) {
+                 s_logger.info("Use same MAC as previous RvR, the MAC is " + peerNic.getMacAddress());
+                 defaultNic.setMacAddress(peerNic.getMacAddress());
+             }
              networks.add(new Pair<NetworkVO, NicProfile>(publicNetworks.get(0), defaultNic));
          }
  

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cadca5fc/server/src/com/cloud/network/rules/RulesManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/network/rules/RulesManagerImpl.java
index 1548afe,a75aca3..fc12660
--- a/server/src/com/cloud/network/rules/RulesManagerImpl.java
+++ b/server/src/com/cloud/network/rules/RulesManagerImpl.java
@@@ -1173,15 -1170,14 +1173,14 @@@ public class RulesManagerImpl implement
  
          // if network has elastic IP functionality supported, we first have to disable static
nat on old ip in order to
          // re-enable it on the new one enable static nat takes care of that
 -        Network guestNetwork = _networkMgr.getNetwork(ipAddress.getAssociatedWithNetworkId());
 +        Network guestNetwork = _networkModel.getNetwork(ipAddress.getAssociatedWithNetworkId());
          NetworkOffering offering = _configMgr.getNetworkOffering(guestNetwork.getNetworkOfferingId());
          if (offering.getElasticIp()) {
-             if (offering.getAssociatePublicIP()) {
-                 getSystemIpAndEnableStaticNatForVm(_vmDao.findById(vmId), true);
-                 return true;
-             }
+             getSystemIpAndEnableStaticNatForVm(_vmDao.findById(vmId), true);
+             return true;
+         } else {
+             return disableStaticNat(ipId, caller, ctx.getCallerUserId(), false);
          }
-         return disableStaticNat(ipId, caller, ctx.getCallerUserId(), false);
      }
  
      @Override
@@@ -1364,14 -1360,9 +1363,9 @@@
          // enable static nat if eIp capability is supported
          List<? extends Nic> nics = _nicDao.listByVmId(vm.getId());
          for (Nic nic : nics) {
 -            Network guestNetwork = _networkMgr.getNetwork(nic.getNetworkId());
 +            Network guestNetwork = _networkModel.getNetwork(nic.getNetworkId());
              NetworkOffering offering = _configMgr.getNetworkOffering(guestNetwork.getNetworkOfferingId());
              if (offering.getElasticIp()) {
-                 boolean isSystemVM = (vm.getType() == Type.ConsoleProxy || vm.getType()
== Type.SecondaryStorageVm);
-                 // for user VM's associate public IP only if offering is marked to associate
a public IP by default on start of VM
-                 if (!isSystemVM && !offering.getAssociatePublicIP()) {
-                     continue;
-                 }
                  // check if there is already static nat enabled
                  if (_ipAddressDao.findByAssociatedVmId(vm.getId()) != null && !getNewIp)
{
                      s_logger.debug("Vm " + vm + " already has ip associated with it in guest
network " + guestNetwork);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cadca5fc/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cadca5fc/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cadca5fc/server/src/com/cloud/network/vpc/VpcManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/network/vpc/VpcManagerImpl.java
index e95c54f,7448cc3..fa6bd30
--- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
@@@ -987,9 -981,9 +987,9 @@@ public class VpcManagerImpl implements 
                      //skip my own network
                      continue;
                  } else {
 -                    if (_ntwkMgr.areServicesSupportedInNetwork(network.getId(), Service.Lb))
{
 +                    if (_ntwkModel.areServicesSupportedInNetwork(network.getId(), Service.Lb))
{
                          throw new InvalidParameterValueException("LB service is already
supported " +
-                         		"by network " + network + " in VPC " + vpc);
+                                 "by network " + network + " in VPC " + vpc);
                      }
                  }
              }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cadca5fc/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cadca5fc/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cadca5fc/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cadca5fc/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/vm/UserVmManagerImpl.java
index a437e1f,a6fbdb1..5891056
mode 100644,100755..100644
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@@ -2208,10 -2214,10 +2216,10 @@@ public class UserVmManagerImpl implemen
                      }
  
                  }
 -
 -                _networkMgr.checkNetworkPermissions(owner, network);
 +                
 +                _networkModel.checkNetworkPermissions(owner, network);
  
-                 //don't allow to use system networks 
+                 //don't allow to use system networks
                  NetworkOffering networkOffering = _configMgr.getNetworkOffering(network.getNetworkOfferingId());
                  if (networkOffering.isSystemOnly()) {
                      throw new InvalidParameterValueException("Network id=" + networkId +
" is system only and can't be used for vm deployment");
@@@ -3582,9 -3508,9 +3510,9 @@@
                              throw ex;
                          }
  
 -                        _networkMgr.checkNetworkPermissions(newAccount, network);
 +                        _networkModel.checkNetworkPermissions(newAccount, network);
  
-                         //don't allow to use system networks 
+                         //don't allow to use system networks
                          NetworkOffering networkOffering = _configMgr.getNetworkOffering(network.getNetworkOfferingId());
                          if (networkOffering.isSystemOnly()) {
                              InvalidParameterValueException ex = new InvalidParameterValueException("Specified
Network id is system only and can't be used for vm deployment");

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cadca5fc/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------

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

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cadca5fc/server/test/com/cloud/network/security/SecurityGroupManagerImpl2Test.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cadca5fc/server/test/com/cloud/user/MockDomainManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cadca5fc/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
----------------------------------------------------------------------
diff --cc server/test/com/cloud/vpc/MockNetworkManagerImpl.java
index 1a3cbae,642ea10..78d2ea2
--- a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
@@@ -553,12 -430,8 +551,12 @@@ public class MockNetworkManagerImpl imp
          return null;
      }
  
 +
 +
 +
 +
      /* (non-Javadoc)
-      * @see com.cloud.network.NetworkService#listTrafficTypeImplementor(com.cloud.api.commands.ListTrafficTypeImplementorsCmd)
+      * @see com.cloud.network.NetworkService#listTrafficTypeImplementor(org.apache.cloudstack.api.commands.ListTrafficTypeImplementorsCmd)
       */
      @Override
      public List<Pair<TrafficType, String>> listTrafficTypeImplementor(ListTrafficTypeImplementorsCmd
cmd) {
@@@ -649,17 -530,12 +647,17 @@@
          return null;
      }
  
 +
 +
 +
 +
      /* (non-Javadoc)
-      * @see com.cloud.network.NetworkManager#setupNetwork(com.cloud.user.Account, com.cloud.offerings.NetworkOfferingVO,
com.cloud.network.Network, com.cloud.deploy.DeploymentPlan, java.lang.String, java.lang.String,
boolean, java.lang.Long, com.cloud.acl.ControlledEntity.ACLType, java.lang.Boolean, java.lang.Long)
+      * @see com.cloud.network.NetworkManager#setupNetwork(com.cloud.user.Account, com.cloud.offerings.NetworkOfferingVO,
com.cloud.network.Network, com.cloud.deploy.DeploymentPlan, java.lang.String, java.lang.String,
boolean, java.lang.Long, org.apache.cloudstack.acl.ControlledEntity.ACLType, java.lang.Boolean,
java.lang.Long)
       */
      @Override
 -    public List<NetworkVO> setupNetwork(Account owner, NetworkOfferingVO offering,
Network predefined, DeploymentPlan plan, String name, String displayText, boolean errorIfAlreadySetup,
Long domainId, ACLType aclType,
 -            Boolean subdomainAccess, Long vpcId) throws ConcurrentOperationException {
 +    public List<NetworkVO> setupNetwork(Account owner, NetworkOffering offering, Network
predefined,
 +            DeploymentPlan plan, String name, String displayText, boolean errorIfAlreadySetup,
Long domainId,
 +            ACLType aclType, Boolean subdomainAccess, Long vpcId) throws ConcurrentOperationException
{
          // TODO Auto-generated method stub
          return null;
      }
@@@ -814,18 -722,12 +812,18 @@@
          return false;
      }
  
 +
 +
 +
 +
      /* (non-Javadoc)
-      * @see com.cloud.network.NetworkManager#createGuestNetwork(long, java.lang.String,
java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String,
com.cloud.user.Account, java.lang.Long, com.cloud.network.PhysicalNetwork, long, com.cloud.acl.ControlledEntity.ACLType,
java.lang.Boolean, java.lang.Long)
+      * @see com.cloud.network.NetworkManager#createGuestNetwork(long, java.lang.String,
java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String,
com.cloud.user.Account, java.lang.Long, com.cloud.network.PhysicalNetwork, long, org.apache.cloudstack.acl.ControlledEntity.ACLType,
java.lang.Boolean, java.lang.Long)
       */
      @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) throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException
{
 +    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)
 +            throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException
{
          // TODO Auto-generated method stub
          return null;
      }
@@@ -1253,14 -1477,41 +1251,41 @@@
  
  
      /* (non-Javadoc)
 -     * @see com.cloud.network.NetworkManager#getNetworkLockTimeout()
 +     * @see com.cloud.network.NetworkManager#finalizeServicesAndProvidersForNetwork(com.cloud.offering.NetworkOffering,
java.lang.Long)
       */
      @Override
 -    public int getNetworkLockTimeout() {
 +    public Map<String, String> finalizeServicesAndProvidersForNetwork(NetworkOffering
offering, Long physicalNetworkId) {
          // TODO Auto-generated method stub
 -        return 0;
 +        return null;
      }
  
-     
+     @Override
+     public boolean isNetworkInlineMode(Network network) {
+         // TODO Auto-generated method stub
+         return false;
+     }
+ 
+     @Override
+     public List<Provider> getProvidersForServiceInNetwork(Network network, Service
service) {
+         // TODO Auto-generated method stub
+         return null;
+     }
+ 
+     @Override
+     public StaticNatServiceProvider getStaticNatProviderForNetwork(Network network) {
+         // TODO Auto-generated method stub
+         return null;
+     }
+ 
+     @Override
+     public int getRuleCountForIp(Long addressId, Purpose purpose, State state) {
+         // TODO Auto-generated method stub
+         return 0;
+     }
  
+     @Override
+     public LoadBalancingServiceProvider getLoadBalancingProviderForNetwork(Network network)
{
+         // TODO Auto-generated method stub
+         return null;
+     }
  }


Mime
View raw message