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

Required 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.
<capacity> 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 DC/OS Storage volume is a Linux volume that may be consumed by a DC/OS service. Every volume is described by a volume profile which defines the volume’s properties. Every volume is created by a volume provider.

A volume is created by specifying the name of the volume, its size and the volume profile which describes it.

Read more about volume providers by running “dcos storage provider --help”. Read more about volume profiles by running “dcos storage profile --help”.

For example, imagine you have a volume profile called fast which selects volume providers that are backed by SSDs. Specifying the fast volume profile when you create a volume will ensure that your volume will be allocated from SSD-backed storage.

dcos storage volume create --name <name> --capacity <capacity> --profile <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 are backed by SSD storage. Finally, create a SSD-backed volume without selecting a specific provider and another where a particular provider is specified:
# Create a 'ssds-1' volume provider on c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S1,
# where xvdb and xvdc are both SSDs. Label this provider as '{"latency": "low"}'
# to indicate to ourselves that this is low-latency high-performance storage.
$ cat <<EOF | dcos storage provider create
{
    "name": "ssds-1",
    "spec": {
        "plugin": {
            "name": "lvm",
            "config-version": 1
        },
        "node": "c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S1",
        "plugin-configuration": {
            "devices": ["xvdb", "xvdc"]
        },
        "labels": {"latency": "low"}
    }
}
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": {
            "name": "lvm",
            "config-version": 1
        },
        "node": "c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S2",
        "plugin-configuration": {
            "devices": ["xvde"]
        },
        "labels": {"latency": "low"}
    }
}
EOF

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

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

# Create a SSD-backed volume. This volume may be created by any 'lvm' volume
# provider running on node 'c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S1' and is
# backed by SSD storage.
$ dcos storage volume create --name my-volume-1 --capacity 10G --profile fast \
  --node=c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S1

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

Options

Name Description
--capacity string The size of the volume (required).
--name string The name to use for this volume (required).
--node string Create volume on a specific node.
--profile string The name of the volume profile to use for this volume (required).
--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)