File tree Expand file tree Collapse file tree
server/src/main/java/org/cloud/network/router/deployment Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -392,13 +392,23 @@ protected void findDefaultServiceOfferingId() {
392392
393393 protected void findAccountServiceOfferingId (long accountId ) {
394394 String accountRouterOffering = VirtualNetworkApplianceManager .VirtualRouterServiceOffering .valueIn (accountId );
395+ String globalRouterOffering = VirtualNetworkApplianceManager .VirtualRouterServiceOffering .value ();
395396 if (accountRouterOffering != null ) {
396- ServiceOfferingVO serviceOffering = serviceOfferingDao .findByUuid (accountRouterOffering );
397- if (serviceOffering != null && serviceOffering .isSystemUse ()) {
398- boolean isLocalStorage = ConfigurationManagerImpl .SystemVMUseLocalStorage .valueIn (dest .getDataCenter ().getId ());
399- if (isLocalStorage == serviceOffering .isUseLocalStorage ()) {
400- serviceOfferingId = serviceOffering .getId ();
401- }
397+ verifyServiceOfferingByUuid (accountRouterOffering );
398+ }
399+ if (serviceOfferingId == null && globalRouterOffering != accountRouterOffering ) {
400+ verifyServiceOfferingByUuid (globalRouterOffering );
401+ }
402+ }
403+
404+ private void verifyServiceOfferingByUuid (String offeringUuid ) {
405+ logger .debug ("Verifying router service offering with uuid : " + offeringUuid );
406+ ServiceOfferingVO serviceOffering = serviceOfferingDao .findByUuid (offeringUuid );
407+ if (serviceOffering != null && serviceOffering .isSystemUse ()) {
408+ boolean isLocalStorage = ConfigurationManagerImpl .SystemVMUseLocalStorage .valueIn (dest .getDataCenter ().getId ());
409+ if (isLocalStorage == serviceOffering .isUseLocalStorage ()) {
410+ logger .debug ("service offering " + serviceOffering .getId () + " will be used on virtual router" );
411+ serviceOfferingId = serviceOffering .getId ();
402412 }
403413 }
404414 }
You can’t perform that action at this time.
0 commit comments