Merge pull request #4274 from hashicorp/f-force-rescheduling

Add CLI and API support for forcing rescheduling of failed allocs
This commit is contained in:
Preetha
2018-05-21 16:24:22 -07:00
committed by GitHub
15 changed files with 673 additions and 12 deletions

View File

@@ -19,6 +19,7 @@ subcommands are available:
* [`job deployments`][deployments] - List deployments for a job
* [`job dispatch`][dispatch] - Dispatch an instance of a parameterized job
* [`job eval`][eval] - Force an evaluation for a job
* [`job history`][history] - Display all tracked versions of a job
* [`job promote`][promote] - Promote a job's canaries
* [`job revert`][revert] - Revert to a prior version of the job
@@ -26,6 +27,7 @@ subcommands are available:
[deployments]: /docs/commands/job/deployments.html "List deployments for a job"
[dispatch]: /docs/commands/job/dispatch.html "Dispatch an instance of a parameterized job"
[eval]: /docs/commands/job/eval.html "Force an evaluation for a job"
[history]: /docs/commands/job/history.html "Display all tracked versions of a job"
[promote]: /docs/commands/job/promote.html "Promote a job's canaries"
[revert]: /docs/commands/job/revert.html "Revert to a prior version of the job"

View File

@@ -0,0 +1,69 @@
---
layout: "docs"
page_title: "Commands: job eval"
sidebar_current: "docs-commands-job-eval"
description: >
The job eval command is used to force an evaluation of a job
---
# Command: job eval
The `job eval` command is used to force an evaluation of a job, given the job ID.
## Usage
```
nomad job eval [options] <job_id>
```
The `job eval` command requires a single argument, specifying the job ID to evaluate.
If there is an exact match based on the provided job ID, then
the job will be evaluated, forcing a scheduler run.
## General Options
<%= partial "docs/commands/_general_options" %>
## Eval Options
* `-force-reschedule`: `force-reschedule` is used to force placement of failed allocations.
If this is set, failed allocations that are past their reschedule limit, and those that are
scheduled to be replaced at a future time are placed immediately. This option only places failed
allocations if the task group has rescheduling enabled.
* `-detach`: Return immediately instead of monitoring. A new evaluation ID
will be output, which can be used to examine the evaluation using the
[eval status](/docs/commands/eval-status.html) command
* `-verbose`: Show full information.
## Examples
Evaluate the job with ID "job1":
```
$ nomad job eval job1
==> Monitoring evaluation "0f3bc0f3"
Evaluation triggered by job "test"
Evaluation within deployment: "51baf5c8"
Evaluation status changed: "pending" -> "complete"
==> Evaluation "0f3bc0f3" finished with status "complete"
```
Evaluate the job with ID "job1" and return immediately:
```
$ nomad job eval -detach job1
Created eval ID: "4947e728"
```
Evaluate the job with ID "job1", and reschedule any eligible failed allocations:
```
$ nomad job eval -force-reschedule job1
==> Monitoring evaluation "0f3bc0f3"
Evaluation triggered by job "test"
Evaluation within deployment: "51baf5c8"
Evaluation status changed: "pending" -> "complete"
==> Evaluation "0f3bc0f3" finished with status "complete"
```