cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [44/46] git commit: updated refs/heads/internallb to b7709b8
Date Tue, 16 Apr 2013 18:34:49 GMT
InternalLB: allow to specify more than one provider for the LB service when create network offering as diff providers can support internal and public LB for the same network


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

Branch: refs/heads/internallb
Commit: b3b16bae48976c027e3439f2e0a84cfb2cb72166
Parents: a4fc1d7
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Mon Apr 15 17:00:31 2013 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Tue Apr 16 09:50:07 2013 -0700

----------------------------------------------------------------------
 api/src/com/cloud/network/NetworkModel.java        |    4 +-
 api/src/com/cloud/offering/NetworkOffering.java    |    6 +-
 .../element/InternalLoadBalancerElement.java       |    1 -
 .../cloud/configuration/ConfigurationManager.java  |    4 +-
 .../configuration/ConfigurationManagerImpl.java    |   74 ++++++++++-----
 server/src/com/cloud/network/NetworkManager.java   |    3 +-
 .../src/com/cloud/network/NetworkManagerImpl.java  |   50 ++++++++--
 server/src/com/cloud/network/NetworkModelImpl.java |   10 +-
 .../cloud/network/dao/NetworkServiceMapDao.java    |    1 +
 .../network/dao/NetworkServiceMapDaoImpl.java      |    9 ++
 .../network/lb/LoadBalancingRulesManagerImpl.java  |   28 ++++--
 .../cloud/offerings/NetworkOfferingDetailsVO.java  |   16 ++-
 .../cloud/offerings/dao/NetworkOfferingDao.java    |    3 +-
 .../offerings/dao/NetworkOfferingDaoImpl.java      |   14 ++-
 .../offerings/dao/NetworkOfferingDetailsDao.java   |    7 +-
 .../dao/NetworkOfferingDetailsDaoImpl.java         |   31 ++++++-
 .../com/cloud/network/MockNetworkManagerImpl.java  |    8 +-
 .../com/cloud/network/MockNetworkModelImpl.java    |    3 +-
 .../cloud/vpc/MockConfigurationManagerImpl.java    |    2 +-
 .../test/com/cloud/vpc/MockNetworkManagerImpl.java |    7 +-
 .../test/com/cloud/vpc/MockNetworkModelImpl.java   |    3 +-
 .../vpc/dao/MockNetworkServiceMapDaoImpl.java      |    6 +
 22 files changed, 204 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/api/src/com/cloud/network/NetworkModel.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/NetworkModel.java b/api/src/com/cloud/network/NetworkModel.java
index 3c11bfa..44773ad 100644
--- a/api/src/com/cloud/network/NetworkModel.java
+++ b/api/src/com/cloud/network/NetworkModel.java
@@ -33,6 +33,7 @@ import com.cloud.network.Networks.TrafficType;
 import com.cloud.network.element.NetworkElement;
 import com.cloud.network.element.UserDataServiceProvider;
 import com.cloud.offering.NetworkOffering;
+import com.cloud.offering.NetworkOffering.Detail;
 import com.cloud.user.Account;
 import com.cloud.vm.Nic;
 import com.cloud.vm.NicProfile;
@@ -268,6 +269,5 @@ public interface NetworkModel {
 
     List<String> getUsedIpsInNetwork(Network network);
 
-    Map<String, String> getNtwkOffDetails(long offId);
-
+    Map<Detail, String> getNtwkOffDetails(long offId);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/api/src/com/cloud/offering/NetworkOffering.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/offering/NetworkOffering.java b/api/src/com/cloud/offering/NetworkOffering.java
index 4174359..80b340a 100644
--- a/api/src/com/cloud/offering/NetworkOffering.java
+++ b/api/src/com/cloud/offering/NetworkOffering.java
@@ -41,9 +41,9 @@ public interface NetworkOffering extends InfrastructureEntity, InternalIdentity,
         Enabled
     }
     
