Modifier un volume
Vous pouvez modifier les attributs d’un volume existant, qu’il s’agisse d’un volume système sur lequel le système d’exploitation de la machine virtuelle (VM) est installé, ou d’un volume secondaire de la VM. Cette action est disponible quel que soit l’état du volume ou le système d’exploitation (OS) de la VM qui y est attaché.
Vous pouvez utiliser cette action pour augmenter la capacité de stockage du volume, changer son type ou mettre à jour le nombre d’IOPS (input output per second).
Modifier un volume avec Cockpit
-
Dans le dashboard Volumes, placez le curseur de la souris sur le rang du volume que vous voulez modifier, et cliquez sur l’icône
.
La boîte de dialogue MODIFIER UN VOLUME apparaît. -
Dans la liste Type, sélectionnez un type de volume :
-
standardpour un volume Magnetic -
io1pour un volume Enterprise -
gp2pour un volume Performance
Pour en savoir plus sur les différents types de volumes, voir À propos des volumes > Types de volumes et IOPS.
-
-
Dans le champ Taille, tapez la taille du volume.
La taille minimale autorisée pour un volume est de :
-
1 Gio pour
standard -
1 Gio pour
gp2 -
4 Gio pour
io1
La taille maximale autorisée pour un volume est 14901 Gio.
-
-
(Volumes
io1uniquement) Dans le champ IOPS, tapez le nombre d’IOPS pour le volume ou sélectionnez-le en utilisant les flèches.Le nombre maximal d’IOPS autorisé pour les volumes
io1est 13000 avec un ratio de performance maximum de 300 IOPS par gibioctet. -
Cliquez sur Modifier.
Le volume est modifié.
Modifier un volume avec OSC CLI
|
À ce jour, cette section est disponible en anglais uniquement. |
The UpdateVolume command modifies the specified attributes of a volume.
|
$ osc-cli api UpdateVolume --profile "default" \
--VolumeId "vol-12345678" \
--Size 50
$ osc-cli api UpdateVolume --profile "default" \
--VolumeId "vol-12345678" \
--VolumeType "io1" \
--Iops 200
This command contains the following attributes that you need to specify:
-
DryRun: (optional) If true, checks whether you have the required permissions to perform the action. -
Iops: (optional) The new number of I/O operations per second (IOPS). This parameter can be specified only if you update anio1volume or if you change the type of the volume for anio1. -
Size: (optional) The new size of the volume, in gibibytes (GiB). This value must be equal to or greater than the current size of the volume. This modification is not instantaneous. -
VolumeId: The ID of the volume you want to update. -
VolumeType: (optional) The new type of the volume (standard|io1|gp2). If you update to anio1volume, you must also specify theIopsparameter.
The UpdateVolume command returns the following elements:
-
ResponseContext: Information about the context of the response.-
RequestId: The ID of the request.
-
-
Volume: Information about the volume.-
ClientToken: The idempotency token provided when creating the volume. -
CreationDate: The date and time (UTC) at which the volume was created. -
Iops: The number of I/O operations per second (IOPS):-
For
io1volumes, the number of provisioned IOPS -
For
gp2volumes, the baseline performance of the volume
-
-
LinkedVolumes: Information about your volume attachment.-
DeleteOnVmDeletion: If true, the volume is deleted when terminating the VM. If false, the volume is not deleted when terminating the VM. -
DeviceName: The name of the device. -
State: The state of the attachment of the volume (attaching|detaching|attached|detached). -
VmId: The ID of the VM. -
VolumeId: The ID of the volume.
-
-
Size: The size of the volume, in gibibytes (GiB). -
SnapshotId: The snapshot from which the volume was created. -
State: The state of the volume (creating|available|in-use|deleting|error). -
SubregionName: The Subregion in which the volume was created. -
Tags: One or more tags associated with the volume.-
Key: The key of the tag, with a minimum of 1 character. -
Value: The value of the tag, between 0 and 255 characters.
-
-
TaskId: The ID of the volume update task in progress. Otherwise, it is not returned. -
VolumeId: The ID of the volume. -
VolumeType: The type of the volume (standard|gp2|io1).
-
{
"Volume": {
"VolumeId": "vol-12345678",
"Tags": [],
"VolumeType": "gp2",
"SubregionName": "eu-west-2a",
"State": "available",
"CreationDate": "2010-10-01T12:34:56.789Z",
"Iops": 100,
"LinkedVolumes": [],
"Size": 10,
"TaskId": "vol-update-12345678"
},
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
{
"Volume": {
"VolumeId": "vol-12345678",
"Tags": [],
"VolumeType": "io1",
"SubregionName": "eu-west-2a",
"State": "available",
"CreationDate": "2010-10-01T12:34:56.789Z",
"Iops": 200,
"LinkedVolumes": [],
"Size": 10,
"TaskId": "vol-update-12345678"
},
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Modifier un volume avec oapi-cli
|
À ce jour, cette section est disponible en anglais uniquement. |
The UpdateVolume command modifies the specified attributes of a volume.
|
$ oapi-cli --profile "default" UpdateVolume \
--VolumeId "vol-12345678" \
--Size 50
$ oapi-cli --profile "default" UpdateVolume \
--VolumeId "vol-12345678" \
--VolumeType "io1" \
--Iops 200
This command contains the following attributes that you need to specify:
-
DryRun: (optional) If true, checks whether you have the required permissions to perform the action. -
Iops: (optional) The new number of I/O operations per second (IOPS). This parameter can be specified only if you update anio1volume or if you change the type of the volume for anio1. -
Size: (optional) The new size of the volume, in gibibytes (GiB). This value must be equal to or greater than the current size of the volume. This modification is not instantaneous. -
VolumeId: The ID of the volume you want to update. -
VolumeType: (optional) The new type of the volume (standard|io1|gp2). If you update to anio1volume, you must also specify theIopsparameter.
The UpdateVolume command returns the following elements:
-
ResponseContext: Information about the context of the response.-
RequestId: The ID of the request.
-
-
Volume: Information about the volume.-
ClientToken: The idempotency token provided when creating the volume. -
CreationDate: The date and time (UTC) at which the volume was created. -
Iops: The number of I/O operations per second (IOPS):-
For
io1volumes, the number of provisioned IOPS -
For
gp2volumes, the baseline performance of the volume
-
-
LinkedVolumes: Information about your volume attachment.-
DeleteOnVmDeletion: If true, the volume is deleted when terminating the VM. If false, the volume is not deleted when terminating the VM. -
DeviceName: The name of the device. -
State: The state of the attachment of the volume (attaching|detaching|attached|detached). -
VmId: The ID of the VM. -
VolumeId: The ID of the volume.
-
-
Size: The size of the volume, in gibibytes (GiB). -
SnapshotId: The snapshot from which the volume was created. -
State: The state of the volume (creating|available|in-use|deleting|error). -
SubregionName: The Subregion in which the volume was created. -
Tags: One or more tags associated with the volume.-
Key: The key of the tag, with a minimum of 1 character. -
Value: The value of the tag, between 0 and 255 characters.
-
-
TaskId: The ID of the volume update task in progress. Otherwise, it is not returned. -
VolumeId: The ID of the volume. -
VolumeType: The type of the volume (standard|gp2|io1).
-
{
"Volume": {
"VolumeId": "vol-12345678",
"Tags": [],
"VolumeType": "gp2",
"SubregionName": "eu-west-2a",
"State": "available",
"CreationDate": "2010-10-01T12:34:56.789Z",
"Iops": 100,
"LinkedVolumes": [],
"Size": 10,
"TaskId": "vol-update-12345678"
},
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
{
"Volume": {
"VolumeId": "vol-12345678",
"Tags": [],
"VolumeType": "io1",
"SubregionName": "eu-west-2a",
"State": "available",
"CreationDate": "2010-10-01T12:34:56.789Z",
"Iops": 200,
"LinkedVolumes": [],
"Size": 10,
"TaskId": "vol-update-12345678"
},
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Pages connexes
Méthode API correspondante