dcos storage volume create

ENTERPRISE

BETA

Create a volume.

WARNING: Beta Software This software may contain bugs, incomplete features, incorrect documentation, or other discrepancies. Contact Mesosphere before deploying a beta candidate service. Product support is available to approved participants in the beta test program. Contact support@mesosphere.io for information about participation.

dcos storage volume create

Create a volume.

Synopsis

Arguments:

<name>     The name of the volume being created. The name must be unique
           throughout the DC/OS cluster. It is a string of up to 128
           characters. The name must consist of characters from
           `[A-Za-z0-9\-]`, and must start with a letter.
<size>     The size of the volume. The value ends in M, G or T to indicate
           MiB, GiB and TiB respectively.
<profile>  The name of the volume profile to use for this volume.

A volume consists of storage capacity conforming to a volume profile and allocated by a volume provider. It is made available to your application or framework. A volume presents as a mounted file system visible to your Mesos tasks.

Volumes are created by instructing a volume provider to provision storage capacity according to options described in the specified volume profile along with the specified <size>. In the case of mount volumes, a volume profile also specifies the mount options and file system type of the volume being created.

For example, if you have a profile called fast which is configured to represent SSDs only then creating a volume with volume profile fast will ensure that your volume will be allocated from SSD-backed storage.

dcos storage volume create <name> <size> <profile> [flags]

Examples

  1. Create two similar volume providers, each on a different node. Then create a volume profile called fast that selects volume providers that provide non-rotational storage. Finally, create a SSD-backed volume without specifying a specific provider and another where the provider is specified:
# Create a 'ssds-1' volume provider on c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S1,
# where xvdb and xvdc are both SSDs.
$ cat <<EOF | dcos storage provider create
{
    "name": "ssds-1",
    "spec": {
        "plugin": "lvm",
        "node": "c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S1",
        "plugin-configuration": {
            "devices": ["xvdb", "xvdc"]
        },
        "labels": {"rotational": "false"}
    }
}
EOF

# Create a 'ssds-2' volume provider on c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S2,
# where we know xvde is a SSD.
$ cat <<EOF | dcos storage provider create
{
    "name": "ssds-2",
    "spec": {
        "plugin": "lvm",
        "node": "c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S2",
        "plugin-configuration": {
            "devices": ["xvde"]
        },
        "labels": {"rotational": "false"}
    }
}
EOF

# Create a volume profile called 'fast' which selects volume
# providers that provide solid-state storage capacity.
$ cat <<EOF | dcos storage profile create
{
    "name": "fast",
    "spec": {
        "provider-selector": {
            "plugin": "lvm",
            "matches": {
                "labels": {"rotational": "false"}
            }
        },
        "mount": {}
    }
}
EOF

# Create a SSD-backed volume. This volume can be created on
# c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S1 or on
# c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S2.
$ dcos storage volume create my-volume-1 10G fast

# Create a SSD-backed volume. This volume may be created on
# by any 'lvm' volume provider backed by non-rotational storage
# as long as it is bound to c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S1.
$ dcos storage volume create my-volume-1 10G fast \
  --node=c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S1

# Create a volume backed by the 'ssds' volume provider
# on c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S2.
$ dcos storage volume create my-volume-1 10G fast --provider=ssds \
  --node=c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S2

Options

Name Description
--node string Create volume on a specific node.
--provider string Create volume using a specific provider.

Options inherited from parent commands

Name Description
-h,--help Help for this command.
--timeout duration Override the default request timeout. (default 55s)