metalcloud-cli drive create

Create a new drive with specified configuration

Synopsis

Create a new drive within an infrastructure using JSON configuration.

This command creates a new drive with the specified configuration. The drive configuration must be provided via JSON file or stdin pipe.

Arguments: infrastructure_id_or_label The ID or label of the infrastructure

Required Flags: –config-source string Source of the new drive configuration Can be ‘pipe’ (for stdin input) or path to a JSON file

Examples:

Create a drive from JSON file

metalcloud-cli drive create my-infrastructure –config-source drive-config.json

Create a drive from stdin

echo ‘{“size_bytes”: 1000000000, “type”: “ssd”}’ | metalcloud-cli drive create my-infrastructure –config-source pipe

Create a drive with configuration from file

metalcloud-cli drive create 1001 –config-source /path/to/drive.json

metalcloud-cli drive create infrastructure_id_or_label [flags]

Options

      --config-source string   Source of the new drive configuration. Can be 'pipe' or path to a JSON file.
  -h, --help                   help for create

Options inherited from parent commands

  -k, --api_key string         MetalCloud API key
  -c, --config string          Config file path
  -d, --debug                  Set to enable debug logging
  -e, --endpoint string        MetalCloud API endpoint
  -f, --format string          Output format. Supported values are 'text','csv','md','json','yaml'. (default "text")
  -i, --insecure_skip_verify   Set to allow insecure transport
  -l, --log_file string        Log file path
  -v, --verbosity string       Log level verbosity (default "INFO")

SEE ALSO

Auto generated by spf13/cobra on 11-Aug-2025