github.com/uchennaokeke444/nomad@v0.11.8/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 parameters { 53 skuname = "Premium_LRS" 54 } 55 context { 56 endpoint = "http://192.168.1.101:9425" 57 } 58 ``` 59 60 ## Volume Specification Parameters 61 62 - `id` `(string: <required>)` - The unique ID of the volume. This will 63 be how [`volume`][csi_volume] stanzas in a jobspec refer to the volume. 64 65 - `name` `(string: <required>)` - The display name of the volume. 66 67 - `type` `(string: <required>)` - The type of volume. Currently only 68 `"csi"` is supported. 69 70 - `external_id` `(string: <required>)` - The ID of the physical volume 71 from the storage provider. For example, the volume ID of an AWS EBS 72 volume or Digital Ocean volume. 73 74 - `plugin_id` `(string: <required>)` - The ID of the [CSI 75 plugin][csi_plugin] that manages this volume. 76 77 - `access_mode` `(string: <required>)` - Defines whether a volume 78 should be available concurrently. Can be one of 79 `"single-node-reader-only"`, `"single-node-writer"`, 80 `"multi-node-reader-only"`, `"multi-node-single-writer"`, or 81 `"multi-node-multi-writer"`. Most CSI plugins support only 82 single-node modes. Consult the documentation of the storage provider 83 and CSI plugin. 84 85 - `attachment_mode` `(string: <required>)` - The storage API that will 86 be used by the volume. Most storage providers will support 87 `"file-system"`, to mount pre-formatted file system volumes. Some 88 storage providers will support `"block-device"`, which will require 89 the job be configured with appropriate mount options. 90 91 - `mount_options` <code>([mount_options][]:nil)</code> - Options for 92 mounting `block-device`volumes without a pre-formatted file system. 93 - `fs_type`: file system type (ex. `"ext4"`) 94 - `mount_flags`: the flags passed to `mount` (ex. `"ro,noatime"`) 95 96 - `secrets` <code>(map<string|string>:nil)</code> - An optional 97 key-value map of strings used as credentials for publishing and 98 unpublishing volumes. 99 100 - `parameters` <code>(map<string|string>:nil)</code> - An optional 101 key-value map of strings passed directly to the CSI plugin to 102 configure the volume. The details of these parameters are specific 103 to each storage provider, so please see the specific plugin 104 documentation for more information. 105 106 - `context` <code>(map<string|string>:nil)</code> - An optional 107 key-value map of strings passed directly to the CSI plugin to 108 validate the volume. The details of these parameters are specific to 109 each storage provider, so please see the specific plugin 110 documentation for more information. 111 112 [volume_specification]: #volume-specification 113 [csi]: https://github.com/container-storage-interface/spec 114 [csi_plugin]: /docs/job-specification/csi_plugin 115 [csi_volumes]: /docs/job-specification/volume