You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ja...@apache.org on 2015/04/30 09:04:42 UTC

git commit: updated refs/heads/master to 4b2ce34

Repository: cloudstack
Updated Branches:
  refs/heads/master 0bd0a5ec5 -> 4b2ce34bc


CLOUDSTACK-8406: Fixed selecting userdata as VR with dhcp service


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

Branch: refs/heads/master
Commit: 4b2ce34bc9931b3fd9ea99ffc2f19b15f1606c05
Parents: 0bd0a5e
Author: Jayapal <ja...@apache.org>
Authored: Thu Apr 30 12:21:15 2015 +0530
Committer: Jayapal <ja...@apache.org>
Committed: Thu Apr 30 12:21:15 2015 +0530

----------------------------------------------------------------------
 .../configuration/ConfigurationManagerImpl.java     | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4b2ce34b/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 ecd28e8..d0d0315 100644
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -3923,6 +3923,8 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
         Map<Provider, Set<Service>> providerCombinationToVerify = new HashMap<Provider, Set<Service>>();
         Map<String, List<String>> svcPrv = cmd.getServiceProviders();
         Provider firewallProvider = null;
+        Provider dhcpProvider = null;
+        Boolean IsVrUserdataProvider = false;
         if (svcPrv != null) {
             for (String serviceStr : svcPrv.keySet()) {
                 Network.Service service = Network.Service.getService(serviceStr);
@@ -3952,6 +3954,14 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
                             firewallProvider = Provider.VirtualRouter;
                         }
 
+                        if (service == Service.Dhcp) {
+                            dhcpProvider = provider;
+                        }
+
+                        if (service == Service.UserData && provider == Provider.VirtualRouter) {
+                            IsVrUserdataProvider = true;
+                        }
+
                         providers.add(provider);
 
                         Set<Service> serviceSet = null;
@@ -3971,6 +3981,12 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
             }
         }
 
+        // dhcp provider and userdata provider should be same because vm will be contacting dhcp server for user data.
+        if (dhcpProvider == null && IsVrUserdataProvider) {
+            s_logger.debug("User data provider VR can't be selected without VR as dhcp provider. In this case VM fails to contact the DHCP server for userdata");
+            throw new InvalidParameterValueException("Without VR as dhcp provider, User data can't selected for VR. Please select VR as DHCP provider ");
+        }
+
         // validate providers combination here
         _networkModel.canProviderSupportServices(providerCombinationToVerify);