hashicorp / hashicorp/nomad

add "count" field to CSI volume register/creation

Open
#10,159 0 comments 3 reactions 0 assignees View on GitHub
theme/storage type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

While working on https://github.com/hashicorp/nomad/pull/10136 it became obvious very quickly that adding a `count` field to the [volume specification](https://www.nomadproject.io/docs/commands/volume/register#volume-specification) will make registering and creating CSI volumes much nicer.

We can have it automatically add the expected suffix that we want for per-alloc scheduling, so that a volume spec like the following:

```hcl
id = "ebs_prod_db"
count = 2
name = "database"
type = "csi"
external_id = "vol-23452345"
plugin_id = "ebs-prod"
access_mode = "single-node-writer"
attachment_mode = "file-system"
mount_options {
fs_type = "ext4"
mount_flags = ["ro"]
}
```

will register two volumes, with IDs `ebs_prod_db[0]` and `ebs_prod_db[1]`. This is pretty easy to fold into the work being done in Nomad 1.1 for https://github.com/hashicorp/nomad/issues/8212

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the volume specification in the volume register/create command documentation and trace how the example fields are handled. Confirm the registration path supports a count and determine the expected naming for each generated volume; done means a count of 2 produces the documented suffixed IDs for CSI volumes.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
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.