-    public enum Details {
-        internalLbProvider,
-        publicLbProvider
+    public enum Detail {
+        InternalLbProvider,
+        PublicLbProvider
     }
 
     public final static String SystemPublicNetwork = "System-Public-Network";

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/element/InternalLoadBalancerElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/element/InternalLoadBalancerElement.java b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/element/InternalLoadBalancerElement.java
index 1ff1cab..2d10e51 100644
--- a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/element/InternalLoadBalancerElement.java
+++ b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/element/InternalLoadBalancerElement.java
@@ -30,7 +30,6 @@ import javax.inject.Inject;
 import org.apache.cloudstack.api.command.admin.internallb.ConfigureInternalLoadBalancerElementCmd;
 import org.apache.cloudstack.api.command.admin.internallb.CreateInternalLoadBalancerElementCmd;
 import org.apache.cloudstack.api.command.admin.internallb.ListInternalLoadBalancerElementsCmd;
-import org.apache.cloudstack.network.lb.ApplicationLoadBalancerRuleVO;
 import org.apache.cloudstack.network.lb.InternalLoadBalancerManager;
 import org.apache.cloudstack.network.lb.dao.ApplicationLoadBalancerRuleDao;
 import org.apache.log4j.Logger;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/src/com/cloud/configuration/ConfigurationManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManager.java b/server/src/com/cloud/configuration/ConfigurationManager.java
index 237d4a1..d6e08d0 100755
--- a/server/src/com/cloud/configuration/ConfigurationManager.java
+++ b/server/src/com/cloud/configuration/ConfigurationManager.java
@@ -30,13 +30,13 @@ import com.cloud.dc.Vlan;
 import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.exception.InsufficientCapacityException;
 import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.ResourceAllocationException;
 import com.cloud.network.Network;
 import com.cloud.network.Network.Capability;
 import com.cloud.network.Network.Provider;
 import com.cloud.network.Network.Service;
 import com.cloud.network.Networks.TrafficType;
 import com.cloud.offering.DiskOffering;
+import com.cloud.offering.NetworkOffering;
 import com.cloud.offering.NetworkOffering.Availability;
 import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.org.Grouping.AllocationState;
@@ -204,7 +204,7 @@ public interface ConfigurationManager extends ConfigurationService, Manager {
 
     NetworkOfferingVO createNetworkOffering(String name, String displayText, TrafficType trafficType, String tags, boolean specifyVlan, Availability availability, Integer networkRate, Map<Service, Set<Provider>> serviceProviderMap,
             boolean isDefault, Network.GuestType type, boolean systemOnly, Long serviceOfferingId, boolean conserveMode, Map<Service, Map<Capability, String>> serviceCapabilityMap,
-            boolean specifyIpRanges, boolean isPersistent, Map<String, String> details);
+            boolean specifyIpRanges, boolean isPersistent, Map<NetworkOffering.Detail,String> details);
 
     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) throws InsufficientCapacityException, ConcurrentOperationException, InvalidParameterValueException;
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 8310d38..f1758b9 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -126,10 +126,12 @@ import com.cloud.network.dao.PhysicalNetworkDao;
 import com.cloud.network.dao.PhysicalNetworkTrafficTypeDao;
 import com.cloud.network.dao.PhysicalNetworkTrafficTypeVO;
 import com.cloud.network.dao.PhysicalNetworkVO;
+import com.cloud.network.rules.LoadBalancerContainer.Scheme;
 import com.cloud.network.vpc.VpcManager;
 import com.cloud.offering.DiskOffering;
 import com.cloud.offering.NetworkOffering;
 import com.cloud.offering.NetworkOffering.Availability;
+import com.cloud.offering.NetworkOffering.Detail;
 import com.cloud.offering.ServiceOffering;
 import com.cloud.offerings.NetworkOfferingServiceMapVO;
 import com.cloud.offerings.NetworkOfferingVO;
@@ -3198,7 +3200,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
         Network.GuestType guestType = null;
         boolean specifyIpRanges = cmd.getSpecifyIpRanges();
         boolean isPersistent = cmd.getIsPersistent();
