Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Existing Global configuration parameter settings:

CloudStack provides a variety of settings you can use to set values, limits, configure features, and enable or disable features in the cloud.

Once your Management Server is running, you might need to set some of these global configuration parameters, depending on configuration you want at the global level, which will be in effect throughout the cloud and we need to restart the Management server after changing the values to get effected.

New Framework to allow lower level configuration settings:

  • Currently CS allows setting global configs which are valid for the entire cloud. 
  • You need to restart the MS everytime you change the global configs.

Changes with 4.2 release

  • Configs can be set at different scopes namely account, zone, cluster, or primary storage
  • You do not need to restart the MS after changing these settings (most of the times) - NOTE - you need to use the functions below for this behavior.

New methods to enable configs configurable at different scopes(zone, pod, cluster, pool, account etc.):

As part of 4.2 I came with a new interface methods to retrieve configs at different scopes Our new framework allows us to define some configuration parameters at lower level (account, zone, cluster, or primary storage), which will override . If not set they inherit from the global configuration parameter values.

We provide some methods From now on any one introducing a new global config should use the methods below in ConfigurationServer interface using which we can to get the config value of configuration parameter from the DB based on the scope.

Change in Interface:

New methods are introduced getConfigValue() and getConfigListByScope()

Code Block
public interface ConfigurationServer {
    public static final String Name = "configuration-server";

    /**
     * Persists default values for the configuration table, pods/zones, and VLANs
     *
     * @return
     */
    public void persistDefaultValues() throws InternalErrorException;
    public void updateKeyPairs();

    /**
     * get the value of configuration parameter at the scope given for the corresponding resource level (account, zone, cluster, or primary storage)
     * If either scope or resourceId is not specified then get the global value
     * @param name
     *             configuration parameter name
     * @param scope
     *             Scope at which parameter value is defined (account, zone, cluster, or primary storage)
     * @param resourceId
     *             id of the resource (account, zone, cluster, or primary storage)
     * @return value of the configuration parameter 
     */
    public String getConfigValue(String name, String scope, Long resourceId);

    /**
     * get the list of configuration parameters and values at the scope given for the corresponding resource level (account, zone, cluster, or primary storage)
     * If either scope or resourceId is not specified then get the global value
     * @param scope
     *             Scope at which parameter value is defined (account, zone, cluster, or primary storage)
     * @param resourceId
     *             id of the resource (account, zone, cluster, or primary storage)
     * @return list of the configuration parameters and values 
     */
    public List<ConfigurationVO> getConfigListByScope(String scope, Long resourceId);
}

...

Get the value of a parameter at particular scope

                      @Inject ConfigurationServer _configServer;

...

                      overProvisioinigFactor = Float.parseFloat(_configServer.getConfigValue(Config.MemOverprovisioningFactor.key(), null, null));

...

Create parameter at particular scope

We have defined an enum to mention the scope in Config.java

...

Example: MemOverprovisioningFactor("Advanced", ManagementServer.class, String.class, "mem.overprovisioning.factor", "1", "Used for memory overprovisioning calculation", null, ConfigurationParameterScope.cluster.toString()),

Update value of configuration parameter:

To update a configuration parameter at particular scope

API name

Existing API Parameters

New optional API Parameters

API Response

updateConfiguration

name: the name of the configuration
value: the value of the configuration

zoneid: ID of the zone
clusterid: ID of the cluster
storageid: ID of the storagepool
accountid: ID of the acount

updateconfigurationresponse with scope and updated value 

Example: http://localhostlocalhost:8096/client/api?command=updateConfiguration&name=mem.overprovisioning.factor&value=2&clusterid=a69d292a-c1e7-4630-8acf-58e955859ab6 Image Removed(http://

To list configuration parameter at particular scope

...

                http://localhost:8096/client/api?command=listConfigurations&zoneid=b7aa7e8c-78b1-49f2-9876-aa25a728276d

TO DO:

1) Improve the framework to support defining a parameter at multiple scopes (account, zone, cluster, or primary storage)

...