dcos storage provider create

ENTERPRISE

BETA

dcos storage provider create

Create a new volume provider.

Synopsis

Arguments:

<path>    A URL or local path to the volume provider configuration JSON. If
          this is omitted the volume provider configuration JSON is read
          from STDIN.

A volume provider manages storage capacity offered by a CSI plugin to the DC/OS cluster through a DC/OS Storage Plugin. A DC/OS Storage Plugin consists of a CSI plugin along with some glue that integrates it into DC/OS. A volume provider that specifies its plugin as lvm is referred to as an “lvm” volume provider.

There are two kinds of volume provider:

  1. Local volume provider - A local volume provider manages storage capacity that is tied to a specific Mesos agent, such as an LVM2 volume group managed by an "lvm" volume provider.

  2. External volume provider - An external volume provider manages storage capacity that is not tied to any specific Mesos agent, such as a volume provider, which uses the Amazon EBS API to remotely operate on any Mesos agent in the cluster.

You configure a volume provider by passing a JSON document to this command. The JSON configuration is read from <path> or from ‘STDINif no’ is specified.

The provider configuration consists of multiple fields: name, description and spec.

The name field uniquely identifies the volume provider. It is a string of up to 128 characters. The name must consist of the characters from [A-Za-z0-9\-], and must start with a letter. It must be unique throughout the cluster. This field is required.

The description item allows you to specify a human-readable description for the volume provider to add some extra context. This is a string of up to 512 characters. This field is optional.

The spec field is itself a nested structure containing the following fields: plugin, node, plugin-configuration and labels. When you later configure volume profiles you can select which volume providers to use by filtering on the fields in their spec. This field is required.

The spec.plugin field specifies the name of a DC/OS Storage Plugin (e.g., “lvm”). See the Volume Plugins section of the DC/OS Storage Service documentation (https://docs.mesosphere.com/services/beta-storage/). This field is required.

The spec.node field specifies the Mesos agent ID of a specific agent to which a local volume provider is bound. This field is required for local volume providers and must be omitted for external volume providers.

The spec.plugin-configuration field is plugin specific. Consult the supported configuration items under the Volume Plugins section of the DC/OS Storage Service documentation (https://docs.mesosphere.com/services/beta-storage/). This field is required.

Example plugin-configuration for a “lvm” volume provider:

{
    "name": "lvm-ssds",
    "description": "LVM2 volume group backed by SSDs.",
    "spec": {
        "plugin": "lvm",
        "node": "c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S1",
        "plugin-configuration": {
            "devices": ["xvdb", "xvdc"]
        },
        "labels": { ... }
    }
}
```bash
The 'spec.labels' section allows you to label the volume provider. Labels are
not interpreted by DC/OS and it is up to the user to ensure that they are
meaningful. Labels consist of key-value pairs. The keys must be strings of 128
characters or fewer. The values must be strings of 128 characters or fewer. At
maximum 64 labels can be defined although some plugins might further limit the
number and format of labels. This field is optional.

An example for labels:

```json
{
    "name": "...",
    "description": "...",
    "spec": {
        "plugin": "...",
        "node": "...",
        "provider-configuration": { ... },
        "labels": {
            "rotational": "false",
            "manufacturer": "samsung",
            "nvme": "true",
            "raid": "1"
        }
    }
}
dcos storage provider create [<path>] [flags]

Examples

  1. Create a LVM2 volume group called volume-group-1 from configuration in a local file called provider.json:
$ cat provider.json
{
    "name": "volume-group-1",
    "description": "the primary volume group",
    "spec": {
        "plugin": "lvm",
        "node": "c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S1",
        "plugin-configuration": {
            "devices": ["xvdb", "xvdc"]
        },
        "labels": {"rotational": "false"}
    }
}

$ dcos storage provider create provider.json
Successfully created "volume-group-1"
  1. Create a LVM2 volume group called volume-group-1 from configuration passed on stdin:
$ cat <<EOF | dcos storage provider create
{
    "name": "volume-group-1",
    "description": "the primary volume group",
    "spec": {
        "plugin": "lvm",
        "node": "c67efa5d-34fa-4bc5-8b21-2a5e0bd52385-S1",
        "plugin-configuration": {
            "devices": ["xvdb", "xvdc"]
        },
        "labels": {"rotational": "false"}
    }
}
EOF
Successfully created "volume-group-1"

Options inherited from parent commands

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

SEE ALSO