-        Map<String, String> details = cmd.getDetails();
+        Map<String, String> detailsStr = cmd.getDetails();
 
         // Verify traffic type
         for (TrafficType tType : TrafficType.values()) {
@@ -3291,10 +3293,10 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
                 Network.Service service = Network.Service.getService(serviceStr);
                 if (serviceProviderMap.containsKey(service)) {
                     Set<Provider> providers = new HashSet<Provider>();
-                    // in Acton, don't allow to specify more than 1 provider per service
-                    if (svcPrv.get(serviceStr) != null && svcPrv.get(serviceStr).size() > 1) {
+                    // Allow to specify more than 1 provider per service only if the service is LB
+                    if (!serviceStr.equalsIgnoreCase(Service.Lb.getName()) && svcPrv.get(serviceStr) != null && svcPrv.get(serviceStr).size() > 1) {
                         throw new InvalidParameterValueException("In the current release only one provider can be " +
-                        		"specified for the service");
+                        		"specified for the service if the service is not LB");
                     }
                     for (String prvNameStr : svcPrv.get(serviceStr)) {
                         // check if provider is supported
@@ -3367,6 +3369,21 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
             firewallProviderSet.add(firewallProvider);
             serviceProviderMap.put(Service.Firewall, firewallProviderSet);
         }
+        
+        Map<NetworkOffering.Detail, String> details = new HashMap<NetworkOffering.Detail, String>();
+        for (String detailStr : detailsStr.keySet()) {
+            NetworkOffering.Detail offDetail = null;
+            for (NetworkOffering.Detail supportedDetail: NetworkOffering.Detail.values()) {
+                if (detailStr.equalsIgnoreCase(supportedDetail.toString())) {
+                    offDetail = supportedDetail;
+                    break;
+                }
+            }
+            if (offDetail == null) {
+                throw new InvalidParameterValueException("Unsupported detail " + detailStr);
+            }
+            details.put(offDetail, detailsStr.get(detailStr));
+        }
 
         return createNetworkOffering(name, displayText, trafficType, tags, specifyVlan, availability, networkRate, serviceProviderMap, false, guestType, false,
                 serviceOfferingId, conserveMode, serviceCapabilityMap, specifyIpRanges, isPersistent, details);
@@ -3457,7 +3474,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
     @DB
     public NetworkOfferingVO createNetworkOffering(String name, String displayText, TrafficType trafficType, String tags, boolean specifyVlan, Availability availability, Integer networkRate,
             Map<Service, Set<Provider>> serviceProviderMap, boolean isDefault, Network.GuestType type, boolean systemOnly, Long serviceOfferingId,
-            boolean conserveMode, Map<Service, Map<Capability, String>> serviceCapabilityMap, boolean specifyIpRanges, boolean isPersistent, Map<String, String> details) {
+            boolean conserveMode, Map<Service, Map<Capability, String>> serviceCapabilityMap, boolean specifyIpRanges, boolean isPersistent, Map<NetworkOffering.Detail,String> details) {
 
         String multicastRateStr = _configDao.getValue("multicast.throttling.rate");
         int multicastRate = ((multicastRateStr == null) ? 10 : Integer.parseInt(multicastRateStr));
@@ -3614,26 +3631,37 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
         return offering;
     }
 
-    protected void validateNtwkOffDetails(Map<String, String> details, Map<Service, Set<Provider>> serviceProviderMap) {
-        for (String key : details.keySet()) {
-            NetworkOffering.Details detail = null;
-            for (NetworkOffering.Details value : NetworkOffering.Details.values()) {
-                if (key.equalsIgnoreCase(value.toString())) {
-                    detail = value;
-                    break;
+    protected void validateNtwkOffDetails(Map<Detail, String> details, Map<Service, Set<Provider>> serviceProviderMap) {
+        for (Detail detail : details.keySet()) {
+            
+            Provider lbProvider = null;
+            if (detail == NetworkOffering.Detail.InternalLbProvider || detail == NetworkOffering.Detail.PublicLbProvider) {
+                //1) Vaidate the detail values - have to match the lb provider name
+                String providerStr = details.get(detail);
+                if (Network.Provider.getProvider(providerStr) == null) {
+                    throw new InvalidParameterValueException("Invalid value " + providerStr + " for the detail " + detail);
                 }
-            }
-            if (detail == null) {
-                throw new InvalidParameterValueException("Unsupported detail key");
-            }
-            if (detail == NetworkOffering.Details.internalLbProvider || detail == NetworkOffering.Details.publicLbProvider) {
-                Provider provider = Network.Provider.getProvider(details.get(key));
-                if (provider == null) {
-                    throw new InvalidParameterValueException("Invalid value for the key " + key);
+                if (serviceProviderMap.get(Service.Lb) != null) {
+                    for (Provider provider : serviceProviderMap.get(Service.Lb)) {
+                        if (provider.getName().equalsIgnoreCase(providerStr)) {
+                            lbProvider = provider;
+                            break;
+                        }
+                    }
+                } 
+                
+                if (lbProvider == null) {
+                    throw new InvalidParameterValueException("Invalid value " + details.get(detail)
+                            + " for the detail " + detail + ". The provider is not supported by the network offering");
                 }
-                Set<Provider> providers = serviceProviderMap.get(Service.Lb);
-                if (providers == null || !providers.contains(details.get(key))) {
-                    throw new InvalidParameterValueException("Invalid value for the key " + key + ". The provider is not supported by the network offering");
+                
+                //2) validate if the provider supports the scheme
+                Set<Provider> lbProviders = new HashSet<Provider>();
+                lbProviders.add(lbProvider);
+                if (detail == NetworkOffering.Detail.InternalLbProvider) {
+                    _networkModel.checkCapabilityForProvider(lbProviders, Service.Lb, Capability.LbSchemes, Scheme.Internal.toString());
+                } else if (detail == NetworkOffering.Detail.PublicLbProvider){
+                    _networkModel.checkCapabilityForProvider(lbProviders, Service.Lb, Capability.LbSchemes, Scheme.Public.toString());
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/src/com/cloud/network/NetworkManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManager.java b/server/src/com/cloud/network/NetworkManager.java
index 4af716c..34a092a 100755
--- a/server/src/com/cloud/network/NetworkManager.java
+++ b/server/src/com/cloud/network/NetworkManager.java
@@ -43,6 +43,7 @@ import com.cloud.network.element.StaticNatServiceProvider;
 import com.cloud.network.element.UserDataServiceProvider;
 import com.cloud.network.guru.NetworkGuru;
 import com.cloud.network.rules.FirewallRule;
+import com.cloud.network.rules.LoadBalancerContainer.Scheme;
 import com.cloud.network.rules.StaticNat;
 import com.cloud.offering.NetworkOffering;
 import com.cloud.offerings.NetworkOfferingVO;
@@ -333,7 +334,7 @@ public interface NetworkManager  {
 
     int getRuleCountForIp(Long addressId, FirewallRule.Purpose purpose, FirewallRule.State state);
 
-    LoadBalancingServiceProvider getLoadBalancingProviderForNetwork(Network network);
+    LoadBalancingServiceProvider getLoadBalancingProviderForNetwork(Network network, Scheme lbScheme);
 
 
     boolean isSecondaryIpSetForNic(long nicId);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index c41e133..36aeee0 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -151,6 +151,7 @@ import com.cloud.offering.NetworkOffering.Availability;
 import com.cloud.offerings.NetworkOfferingServiceMapVO;
 import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.offerings.dao.NetworkOfferingDao;
+import com.cloud.offerings.dao.NetworkOfferingDetailsDao;
 import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
 import com.cloud.org.Grouping;
 import com.cloud.user.Account;
@@ -242,6 +243,8 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
     RemoteAccessVpnService _vpnMgr;
     @Inject
     PodVlanMapDao _podVlanMapDao;
+    @Inject
+    NetworkOfferingDetailsDao _ntwkOffDetailsDao;
 
     List<NetworkGuru> _networkGurus;
     public List<NetworkGuru> getNetworkGurus() {
@@ -3732,35 +3735,62 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
         return null;
     }
 
-    protected NetworkElement getElementForServiceInNetwork(Network network, Service service) {
+    protected List<NetworkElement> getElementForServiceInNetwork(Network network, Service service) {
+        List<NetworkElement> elements = new ArrayList<NetworkElement>();
         List<Provider> providers = getProvidersForServiceInNetwork(network, service);
         //Only support one provider now
         if (providers == null)  {
             s_logger.error("Cannot find " + service.getName() + " provider for network " + network.getId());
             return null;
         }
-        if (providers.size() != 1) {
+        if (providers.size() != 1 && service != Service.Lb) {
+            //support more than one LB providers only
             s_logger.error("Found " + providers.size() + " " + service.getName() + " providers for network!" + network.getId());
             return null;
+        } 
+        
+        for (Provider provider : providers) {
+            NetworkElement element = _networkModel.getElementImplementingProvider(provider.getName());
+            s_logger.info("Let " + element.getName() + " handle " + service.getName() + " in network " + network.getId());
+            elements.add(element);
         }
-        NetworkElement element = _networkModel.getElementImplementingProvider(providers.get(0).getName());
-        s_logger.info("Let " + element.getName() + " handle " + service.getName() + " in network " + network.getId());
-        return element;
+        return elements;
     }
     
     @Override
     public StaticNatServiceProvider getStaticNatProviderForNetwork(Network network) {
-        NetworkElement element = getElementForServiceInNetwork(network, Service.StaticNat);
+        //only one provider per Static nat service is supoprted
+        NetworkElement element = getElementForServiceInNetwork(network, Service.StaticNat).get(0);
         assert element instanceof StaticNatServiceProvider;
         return (StaticNatServiceProvider)element;
     }
 
     @Override
-    public LoadBalancingServiceProvider getLoadBalancingProviderForNetwork(Network network) {
-        NetworkElement element = getElementForServiceInNetwork(network, Service.Lb);
-        assert element instanceof LoadBalancingServiceProvider; 
-        return (LoadBalancingServiceProvider)element;
+    public LoadBalancingServiceProvider getLoadBalancingProviderForNetwork(Network network, Scheme lbScheme) {
+        List<NetworkElement> lbElements = getElementForServiceInNetwork(network, Service.Lb);
+        NetworkElement lbElement = null;
+        if (lbElements.size() > 1) {
+            String providerName = null;
+            //get network offering details
+            NetworkOffering off = _configMgr.getNetworkOffering(network.getNetworkOfferingId());
+            if (lbScheme == Scheme.Public) {
+                providerName = _ntwkOffDetailsDao.getDetail(off.getId(), NetworkOffering.Detail.PublicLbProvider);
+            } else {
+                providerName = _ntwkOffDetailsDao.getDetail(off.getId(), NetworkOffering.Detail.InternalLbProvider);
+            }
+            if (providerName == null) {
+                throw new InvalidParameterValueException("Can't find Lb provider supporting scheme " + lbScheme.toString() + " in network " + network);
+            }
+            lbElement =  _networkModel.getElementImplementingProvider(providerName);
+        } else if (lbElements.size() == 1){
+            lbElement = lbElements.get(0);
+        }
+                
+        assert lbElement != null;
+        assert lbElement instanceof LoadBalancingServiceProvider; 
+        return (LoadBalancingServiceProvider)lbElement;        
     }
+    
     @Override
     public boolean isNetworkInlineMode(Network network) {
         NetworkOfferingVO offering = _networkOfferingDao.findById(network.getNetworkOfferingId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/src/com/cloud/network/NetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java
index 33b9cd9..67d26af 100755
--- a/server/src/com/cloud/network/NetworkModelImpl.java
+++ b/server/src/com/cloud/network/NetworkModelImpl.java
@@ -85,6 +85,7 @@ import com.cloud.network.rules.FirewallRuleVO;
 import com.cloud.network.rules.dao.PortForwardingRulesDao;
 import com.cloud.network.vpc.dao.PrivateIpDao;
 import com.cloud.offering.NetworkOffering;
+import com.cloud.offering.NetworkOffering.Detail;
 import com.cloud.offerings.NetworkOfferingServiceMapVO;
 import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.offerings.dao.NetworkOfferingDao;
@@ -606,7 +607,6 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
             NetworkElement element = getElementImplementingProvider(instance.getProvider());
             if (element != null) {
                 Map<Service, Map<Capability, String>> elementCapabilities = element.getCapabilities();
-                ;
                 if (elementCapabilities != null) {
                     networkCapabilities.put(service, elementCapabilities.get(service));
                 }
@@ -1467,10 +1467,8 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
                     throw new UnsupportedServiceException("Service " + service.getName() + " doesn't have capability " + cap.getName() + " for element=" + element.getName() + " implementing Provider="
                             + provider.getName());
                 }
-    
-                capValue = capValue.toLowerCase();
-    
-                if (!value.contains(capValue)) {
+        
+                if (!value.toLowerCase().contains(capValue.toLowerCase())) {
                     throw new UnsupportedServiceException("Service " + service.getName() + " doesn't support value " + capValue + " for capability " + cap.getName() + " for element=" + element.getName()
                             + " implementing Provider=" + provider.getName());
                 }
@@ -2079,7 +2077,7 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
     }
     
     @Override
-    public Map<String, String> getNtwkOffDetails(long offId) {
+    public Map<Detail, String> getNtwkOffDetails(long offId) {
         return _ntwkOffDetailsDao.getNtwkOffDetails(offId);
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/src/com/cloud/network/dao/NetworkServiceMapDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/NetworkServiceMapDao.java b/server/src/com/cloud/network/dao/NetworkServiceMapDao.java
index 79b97be..6d401c4 100644
--- a/server/src/com/cloud/network/dao/NetworkServiceMapDao.java
+++ b/server/src/com/cloud/network/dao/NetworkServiceMapDao.java
@@ -35,4 +35,5 @@ public interface NetworkServiceMapDao extends GenericDao<NetworkServiceMapVO, Lo
 	void deleteByNetworkId(long networkId);
 	List<String> getDistinctProviders(long networkId);
 	String isProviderForNetwork(long networkId, Provider provider);
+	List<String> getProvidersForServiceInNetwork(long networkId, Service service);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/src/com/cloud/network/dao/NetworkServiceMapDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/dao/NetworkServiceMapDaoImpl.java b/server/src/com/cloud/network/dao/NetworkServiceMapDaoImpl.java
index 13fbfbc..3cdd738 100644
--- a/server/src/com/cloud/network/dao/NetworkServiceMapDaoImpl.java
+++ b/server/src/com/cloud/network/dao/NetworkServiceMapDaoImpl.java
@@ -56,6 +56,7 @@ public class NetworkServiceMapDaoImpl extends GenericDaoBase<NetworkServiceMapVO
         DistinctProvidersSearch = createSearchBuilder(String.class);
         DistinctProvidersSearch.and("networkId", DistinctProvidersSearch.entity().getNetworkId(), SearchCriteria.Op.EQ);
         DistinctProvidersSearch.and("provider", DistinctProvidersSearch.entity().getProvider(), SearchCriteria.Op.EQ);
+        DistinctProvidersSearch.and("service", DistinctProvidersSearch.entity().getService(), SearchCriteria.Op.EQ);
         DistinctProvidersSearch.selectField(DistinctProvidersSearch.entity().getProvider());
         DistinctProvidersSearch.done();
     }
@@ -163,5 +164,13 @@ public class NetworkServiceMapDaoImpl extends GenericDaoBase<NetworkServiceMapVO
         	return results.get(0);
         }
     }
+
+    @Override
+    public List<String> getProvidersForServiceInNetwork(long networkId, Service service) {
+        SearchCriteria<String> sc = DistinctProvidersSearch.create();
+        sc.setParameters("networkId", networkId);
+        sc.setParameters("service", service.getName());
+        return customSearch(sc, null);
+    }
     
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
index f16b486..1b9cc12 100755
--- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
+++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
@@ -1388,21 +1388,15 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
             throw ex;
         }
         
-        NetworkVO network = _networkDao.findById(networkId);
         // verify that lb service is supported by the network
-        if (!_networkModel.areServicesSupportedInNetwork(network.getId(), Service.Lb)) {
-            InvalidParameterValueException ex = new InvalidParameterValueException(
-                    "LB service is not supported in specified network id");
-            ex.addProxyObject(network, networkId, "networkId");
-            throw ex;
-        }
+        isLbServiceSupportedInNetwork(networkId, Scheme.Public);
 
         _firewallMgr.validateFirewallRule(caller.getCaller(), ipAddr, srcPort, srcPort, protocol,
                 Purpose.LoadBalancing, FirewallRuleType.User, networkId, null);
 
         LoadBalancerVO newRule = new LoadBalancerVO(xId, name, description,
                 sourceIpId, srcPort, srcPort, algorithm,
-                network.getId(), ipAddr.getAllocatedToAccountId(), ipAddr.getAllocatedInDomainId());
+                networkId, ipAddr.getAllocatedToAccountId(), ipAddr.getAllocatedInDomainId());
 
         // verify rule is supported by Lb provider of the network
         Ip sourceIp = getSourceIp(newRule);
@@ -2073,5 +2067,23 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
         }
         return dstList;
     }
+    
+    protected void isLbServiceSupportedInNetwork(long networkId, Scheme scheme) {
+        Network network = _networkDao.findById(networkId);
+        
+        //1) Check if the LB service is supported
+        if (!_networkModel.areServicesSupportedInNetwork(network.getId(), Service.Lb)) {
+            InvalidParameterValueException ex = new InvalidParameterValueException(
+                    "LB service is not supported in specified network id");
+            ex.addProxyObject(network, network.getId(), "networkId");
+            throw ex;
+        }
+        
+        //2) Check if the provider supports the scheme
+        LoadBalancingServiceProvider lbProvider = _networkMgr.getLoadBalancingProviderForNetwork(network, scheme);
+        if (lbProvider == null) {
+            throw new InvalidParameterValueException("Lb rule with scheme " + scheme.toString() + " is not supported by lb providers in network " + network);
+        }
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/src/com/cloud/offerings/NetworkOfferingDetailsVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/offerings/NetworkOfferingDetailsVO.java b/server/src/com/cloud/offerings/NetworkOfferingDetailsVO.java
index 744400b..6cd5abc 100644
--- a/server/src/com/cloud/offerings/NetworkOfferingDetailsVO.java
+++ b/server/src/com/cloud/offerings/NetworkOfferingDetailsVO.java
@@ -18,6 +18,8 @@ package com.cloud.offerings;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
@@ -25,6 +27,9 @@ import javax.persistence.Table;
 
 import org.apache.cloudstack.api.InternalIdentity;
 
+import com.cloud.offering.NetworkOffering;
+import com.cloud.offering.NetworkOffering.Detail;
+
 @Entity
 @Table(name="network_offering_details")
 public class NetworkOfferingDetailsVO implements InternalIdentity {
@@ -36,17 +41,18 @@ public class NetworkOfferingDetailsVO implements InternalIdentity {
     @Column(name="network_offering_id")
     private long offeringId;
     
+    @Enumerated(value=EnumType.STRING)
     @Column(name="name")
-    private String name;
+    private NetworkOffering.Detail name;
     
     @Column(name="value", length=1024)
     private String value;
     
     public NetworkOfferingDetailsVO() {}
     
-    public NetworkOfferingDetailsVO(long offeringId, String name, String value) {
+    public NetworkOfferingDetailsVO(long offeringId, Detail detailName, String value) {
         this.offeringId = offeringId;
-        this.name = name;
+        this.name = detailName;
         this.value = value;
     }
 
@@ -58,7 +64,7 @@ public class NetworkOfferingDetailsVO implements InternalIdentity {
         return offeringId;
     }
 
-    public String getName() {
+    public NetworkOffering.Detail getName() {
         return name;
     }
 
@@ -74,7 +80,7 @@ public class NetworkOfferingDetailsVO implements InternalIdentity {
         this.offeringId = offeringId;
     }
 
-    public void setName(String name) {
+    public void setName(NetworkOffering.Detail name) {
         this.name = name;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/src/com/cloud/offerings/dao/NetworkOfferingDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/offerings/dao/NetworkOfferingDao.java b/server/src/com/cloud/offerings/dao/NetworkOfferingDao.java
index 5196932..5bb79ce 100644
--- a/server/src/com/cloud/offerings/dao/NetworkOfferingDao.java
+++ b/server/src/com/cloud/offerings/dao/NetworkOfferingDao.java
@@ -23,6 +23,7 @@ import com.cloud.network.Network;
 import com.cloud.network.Networks.TrafficType;
 import com.cloud.offering.NetworkOffering;
 import com.cloud.offering.NetworkOffering.Availability;
+import com.cloud.offering.NetworkOffering.Detail;
 import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.utils.db.GenericDao;
 
@@ -58,6 +59,6 @@ public interface NetworkOfferingDao extends GenericDao<NetworkOfferingVO, Long>
 
     List<NetworkOfferingVO> listByTrafficTypeGuestTypeAndState(NetworkOffering.State state, TrafficType trafficType, Network.GuestType type);
 
-    NetworkOfferingVO persist(NetworkOfferingVO off, Map<String, String> details);
+    NetworkOfferingVO persist(NetworkOfferingVO off, Map<Detail, String> details);
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/src/com/cloud/offerings/dao/NetworkOfferingDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/offerings/dao/NetworkOfferingDaoImpl.java b/server/src/com/cloud/offerings/dao/NetworkOfferingDaoImpl.java
index af21ca7..ef8237a 100644
--- a/server/src/com/cloud/offerings/dao/NetworkOfferingDaoImpl.java
+++ b/server/src/com/cloud/offerings/dao/NetworkOfferingDaoImpl.java
@@ -29,6 +29,7 @@ import com.cloud.network.Network;
 import com.cloud.network.Networks.TrafficType;
 import com.cloud.offering.NetworkOffering;
 import com.cloud.offering.NetworkOffering.Availability;
+import com.cloud.offering.NetworkOffering.Detail;
 import com.cloud.offerings.NetworkOfferingDetailsVO;
 import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.utils.db.DB;
@@ -172,18 +173,19 @@ public class NetworkOfferingDaoImpl extends GenericDaoBase<NetworkOfferingVO, Lo
     
     @Override
     @DB
-    public NetworkOfferingVO persist(NetworkOfferingVO off, Map<String, String> details) {
+    public NetworkOfferingVO persist(NetworkOfferingVO off, Map<Detail, String> details) {
         Transaction txn = Transaction.currentTxn();
         txn.start();
-        //1) TODO - persist the details
+        //1) persist the offering
+        NetworkOfferingVO vo = super.persist(off);
+        
+        //2) persist the details
         if (details != null && !details.isEmpty()) {
-            for (String detail : details.keySet()) {
+            for (NetworkOffering.Detail detail : details.keySet()) {
                 _detailsDao.persist(new NetworkOfferingDetailsVO(off.getId(), detail, details.get(detail)));
             }
         }
-
-        //2) persist the offering
-        NetworkOfferingVO vo = super.persist(off);
+       
         txn.commit();
         return vo;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/src/com/cloud/offerings/dao/NetworkOfferingDetailsDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/offerings/dao/NetworkOfferingDetailsDao.java b/server/src/com/cloud/offerings/dao/NetworkOfferingDetailsDao.java
index a0b0daa..ce209e0 100644
--- a/server/src/com/cloud/offerings/dao/NetworkOfferingDetailsDao.java
+++ b/server/src/com/cloud/offerings/dao/NetworkOfferingDetailsDao.java
@@ -16,13 +16,16 @@
 // under the License.
 package com.cloud.offerings.dao;
 
+
 import java.util.Map;
 
+import com.cloud.offering.NetworkOffering;
+import com.cloud.offering.NetworkOffering.Detail;
 import com.cloud.offerings.NetworkOfferingDetailsVO;
 import com.cloud.utils.db.GenericDao;
 
 public interface NetworkOfferingDetailsDao extends GenericDao<NetworkOfferingDetailsVO, Long>{
 
-    Map<String, String> getNtwkOffDetails(long offeringId);
-
+    Map<NetworkOffering.Detail,String> getNtwkOffDetails(long offeringId);
+    String getDetail(long offeringId, Detail detailName);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/src/com/cloud/offerings/dao/NetworkOfferingDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/offerings/dao/NetworkOfferingDetailsDaoImpl.java b/server/src/com/cloud/offerings/dao/NetworkOfferingDetailsDaoImpl.java
index 69ff6f7..068f390 100644
--- a/server/src/com/cloud/offerings/dao/NetworkOfferingDetailsDaoImpl.java
+++ b/server/src/com/cloud/offerings/dao/NetworkOfferingDetailsDaoImpl.java
@@ -20,14 +20,20 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import com.cloud.offering.NetworkOffering;
+import com.cloud.offering.NetworkOffering.Detail;
 import com.cloud.offerings.NetworkOfferingDetailsVO;
-import com.cloud.storage.VMTemplateDetailVO;
 import com.cloud.utils.db.GenericDaoBase;
+import com.cloud.utils.db.GenericSearchBuilder;
 import com.cloud.utils.db.SearchBuilder;
 import com.cloud.utils.db.SearchCriteria;
+import com.cloud.utils.db.SearchCriteria.Func;
+import com.cloud.utils.db.SearchCriteria.Op;
 
 public class NetworkOfferingDetailsDaoImpl extends GenericDaoBase<NetworkOfferingDetailsVO, Long> implements NetworkOfferingDetailsDao{
     protected final SearchBuilder<NetworkOfferingDetailsVO> DetailSearch;
+    private final GenericSearchBuilder<NetworkOfferingDetailsVO, String> ValueSearch;
+
     
     public NetworkOfferingDetailsDaoImpl() {
         
@@ -35,15 +41,21 @@ public class NetworkOfferingDetailsDaoImpl extends GenericDaoBase<NetworkOfferin
         DetailSearch.and("offeringId", DetailSearch.entity().getOfferingId(), SearchCriteria.Op.EQ);
         DetailSearch.and("name", DetailSearch.entity().getName(), SearchCriteria.Op.EQ);
         DetailSearch.done();
+        
+        ValueSearch = createSearchBuilder(String.class);
+        ValueSearch.select(null, Func.DISTINCT, ValueSearch.entity().getValue());
+        ValueSearch.and("offeringId", ValueSearch.entity().getOfferingId(), SearchCriteria.Op.EQ);
+        ValueSearch.and("name", ValueSearch.entity().getName(), Op.EQ);
+        ValueSearch.done();
     }
     
     @Override
-    public Map<String, String> getNtwkOffDetails(long offeringId) {
+    public Map<NetworkOffering.Detail,String> getNtwkOffDetails(long offeringId) {
         SearchCriteria<NetworkOfferingDetailsVO> sc = DetailSearch.create();
         sc.setParameters("offeringId", offeringId);
         
         List<NetworkOfferingDetailsVO> results = search(sc, null);
-        Map<String, String> details = new HashMap<String, String>(results.size());
+        Map<NetworkOffering.Detail, String> details = new HashMap<NetworkOffering.Detail, String>(results.size());
         for (NetworkOfferingDetailsVO result : results) {
             details.put(result.getName(), result.getValue());
         }
@@ -51,4 +63,17 @@ public class NetworkOfferingDetailsDaoImpl extends GenericDaoBase<NetworkOfferin
         return details;
     }
 
+    @Override
+    public String getDetail(long offeringId, Detail detailName) {
+        SearchCriteria<String> sc = ValueSearch.create();
+        sc.setParameters("name", detailName);
+        sc.setParameters("offeringId", offeringId);
+        List<String> results = customSearch(sc, null);
+        if (results.isEmpty()) {
+            return null;
+        } else {
+            return results.get(0);
+        }
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/test/com/cloud/network/MockNetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/MockNetworkManagerImpl.java b/server/test/com/cloud/network/MockNetworkManagerImpl.java
index 18eae08..4ae752a 100755
--- a/server/test/com/cloud/network/MockNetworkManagerImpl.java
+++ b/server/test/com/cloud/network/MockNetworkManagerImpl.java
@@ -28,8 +28,8 @@ import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementors
 import org.apache.cloudstack.api.command.user.network.CreateNetworkCmd;
 import org.apache.cloudstack.api.command.user.network.ListNetworksCmd;
 import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd;
-import org.springframework.stereotype.Component;
 import org.apache.cloudstack.api.command.user.vm.ListNicsCmd;
+import org.springframework.stereotype.Component;
 
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.Pod;
@@ -56,24 +56,22 @@ import com.cloud.network.guru.NetworkGuru;
 import com.cloud.network.rules.FirewallRule;
 import com.cloud.network.rules.FirewallRule.Purpose;
 import com.cloud.network.rules.FirewallRule.State;
+import com.cloud.network.rules.LoadBalancerContainer.Scheme;
 import com.cloud.network.rules.StaticNat;
 import com.cloud.offering.NetworkOffering;
 import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.user.Account;
 import com.cloud.user.User;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.Manager;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.vm.Nic;
 import com.cloud.vm.NicProfile;
-import com.cloud.vm.NicSecondaryIp;
 import com.cloud.vm.NicVO;
 import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VMInstanceVO;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachine.Type;
 import com.cloud.vm.VirtualMachineProfile;
-import com.cloud.vm.VirtualMachineProfileImpl;
 
 @Component
 @Local(value = { NetworkManager.class, NetworkService.class })
@@ -815,7 +813,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage
     }
 
     @Override
-    public LoadBalancingServiceProvider getLoadBalancingProviderForNetwork(Network network) {
+    public LoadBalancingServiceProvider getLoadBalancingProviderForNetwork(Network network, Scheme lbScheme) {
         // TODO Auto-generated method stub
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/test/com/cloud/network/MockNetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/MockNetworkModelImpl.java b/server/test/com/cloud/network/MockNetworkModelImpl.java
index 2ef23cd..96badc7 100644
--- a/server/test/com/cloud/network/MockNetworkModelImpl.java
+++ b/server/test/com/cloud/network/MockNetworkModelImpl.java
@@ -39,6 +39,7 @@ import com.cloud.network.dao.NetworkVO;
 import com.cloud.network.element.NetworkElement;
 import com.cloud.network.element.UserDataServiceProvider;
 import com.cloud.offering.NetworkOffering;
+import com.cloud.offering.NetworkOffering.Detail;
 import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.user.Account;
 import com.cloud.utils.component.ManagerBase;
@@ -864,7 +865,7 @@ public class MockNetworkModelImpl extends ManagerBase implements NetworkModel {
     }
 
     @Override
-    public Map<String, String> getNtwkOffDetails(long offId) {
+    public Map<Detail, String> getNtwkOffDetails(long offId) {
         // TODO Auto-generated method stub
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
index e7c2cee..48b19b9 100755
--- a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
@@ -500,7 +500,7 @@ public class MockConfigurationManagerImpl extends ManagerBase implements Configu
     @Override
     public NetworkOfferingVO createNetworkOffering(String name, String displayText, TrafficType trafficType, String tags, boolean specifyVlan, Availability availability, Integer networkRate,
             Map<Service, Set<Provider>> serviceProviderMap, boolean isDefault, GuestType type, boolean systemOnly, Long serviceOfferingId, boolean conserveMode,
-            Map<Service, Map<Capability, String>> serviceCapabilityMap, boolean specifyIpRanges, boolean isPersistent, Map<String, String> details) {
+            Map<Service, Map<Capability, String>> serviceCapabilityMap, boolean specifyIpRanges, boolean isPersistent, Map<NetworkOffering.Detail,String> details) {
         // TODO Auto-generated method stub
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/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 bd4fd67..23ea387 100644
--- a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
@@ -58,7 +58,6 @@ import com.cloud.network.PhysicalNetwork;
 import com.cloud.network.PhysicalNetworkServiceProvider;
 import com.cloud.network.PhysicalNetworkTrafficType;
 import com.cloud.network.PublicIpAddress;
-import com.cloud.network.UserIpv6Address;
 import com.cloud.network.addr.PublicIp;
 import com.cloud.network.dao.IPAddressVO;
 import com.cloud.network.dao.NetworkServiceMapDao;
@@ -71,6 +70,7 @@ import com.cloud.network.guru.NetworkGuru;
 import com.cloud.network.rules.FirewallRule;
 import com.cloud.network.rules.FirewallRule.Purpose;
 import com.cloud.network.rules.FirewallRule.State;
+import com.cloud.network.rules.LoadBalancerContainer.Scheme;
 import com.cloud.network.rules.StaticNat;
 import com.cloud.offering.NetworkOffering;
 import com.cloud.offerings.NetworkOfferingVO;
@@ -78,18 +78,15 @@ import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
 import com.cloud.user.Account;
 import com.cloud.user.User;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.Manager;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.vm.Nic;
 import com.cloud.vm.NicProfile;
-import com.cloud.vm.NicSecondaryIp;
 import com.cloud.vm.NicVO;
 import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VMInstanceVO;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachine.Type;
 import com.cloud.vm.VirtualMachineProfile;
-import com.cloud.vm.VirtualMachineProfileImpl;
 
 @Component
 @Local(value = { NetworkManager.class, NetworkService.class })
@@ -1309,7 +1306,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage
     }
 
     @Override
-    public LoadBalancingServiceProvider getLoadBalancingProviderForNetwork(Network network) {
+    public LoadBalancingServiceProvider getLoadBalancingProviderForNetwork(Network network, Scheme lbScheme) {
         // TODO Auto-generated method stub
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/test/com/cloud/vpc/MockNetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockNetworkModelImpl.java b/server/test/com/cloud/vpc/MockNetworkModelImpl.java
index 4bbdd19..85cf608 100644
--- a/server/test/com/cloud/vpc/MockNetworkModelImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkModelImpl.java
@@ -46,6 +46,7 @@ import com.cloud.network.dao.NetworkVO;
 import com.cloud.network.element.NetworkElement;
 import com.cloud.network.element.UserDataServiceProvider;
 import com.cloud.offering.NetworkOffering;
+import com.cloud.offering.NetworkOffering.Detail;
 import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
 import com.cloud.user.Account;
@@ -876,7 +877,7 @@ public class MockNetworkModelImpl extends ManagerBase implements NetworkModel {
     }
 
     @Override
-    public Map<String, String> getNtwkOffDetails(long offId) {
+    public Map<Detail, String> getNtwkOffDetails(long offId) {
         // TODO Auto-generated method stub
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3b16bae/server/test/com/cloud/vpc/dao/MockNetworkServiceMapDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/dao/MockNetworkServiceMapDaoImpl.java b/server/test/com/cloud/vpc/dao/MockNetworkServiceMapDaoImpl.java
index 002b61d..103f04e 100644
--- a/server/test/com/cloud/vpc/dao/MockNetworkServiceMapDaoImpl.java
+++ b/server/test/com/cloud/vpc/dao/MockNetworkServiceMapDaoImpl.java
@@ -95,4 +95,10 @@ public class MockNetworkServiceMapDaoImpl extends GenericDaoBase<NetworkServiceM
         // TODO Auto-generated method stub
         return null;
     }
+
+    @Override
+    public List<String> getProvidersForServiceInNetwork(long networkId, Service service) {
+        // TODO Auto-generated method stub
+        return null;
+    }
 }


Mime
View raw message