Allocation-specific volumes in Nomad

Hi there, I’m learning nomad and one challenge I’m facing is how to manage data in volume between different jobs / allocations. I have multiple jobs, each job consist of N groups and each group has multiple tasks. In our case Task = Service. Each service need to write some data to disk (logs, tmp DB, profiler data, etc).

So, what I wonder is how can I separate usage of volumes between allocations (within same job, and across different jobs). Essentially I want have one volume per client host (something like “data”) and I want each allocation create a subfolder (aka “data/alloc_123/”) and I want that folder to be used for tasks:

  volume_mount {
    volume      = "data"
    destination = "/app/data/<allocation>/"
  }

Is it possible with nomad? I could not fine any documentation that.

Essentially, if I were to restart the same job (create new allocation), I’d like all data from services to be written to a brand new folder “data/<new_allocation>/”