harikrishna-patnala commented on a change in pull request #3946: server: add 
global configuration for default router service offering
URL: https://github.com/apache/cloudstack/pull/3946#discussion_r392017354
 
 

 ##########
 File path: 
server/src/main/java/org/cloud/network/router/deployment/RouterDeploymentDefinition.java
 ##########
 @@ -389,8 +390,34 @@ protected void findDefaultServiceOfferingId() {
         serviceOfferingId = serviceOffering.getId();
     }
 
+    protected void findAccountServiceOfferingId(long accountId) {
+        String accountRouterOffering = 
VirtualNetworkApplianceManager.VirtualRouterServiceOffering.valueIn(accountId);
+        String globalRouterOffering = 
VirtualNetworkApplianceManager.VirtualRouterServiceOffering.value();
+        if (accountRouterOffering != null) {
+            verifyServiceOfferingByUuid(accountRouterOffering);
+        }
+        if (serviceOfferingId == null && globalRouterOffering != 
accountRouterOffering) {
+            verifyServiceOfferingByUuid(globalRouterOffering);
+        }
+    }
+
+    private void verifyServiceOfferingByUuid(String offeringUuid) {
+        logger.debug("Verifying router service offering with uuid : " + 
offeringUuid);
+        ServiceOfferingVO serviceOffering = 
serviceOfferingDao.findByUuid(offeringUuid);
+        if (serviceOffering != null && serviceOffering.isSystemUse()) {
+            boolean isLocalStorage = 
ConfigurationManagerImpl.SystemVMUseLocalStorage.valueIn(dest.getDataCenter().getId());
+            if (isLocalStorage == serviceOffering.isUseLocalStorage()) {
+                logger.debug("service offering " + serviceOffering.getId() + " 
will be used on virtual router");
 
 Review comment:
   offeringUuid would be better than id in the log message. with that LGTM

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to