hashicorp / hashicorp/nomad

Nomad plan why-not

Open
#17,511 1 comment 0 reactions 0 assignees View on GitHub
stage/needs-discussion theme/scheduling type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Proposal

Implement a command (separate or as part of the job plan) that explains why a particular group cannot be placed on a particular node (something distantly similar to `aptitude why`). Possible syntax:

nomad job plan -why-not-group group1 -why-not-node node1 job.nomad

Output:

Allocation group1 cannot be placed on node node1 because it exhaust dimension "memory"

Possible additional option is something like `-why-not-count 3` to check why 3 allocations of a group cannot be placed on a particular node.

### Use-cases

Periodically I stumble across situations when a `nomad plan` shows that some allocation cannot be placed and it's not immediately clear why. Nomad message is fairly cryptic in even in verbose mode (and especially with a lot of nodes):

Task Group "nginx" (failed to place 1 allocation):
* Class "c1": 1 nodes excluded by filter
* Constraint "computed class ineligible": 1 nodes excluded by filter
* Resources exhausted on 2 nodes
* Class "c2" exhausted on 2 nodes
* Dimension "network: reserved port collision http=8272" exhausted on 1 nodes
* Dimension "memory" exhausted on 1 nodes

It will be time saving to have the ability to check why task group cannot be placed to specific node.

### Attempted Solutions

Currently it requires a lot of configs checks to get understanding why a job cannot be scheduled on a particular node. It is doable but can be quite time consuming.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.