Variables vs meta vs payload

Dear nomad community,

I am learning nomad and trying to create a sysbatch job with input parameters like:

job "install-slurm" {
  datacenters = ["dc1"]
  type = "sysbatch" # sysbatch --> runs on all nomad clients
  parameterized {
    meta_required = ["version"]
  group "install-slurm" {
    task "zypper" {
      driver = "raw_exec"
      user = "root"
      config {
        command = "zypper"
        args = ["install", "-y", "slurm=${NOMAD_META_version}", "slurm-slurmctld=${NOMAD_META_version}", "slurm-perlapi=${NOMAD_META_version}", "slurm-slurmpmi=${NOMAD_META_version}", "slurm-devel=${NOMAD_META_version}"]

I am reading the documentation and got something working with meta, however I also saw other options to parametrize jobs like variables and payload.

I would like to ask whats the difference and which use case fits each one of them (meta, variables, payload)

thank you

Hi @masuberu thanks for trying out Nomad!

meta - are just key/values that you can specify when running a periodic job that will be merged with the other cascading meta blocks you can define at the job, group, or task level.

variables - are data stored in Nomad’s persistent storage. A job make use of values stored as Nomad variables, similar to how it can make use of meta values. A key difference between variables and meta is that meta is part of your job definition, whereas variables are stored in Nomad.

payload - is just a feature of dispatch jobs enabling you to provide a blob of data (whether via stdin or from a file) when running the job. The data could be anything; its structure is only relevant to your job.