2021-03-11 20:07:47 +00:00
|
|
|
---
|
|
|
|
layout: docs
|
|
|
|
page_title: 'Commands: volume delete'
|
|
|
|
description: |
|
|
|
|
Delete volumes with CSI plugins.
|
|
|
|
---
|
|
|
|
|
|
|
|
# Command: volume delete
|
|
|
|
|
|
|
|
The `volume delete` command deletes 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 [deregistered] when it is successfully
|
|
|
|
deleted.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```plaintext
|
|
|
|
nomad volume delete [options] [volume]
|
|
|
|
```
|
|
|
|
|
|
|
|
The `volume delete` command requires a single argument, specifying the ID of
|
|
|
|
volume to be deleted. The volume must still be [registered] with Nomad in
|
|
|
|
order to be deleted. Deleting will fail if the volume is still in use by an
|
|
|
|
allocation or in the process of being unpublished. If the volume no longer
|
|
|
|
exists, this command will silently return without an error.
|
|
|
|
|
|
|
|
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'
|
|
|
|
|
|
|
|
[csi]: https://github.com/container-storage-interface/spec
|
2023-01-25 17:31:14 +00:00
|
|
|
[csi_plugins_internals]: /nomad/docs/concepts/plugins/csi#csi-plugins
|
|
|
|
[deregistered]: /nomad/docs/commands/volume/deregister
|
|
|
|
[registered]: /nomad/docs/commands/volume/register
|
2022-04-05 12:59:11 +00:00
|
|
|
|
|
|
|
## Delete Options
|
|
|
|
|
|
|
|
- `-secret`: Secrets to pass to the plugin to delete the
|
|
|
|
snapshot. Accepts multiple flags in the form `-secret key=value`
|