Nomad
nomad volume register command reference
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.
Options
-policy-override: Sets the flag to force override any soft mandatory Sentinel policies.
Volume specification
Refer to the CSI Volume Specification and the Dynamic Host Volume Specification 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_minandcapacity_maxfields 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
capabilityblocks, but only if the capability is not currently in use by a mounted volume. - Update the
mount_optionsblock if the volume is not in use. - Update the
secretsblock. - Update the
contextblock. 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_minandcapacity_maxfields. The fields are ignored but must be consistent with thecapacityvalue if set. - Update the
capacityfield to record that you've increased the size of the volume. Reducing volume capacity is not allowed. - Update the
constraintfields onvolume create, but not after you create the volume. - Add or remove the
capabilityblocks but only if a mounted volume is not using currently using the capability. - Change the
node_poolfield only from empty to the node pool that matches thenode_idfield.
You cannot update the following:
- The
name,type, andplugin_idfields. - The
node_idfield.
General options
-address=<addr>: The address of the Nomad server. Overrides theNOMAD_ADDRenvironment variable if set. Defaults tohttp://127.0.0.1:4646.-region=<region>: The region of the Nomad server to forward commands to. Overrides theNOMAD_REGIONenvironment 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_NAMESPACEenvironment 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_COLORmay 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_COLORmay be set. This option has no effect if-no-coloris also used.-ca-cert=<path>: Path to a PEM encoded CA cert file to use to verify the Nomad server SSL certificate. Overrides theNOMAD_CACERTenvironment 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-certand-ca-pathare specified,-ca-certis used. Overrides theNOMAD_CAPATHenvironment 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_CERTenvironment variable if set.-client-key=<path>: Path to an unencrypted PEM encoded private key matching the client certificate from-client-cert. Overrides theNOMAD_CLIENT_KEYenvironment variable if set.-tls-server-name=<value>: The server name to use as the SNI host when connecting via TLS. Overrides theNOMAD_TLS_SERVER_NAMEenvironment variable if set.-tls-skip-verify: Do not verify TLS certificate. This is highly not recommended. Verification will also be skipped ifNOMAD_SKIP_VERIFYis set.-token: The SecretID of an ACL token to use to authenticate API requests with. Overrides theNOMAD_TOKENenvironment variable if set.