lbcli create volume
Creates a new volume.
Synopsis
Creates a volume with specified properties.
Volume Name
Each volume name must be unique within a given project. It is therefore not possible to create multiple volumes with the same name in the same project. After a volume has been created, its name can be modified using the update volume API with the --new-name
flag.
Volume name cannot be empty and can be up to 253 characters: The following are the allowed characters in volume name:
- 0-9
- a-z
- A-Z
- . - _
lbcli create volume [flags]
This command is an asynchronous operation. To verify that the create volume operation succeeded, use the lbcli list volume or get volume commands.
Examples:
#create volume in project "proj", volume name "vol", with acl "acl" and maximum capacity of 4 Gib.
lbcli -J $JWT create volume --project-name=proj --name=vol --acl=acl --size="4 Gib" --replica-count=2
#create a volume with placement affinity, on a node that has either server0 or rack1 in its failure domains. Otherwise the volume creation fails.
lbcli -J $JWT create volume --project-name=proj --name=vol --acl=acl --size="4 Gib" --replica-count=2 --placement-affinity="fd:server0|fd:rack1 --qos-policy-uuid=f6d3af68-463a-435e-9a16-57dc1757f052"
#create a volume from a snapshot by the snapshot UUID.
lbcli -J $JWT create volume --project-name=proj --name=vol --acl=acl --size="4 Gib" --replica-count=2 --source-snapshot-uuid=f6d3af68-463a-435e-9a16-57dc1757f0c2 --qos-policy-uuid=f6d3af68-463a-435e-9a16-57dc1757f052
#create a volume with 2 labels. The labels can be wrapped with quotation marks, but it's not mandatory. Spaces must not appear in the labels argument.
lbcli -J $JWT create volume --project-name=proj --name=vol --acl=acl --size="4 Gib" --replica-count=2 --labels="key1=val1,key2=val2"
Flag | Short | Type | Default | Description | Version |
---|---|---|---|---|---|
--acl | Comma Delimited String | ACL assigned to the volume (required). | |||
--size | string | 1GiB | Volume size in human-readable format (e.g., 3GiB, 1024MiB) (required). | ||
--compression | bool | false | Compression mode, values: true/false (optional). | ||
--placement-affinity | string | Specifies affinities for volume placement. Cluster volume placement logic places volume on nodes that have an affinity with one or more of the specified affinities. Affinities can be encoded with up to 25 key value pairs, with each value being a value of 100 characters. The supported keys are “FD” (a node’s Failure Domain), or PrimaryFD (a Failure Domain for the node serving as primary). Affinity key value pairs are evaluated and enforced during the volume placement phase. The placement algorithm assigns the volume on the resources that share common key value pairs with the key value pairs assigned to the volumes. The key defines the type of affinity (i.e., fd - a node's Failure Domain) - while the value is the exact value the placement logic should match. Notes;
| 2.3.8 and above. | ||
--help | -h | bool | Help for volume. | ||
--ip-acl | Comma Delimited String | [ALLOW_ANY] | IP address ACL assigned to the volume (optional). | ||
--labels | string | A volume can be created with user-defined labels (optional). When creating a clone, if labels are passed, the clone will be created with them. Otherwise, the labels are copied from the snapshot used for the clone (which is tagged with labels of its original source volume). The labels argument format is key0=val0,key1=val1,...keyN=valN, when the number of labels is limited to 16. Label-key and label-value length must be between 1 and 253 characters and can contain any of: alphanumeric characters (a-z, A-Z, 0-9), hyphen (-), underscore (_), and period (.). | |||
--replica-count | uint32 | Number of replicas, values: {1, 2, 3}, (required). | |||
--min-replicas | uint32 | Minimum number of replicas (optional, default: 0, 0 - implies default system behavior. | |||
--name | string | Volume name (required). See volume name allowed characters above. | |||
--qos-policy-uuid | string | The QoS policy UUID to assign to the volume (optional). | 2.3.16 and above. | ||
--qos-policy-name | string | The QoS policy name to assign to the volume (optional). | 2.3.16 and above. | ||
--project name | string | The project this volume belongs to. | 2.1 and above | ||
--sector size | int32 | Sector size allowed. Currently only 512 and 4096 are allowed. | 2.1 and above | ||
--source-snapshot-name | string | Snapshot name from which to create the volume (clone volume). Note: To clone a volume from a snapshot, specify either the source snapshot name or UUID. | 2.2 and above | ||
--source-snapshot-UUID | string | Snapshot UUID from which to create the volume (clone volume). Note: To clone a volume from a snapshot, specify either the source snapshot name or UUID. | 2.2 and above |
Update/rollback/deletion of volumes can only be done on an active volume. See auto$ for additional information.