LGTM, thanks

On Thu, Jan 16, 2014 at 3:26 PM, Klaus Aehlig <[email protected]> wrote:

> This cluster-wide parameter will determine how many non-finalized jobs
> maximally
> should be in a not queued state at the same time.
>
> Signed-off-by: Klaus Aehlig <[email protected]>
> ---
>  lib/objects.py          | 4 ++++
>  src/Ganeti/Constants.hs | 6 ++++++
>  src/Ganeti/Objects.hs   | 1 +
>  tools/cfgupgrade        | 2 ++
>  4 files changed, 13 insertions(+)
>
> diff --git a/lib/objects.py b/lib/objects.py
> index 565ba4e..cd2a5b9 100644
> --- a/lib/objects.py
> +++ b/lib/objects.py
> @@ -1577,6 +1577,7 @@ class Cluster(TaggableObject):
>      "disk_state_static",
>      "enabled_disk_templates",
>      "candidate_certs",
> +    "max_running_jobs",
>      ] + _TIMESTAMPS + _UUID
>
>    def UpgradeConfig(self):
> @@ -1702,6 +1703,9 @@ class Cluster(TaggableObject):
>      if self.candidate_certs is None:
>        self.candidate_certs = {}
>
> +    if self.max_running_jobs is None:
> +      self.max_running_jobs = constants.LUXID_MAXIMAL_RUNNING_JOBS_DEFAULT
> +
>    @property
>    def primary_hypervisor(self):
>      """The first hypervisor is the primary.
> diff --git a/src/Ganeti/Constants.hs b/src/Ganeti/Constants.hs
> index eedf186..76cba58 100644
> --- a/src/Ganeti/Constants.hs
> +++ b/src/Ganeti/Constants.hs
> @@ -3958,6 +3958,12 @@ luxidJobqueuePollInterval = 307
>  luxidMaximalRunningJobs :: Int
>  luxidMaximalRunningJobs = 20
>
> +-- | The default value for the maximal number of jobs to be running at
> the same
> +-- time. Once the maximal number is reached, new jobs will just be queued
> and
> +-- only started, once some of the other jobs have finished.
> +luxidMaximalRunningJobsDefault :: Int
> +luxidMaximalRunningJobsDefault = 20
> +
>  -- * Confd
>
>  confdProtocolVersion :: Int
> diff --git a/src/Ganeti/Objects.hs b/src/Ganeti/Objects.hs
> index 5a5406f..5d9aebc 100644
> --- a/src/Ganeti/Objects.hs
> +++ b/src/Ganeti/Objects.hs
> @@ -706,6 +706,7 @@ $(buildObject "Cluster" "cluster" $
>    , simpleField "ipolicy"                   [t| FilledIPolicy    |]
>    , simpleField "enabled_disk_templates"    [t| [DiskTemplate]   |]
>    , simpleField "candidate_certs"           [t| CandidateCertificates |]
> +  , simpleField "max_running_jobs"          [t| Int              |]
>   ]
>   ++ timeStampFields
>   ++ uuidFields
> diff --git a/tools/cfgupgrade b/tools/cfgupgrade
> index 0279f60..e045515 100755
> --- a/tools/cfgupgrade
> +++ b/tools/cfgupgrade
> @@ -414,6 +414,8 @@ def DowngradeCluster(config_data):
>    for param in ["gluster", "gluster_storage_dir"]:
>      if param in cluster:
>        del cluster[param]
> +  if "max_running_jobs" in cluster:
> +    del cluster["max_running_jobs"]
>
>
>  def DowngradeGroups(config_data):
> --
> 1.8.5.2
>
>

Reply via email to