github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/website/pages/docs/commands/volume/register.mdx (about) 1 --- 2 layout: docs 3 page_title: 'Commands: volume register' 4 sidebar_title: register 5 description: | 6 Register volumes with CSI plugins. 7 --- 8 9 # Command: volume register 10 11 The `volume register` command registers external storage volumes with 12 Nomad's [Container Storage Interface (CSI)][csi] support. The volume 13 must exist on the remote storage provider before it can be registered 14 and used by a task. 15 16 ## Usage 17 18 ```plaintext 19 nomad volume register [options] [file] 20 ``` 21 22 The `volume register` command requires a single argument, specifying 23 the path to a file containing a valid [volume 24 specification][volume_specification]. This file will be read and the 25 job will be submitted to Nomad for scheduling. If the supplied path is 26 "-", the job file is read from STDIN. Otherwise it is read from the 27 file at the supplied path. 28 29 ## General Options 30 31 @include 'general_options.mdx' 32 33 ## Volume Specification 34 35 The file may be provided as either HCL or JSON. An example HCL configuration: 36 37 ```hcl 38 id = "ebs_prod_db1" 39 name = "database" 40 type = "csi" 41 external_id = "vol-23452345" 42 plugin_id = "ebs-prod" 43 access_mode = "single-node-writer" 44 attachment_mode = "file-system" 45 mount_options { 46 fs_type = "ext4" 47 mount_flags = ["ro"] 48 } 49 secrets { 50 example_secret = "xyzzy" 51 } 52 ``` 53 54 ## Volume Specification Parameters 55 56 - `id` `(string: <required>)` - The unique ID of the volume. This will 57 be how [`volume`][csi_volume] stanzas in a jobspec refer to the volume. 58 59 - `name` `(string: <required>)` - The display name of the volume. 60 61 - `type` `(string: <required>)` - The type of volume. Currently only 62 `"csi"` is supported. 63 64 - `external_id` `(string: <required>)` - The ID of the physical volume 65 from the storage provider. For example, the volume ID of an AWS EBS 66 volume or Digital Ocean volume. 67 68 - `plugin_id` `(string: <required>)` - The ID of the [CSI 69 plugin][csi_plugin] that manages this volume. 70 71 - `access_mode` `(string: <required>)` - Defines whether a volume 72 should be available concurrently. Can be one of 73 `"single-node-reader-only"`, `"single-node-writer"`, 74 `"multi-node-reader-only"`, `"multi-node-single-writer"`, or 75 `"multi-node-multi-writer"`. Most CSI plugins support only 76 single-node modes. Consult the documentation of the storage provider 77 and CSI plugin. 78 79 - `attachment_mode` `(string: <required>)` - The storage API that will 80 be used by the volume. Most storage providers will support 81 `"file-system"`, to mount pre-formatted file system volumes. Some 82 storage providers will support `"block-device"`, which will require 83 the job be configured with appropriate mount options. 84 85 - `mount_options` <code>([mount_options][]:nil)</code> - Options for 86 mounting `block-device`volumes without a pre-formatted file system. 87 - `fs_type`: file system type (ex. `"ext4"`) 88 - `mount_flags`: the flags passed to `mount` (ex. `"ro,noatime"`) 89 90 - `secrets` <code>(map:nil)</code> - An optional key-value map of 91 strings used as credentials for publishing and unpublishing volumes. 92 93 94 [volume_specification]: #volume-specification 95 [csi]: https://github.com/container-storage-interface/spec 96 [csi_plugin]: /docs/job-specification/csi_plugin 97 [csi_volumes]: /docs/job-specification/volume