dcos storage provider create

ENTERPRISE

BETA

Create a new volume provider.

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 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.

For more information regarding volume providers and when you would use them, run dcos storage provider --help. The following section assumes that you are familiar with them and will describe their configurations as well as give some examples.

You configure a volume provider by passing a JSON document to this command. The JSON configuration is read from <path> or from STDIN if no <path> 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": {
            "name": "lvm",
            "config-version": "latest"
        },
        "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": {
            "name": "lvm",
            "version": "latest"
        },
        "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": {
            "name": "lvm",
            "version": "latest"
        },
        "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

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