CreateVolume
In this article:
CreateVolume#
Description#
Creates a volume that can be attached to an instance in the same availability zone.
Important
The volume encryption feature is available on request. To enable it, submit a request on the support portal or write to support@k2.cloud.
Note
If volume encryption is disabled, the encryption parameter values in the request are ignored and an unencrypted volume is created. If volume encryption is enabled and the volume type does not support encryption, then an attempt to create a volume throws an error.
Request Parameters#
Required parameters#
AvailabilityZone — The availability zone.
Type: String
Required: Yes
Valid values:
ru-msk-vol51|ru-msk-comp1p|ru-msk-vol52
Optional parameters#
Encrypted — Indicates whether the volume should be encrypted.
Type: Boolean
Required: No
Default value:
FalseValid values:
False|True
Iops — The number of I/O operations per second.
Type: Integer
Required: No
Valid values: Available for the type io2
Restriction: For
io2disks only
Size — The size of the volume, GiB.
Type: Integer
Required: No
snapshotId — The ID of the snapshot.
Type: String
Required: No
TagSpecification.N — The tags assigned to the resource when it is created.
Type: List of TagSpecification objects
Required: No
VolumeType — The type of the volume.
Type: String
Required: No
Default value:
st2Valid values:
gp2|io2|st2|st3
Response Elements#
availabilityZone — The availability zone of the volume.
Type: String
createTime — The time when volume was created.
Type: Timestamp
encrypted — Indicates whether the volume is encrypted.
Type: Boolean
iops — The number of I/O operations per second that are provisioned for the volume.
Type: Integer
requestId — The request ID.
Type: String
status — The current volume status.
Type: String
tagSet — Tags related to the volume.
Type: List of Tag objects
volumeId — The ID of the volume.
Type: String
volumeType — The type of the volume.
Type: String
Examples#
c2-ec2 CreateVolume AvailabilityZone ru-reg-az1 Size 32
c2-ec2 CreateVolume AvailabilityZone ru-reg-az1 Size 32 VolumeType io2 Iops 1600
c2-ec2 CreateVolume AvailabilityZone ru-reg-az1 Size 32 TagSpecification.1.ResourceType "volume" \
TagSpecification.1.Tag.1.Key "tag_key" TagSpecification.1.Tag.1.Value "tag_value"