hashicorp / hashicorp/nomad

feature request: add a flag to disable migration when draining a node

Open
#19,602 1 comment 0 reactions 0 assignees View on GitHub
stage/accepted theme/drain type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Proposal
It would be useful to have a way of disabling automatic migration when draining a node (particularly from the web UI)

### Use-cases
We have a gameserver workload that runs as a batch job with one task. The workload is stateful and doesn't respond well to migration or rescheduling. We disabled rescheduling in the job, but noticed that using node drain was causing the jobs to pop up on other nodes.

Primary use case is being able to shut down a node for maintenance and remove any game servers running on it without any attempt to reschedule or migrate them. (our matchmaker will use the Nomad API to spawn new jobs where needed and re-route players)

### Attempted Solutions
We first tried setting reschedule and unlimited to disabled in the job file, but this doesn't disable migration. The migration config block doesn't seem to apply to batch jobs, and also doesn't appear to have a way to disable the feature.

Finally we landed on a script that uses nomad job stop on all jobs on a node, but would love to have this natively + from the web UI.

Thank you for considering!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the node drain behavior and how the migration config is handled for batch jobs. Compare the Nomad API and web UI entry points mentioned in the issue, along with the existing job stop workflow. Done should provide a way to drain a node without automatic migration or rescheduling, including from the web UI.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devops, distributed-systems, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.