431431import org .apache .cloudstack .engine .subsystem .api .storage .VolumeDataFactory ;
432432import org .apache .cloudstack .framework .config .ConfigurationVO ;
433433import org .apache .cloudstack .framework .config .dao .ConfigurationDao ;
434+ import org .apache .cloudstack .storage .datastore .db .ImageStoreDao ;
435+ import org .apache .cloudstack .storage .datastore .db .ImageStoreVO ;
434436import org .apache .cloudstack .storage .datastore .db .PrimaryDataStoreDao ;
435437import org .apache .cloudstack .storage .datastore .db .StoragePoolVO ;
436438import org .apache .cloudstack .utils .identity .ManagementServerNode ;
@@ -675,6 +677,8 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
675677 private List <StoragePoolAllocator > _storagePoolAllocators ;
676678 @ Inject
677679 private ResourceTagDao _resourceTagDao ;
680+ @ Inject
681+ private ImageStoreDao _imgStoreDao ;
678682
679683 @ Inject
680684 ProjectManager _projectMgr ;
@@ -796,7 +800,7 @@ public boolean configure(String name, Map<String, Object> params)
796800 for (String id : availableIds ) {
797801 _availableIdsMap .put (id , true );
798802 }
799-
803+
800804 _executeInSequence = Boolean .parseBoolean (_configDao .getValue (Config .ExecuteInSequence .key ()));
801805
802806 return true ;
@@ -3256,6 +3260,13 @@ public Map<String, Object> listCapabilities(ListCapabilitiesCmd cmd) {
32563260 Integer apiLimitInterval = Integer .valueOf (_configDao .getValue (Config .ApiLimitInterval .key ()));
32573261 Integer apiLimitMax = Integer .valueOf (_configDao .getValue (Config .ApiLimitMax .key ()));
32583262
3263+ // check if region-wide secondary storage is used
3264+ boolean regionSecondaryEnabled = false ;
3265+ List <ImageStoreVO > imgStores = _imgStoreDao .findRegionImageStores ();
3266+ if ( imgStores != null && imgStores .size () > 0 ){
3267+ regionSecondaryEnabled = true ;
3268+ }
3269+
32593270 capabilities .put ("securityGroupsEnabled" , securityGroupsEnabled );
32603271 capabilities
32613272 .put ("userPublicTemplateEnabled" , (userPublicTemplateEnabled == null || userPublicTemplateEnabled .equals ("false" ) ? false : true ));
@@ -3264,6 +3275,7 @@ public Map<String, Object> listCapabilities(ListCapabilitiesCmd cmd) {
32643275 capabilities .put ("projectInviteRequired" , _projectMgr .projectInviteRequired ());
32653276 capabilities .put ("allowusercreateprojects" , _projectMgr .allowUserToCreateProject ());
32663277 capabilities .put ("customDiskOffMaxSize" , diskOffMaxSize );
3278+ capabilities .put ("regionSecondaryEnabled" , regionSecondaryEnabled );
32673279 if (apiLimitEnabled ) {
32683280 capabilities .put ("apiLimitInterval" , apiLimitInterval );
32693281 capabilities .put ("apiLimitMax" , apiLimitMax );
0 commit comments