# ClusterVolumeSpec


[API catalog](/reference/api/) · [Docker Engine overview](/reference/api/engine/version/v1.57/) · [Product manual](https://docs.docker.com/engine/) · [OpenAPI specification](/reference/api/engine/version/v1.57.yaml)

API version: 1.57





Schema constraints and annotations:

```json
{
  "description": "Cluster-specific options used to create the volume.\n",
  "properties": {
    "AccessMode": {
      "description": "Defines how the volume is used by tasks.\n",
      "properties": {
        "AccessibilityRequirements": {
          "description": "Requirements for the accessible topology of the volume. These\nfields are optional. For an in-depth description of what these\nfields mean, see the CSI specification.\n",
          "properties": {
            "Preferred": {
              "description": "A list of topologies that the volume should attempt to be\nprovisioned in.\n",
              "items": {
                "$ref": "#/components/schemas/Topology"
              },
              "type": "array"
            },
            "Requisite": {
              "description": "A list of required topologies, at least one of which the\nvolume must be accessible from.\n",
              "items": {
                "$ref": "#/components/schemas/Topology"
              },
              "type": "array"
            }
          },
          "type": "object"
        },
        "Availability": {
          "default": "active",
          "description": "The availability of the volume for use in tasks.\n- `active` The volume is fully available for scheduling on the cluster\n- `pause` No new workloads should use the volume, but existing workloads are not stopped.\n- `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started.\n",
          "enum": [
            "active",
            "pause",
            "drain"
          ],
          "type": "string",
          "x-nullable": false
        },
        "CapacityRange": {
          "description": "The desired capacity that the volume should be created with. If\nempty, the plugin will decide the capacity.\n",
          "properties": {
            "LimitBytes": {
              "description": "The volume must not be bigger than this. The value of 0\nindicates an unspecified maximum.\n",
              "format": "int64",
              "type": "integer"
            },
            "RequiredBytes": {
              "description": "The volume must be at least this big. The value of 0\nindicates an unspecified minimum\n",
              "format": "int64",
              "type": "integer"
            }
          },
          "type": "object"
        },
        "MountVolume": {
          "description": "Options for using this volume as a Mount-type volume.\n\n    Either MountVolume or BlockVolume, but not both, must be\n    present.\n  properties:\n    FsType:\n      type: \"string\"\n      description: |\n        Specifies the filesystem type for the mount volume.\n        Optional.\n    MountFlags:\n      type: \"array\"\n      description: |\n        Flags to pass when mounting the volume. Optional.\n      items:\n        type: \"string\"\nBlockVolume:\n  type: \"object\"\n  description: |\n    Options for using this volume as a Block-type volume.\n    Intentionally empty.\n",
          "type": "object"
        },
        "Scope": {
          "default": "single",
          "description": "The set of nodes this volume can be used on at one time.\n- `single` The volume may only be scheduled to one node at a time.\n- `multi` the volume may be scheduled to any supported number of nodes at a time.\n",
          "enum": [
            "single",
            "multi"
          ],
          "type": "string",
          "x-nullable": false
        },
        "Secrets": {
          "description": "Swarm Secrets that are passed to the CSI storage plugin when\noperating on this volume.\n",
          "items": {
            "description": "One cluster volume secret entry. Defines a key-value pair that\nis passed to the plugin.\n",
            "properties": {
              "Key": {
                "description": "Key is the name of the key of the key-value pair passed to\nthe plugin.\n",
                "type": "string"
              },
              "Secret": {
                "description": "Secret is the swarm Secret object from which to read data.\nThis can be a Secret name or ID. The Secret data is\nretrieved by swarm and used as the value of the key-value\npair passed to the plugin.\n",
                "type": "string"
              }
            },
            "type": "object"
          },
          "type": "array"
        },
        "Sharing": {
          "default": "none",
          "description": "The number and way that different tasks can use this volume\nat one time.\n- `none` The volume may only be used by one task at a time.\n- `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly\n- `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write.\n- `all` The volume may have any number of readers and writers.\n",
          "enum": [
            "none",
            "readonly",
            "onewriter",
            "all"
          ],
          "type": "string",
          "x-nullable": false
        }
      },
      "type": "object"
    },
    "Group": {
      "description": "Group defines the volume group of this volume. Volumes belonging to\nthe same group can be referred to by group name when creating\nServices.  Referring to a volume by group instructs Swarm to treat\nvolumes in that group interchangeably for the purpose of scheduling.\nVolumes with an empty string for a group technically all belong to\nthe same, emptystring group.\n",
      "type": "string"
    }
  },
  "type": "object"
}
```



