2021-03-11 20:07:47 +00:00
|
|
|
---
|
|
|
|
layout: docs
|
|
|
|
page_title: 'Commands: volume create'
|
|
|
|
description: |
|
|
|
|
Create volumes with CSI plugins.
|
|
|
|
---
|
|
|
|
|
|
|
|
# Command: volume create
|
|
|
|
|
|
|
|
The `volume create` command creates external storage volumes with Nomad's
|
|
|
|
[Container Storage Interface (CSI)][csi] support. Only CSI plugins that
|
|
|
|
implement the [Controller][csi_plugins_internals] interface support this
|
|
|
|
command. The volume will also be [registered] when it is successfully created.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```plaintext
|
|
|
|
nomad volume create [options] [file]
|
|
|
|
```
|
|
|
|
|
|
|
|
The `volume create` command requires a single argument, specifying the path to
|
|
|
|
a file containing a valid [volume specification][volume_specification]. This
|
|
|
|
file will be read and the volume will be submitted to Nomad for scheduling. If
|
|
|
|
the supplied path is "-", the volume file is read from STDIN. Otherwise it is
|
|
|
|
read from the file at the supplied path.
|
|
|
|
|
|
|
|
When ACLs are enabled, this command requires a token with the
|
|
|
|
`csi-write-volume` capability for the volume's namespace.
|
|
|
|
|
|
|
|
## General Options
|
|
|
|
|
|
|
|
@include 'general_options.mdx'
|
|
|
|
|
|
|
|
## Volume Specification
|
|
|
|
|
2022-06-14 18:08:25 +00:00
|
|
|
<!--
|
|
|
|
Redirection rules are applied server-side, so we can't redirect these sections
|
|
|
|
that used to be located in this page since they use URL fragments. Creating
|
|
|
|
these hidden anchors will at least point users to the new page, although not to
|
|
|
|
the exact section.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<span id="volume-specification-parameters" />
|
|
|
|
<span id="id" />
|
|
|
|
<span id="namespace-1" />
|
|
|
|
<span id="name" />
|
|
|
|
<span id="type" />
|
|
|
|
<span id="plugin_id" />
|
|
|
|
<span id="snapshot_id" />
|
|
|
|
<span id="clone_id" />
|
|
|
|
<span id="capacity_min" />
|
|
|
|
<span id="capacity_max" />
|
|
|
|
<span id="capability" />
|
|
|
|
<span id="access_mode" />
|
|
|
|
<span id="attachment_mode" />
|
|
|
|
<span id="mount_options" />
|
|
|
|
<span id="fs_type" />
|
|
|
|
<span id="mount_flags" />
|
|
|
|
<span id="topology_request" />
|
|
|
|
<span id="secrets" />
|
|
|
|
<span id="parameters" />
|
|
|
|
<span id="topology_request-parameters" />
|
|
|
|
<span id="segments" />
|
|
|
|
<span id="unused-fields" />
|
|
|
|
|
|
|
|
The volume specification is documented in the [Volume
|
|
|
|
Specification][volume_specification] page.
|
2021-03-11 20:07:47 +00:00
|
|
|
|
|
|
|
[csi]: https://github.com/container-storage-interface/spec
|
2022-07-11 20:55:33 +00:00
|
|
|
[csi_plugins_internals]: /docs/concepts/plugins/csi#csi-plugins
|
2021-03-11 20:07:47 +00:00
|
|
|
[registered]: /docs/commands/volume/register
|
2022-06-14 18:08:25 +00:00
|
|
|
[volume_specification]: /docs/other-specifications/volume
|