Nomad
Command: volume register
The volume register
command registers storage volumes as either Container
Storage Interface (CSI) volumes or dynamic host volumes. The volume must
already exist on a node or remote storage provider before you can register
the volume for use in job task.
To instead create a volume that does not already exist, use the volume
create
command. The volume create
command automatically registers the
volume as well.
Usage
nomad volume register [options] [file]
The volume register
command requires a single argument, specifying the path to
a file containing a valid volume specification. Nomad
reads the file and submits the volume to the server for placement. If the
supplied path is "-", Nomad reads the volume file from STDIN. Otherwise Nomad
reads the file from the supplied path.
When ACLs are enabled, this command requires a token with the appropriate
capability in the volume's namespace: the csi-write-volume
capability for CSI
volumes or host-volume-register
for dynamic host volumes.
General Options
-address=<addr>
: The address of the Nomad server. Overrides theNOMAD_ADDR
environment variable if set. Defaults tohttp://127.0.0.1:4646
.-region=<region>
: The region of the Nomad server to forward commands to. Overrides theNOMAD_REGION
environment variable if set. Defaults to the Agent's local region.-namespace=<namespace>
: The target namespace for queries and actions bound to a namespace. Overrides theNOMAD_NAMESPACE
environment variable if set. If set to'*'
, subcommands which support this functionality query all namespaces authorized to user. Defaults to the "default" namespace.-no-color
: Disables colored command output. Alternatively,NOMAD_CLI_NO_COLOR
may be set. This option takes precedence over-force-color
.-force-color
: Forces colored command output. This can be used in cases where the usual terminal detection fails. Alternatively,NOMAD_CLI_FORCE_COLOR
may be set. This option has no effect if-no-color
is also used.-ca-cert=<path>
: Path to a PEM encoded CA cert file to use to verify the Nomad server SSL certificate. Overrides theNOMAD_CACERT
environment variable if set.-ca-path=<path>
: Path to a directory of PEM encoded CA cert files to verify the Nomad server SSL certificate. If both-ca-cert
and-ca-path
are specified,-ca-cert
is used. Overrides theNOMAD_CAPATH
environment variable if set.-client-cert=<path>
: Path to a PEM encoded client certificate for TLS authentication to the Nomad server. Must also specify-client-key
. Overrides theNOMAD_CLIENT_CERT
environment variable if set.-client-key=<path>
: Path to an unencrypted PEM encoded private key matching the client certificate from-client-cert
. Overrides theNOMAD_CLIENT_KEY
environment variable if set.-tls-server-name=<value>
: The server name to use as the SNI host when connecting via TLS. Overrides theNOMAD_TLS_SERVER_NAME
environment variable if set.-tls-skip-verify
: Do not verify TLS certificate. This is highly not recommended. Verification will also be skipped ifNOMAD_SKIP_VERIFY
is set.-token
: The SecretID of an ACL token to use to authenticate API requests with. Overrides theNOMAD_TOKEN
environment variable if set.
Volume Register Options
-policy-override
: Sets the flag to force override any soft mandatory Sentinel policies. Used for dynamic host volumes only. Not valid for CSI volumes.
Volume Specification
Refer to the [CSI Volume Specification][csi_vol_spec] and the [Dynamic Host Volume Specification][host_vol_spec] for further information.
The volume register
command allows updating a volume definition. However, you
can only update some fields after the volume is registered.
For CSI volumes:
- Update the
capacity_min
andcapacity_max
fields and increase the volume size if the CSI plugin supports it. Expansion may or may not be possible while the volume is in use, again depending on the plugin. Reducing volume capacity is not allowed per the CSI spec. - Add or remove the
capability
blocks, but only if the capability is not currently in use by a mounted volume. - Update the
mount_options
block if the volume is not in use. - Update the
secrets
block. - Update the
context
block. The values for this field are typically provided by the CSI plugin, and you should not update them unless recommended by the CSI plugin's documentation.
For dynamic host volumes:
- Update the
capacity_min
andcapacity_max
fields. The fields are ignored but must be consistent with thecapacity
value if set. - Update the
capacity
field to record that you've increased the size of the volume. Reducing volume capacity is not allowed. - Update the
constraint
fields onvolume create
, but not after you create the volume. - Add or remove the
capability
blocks but only if a mounted volume is not using currently using the capability. - Change the
node_pool
field only from empty to the node pool that matches thenode_id
field.
You cannot update the following:
- The
name
,type
, andplugin_id
fields. - The
node_id
field.