Obtenir des informations sur vos volumes
Vous pouvez obtenir des informations sur vos volumes en utilisant AWS CLI, comme leur type, taille, et leur attachement à une machine virtuelle (VM).
Obtenir des informations sur vos volumes avec OSC CLI
|
À ce jour, cette section est disponible en anglais uniquement. |
The ReadVolumes command lists one or more specified Block Storage Unit (BSU) volumes.
$ osc-cli api ReadVolumes --profile "default" \
--Filters '{
"VolumeIds": ["vol-12345678"]
}'
$ osc-cli api ReadVolumes --profile "default" \
--Filters '{
"VolumeStates": ["in-use"],
"VolumeTypes": ["gp2", "io1"]
}'
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. -
Filters: (optional) One or more filters.-
ClientTokens: (optional) The idempotency tokens provided when creating the volumes. -
CreationDates: (optional) The dates and times at which the volumes were created, in ISO 8601 date-time format (for example,2020-06-30T00:00:00.000Z). -
LinkVolumeDeleteOnVmDeletion: (optional) Whether the volumes are deleted or not when terminating the VMs. -
LinkVolumeDeviceNames: (optional) The VM device names. -
LinkVolumeLinkDates: (optional) The dates and times at which the volumes were attached, in ISO 8601 date-time format (for example,2020-06-30T00:00:00.000Z). -
LinkVolumeLinkStates: (optional) The attachment states of the volumes (attaching|detaching|attached|detached). -
LinkVolumeVmIds: (optional) One or more IDs of VMs. -
SnapshotIds: (optional) The snapshots from which the volumes were created. -
SubregionNames: (optional) The names of the Subregions in which the volumes were created. -
TagKeys: (optional) The keys of the tags associated with the volumes. -
TagValues: (optional) The values of the tags associated with the volumes. -
Tags: (optional) The key/value combination of the tags associated with the volumes, in the following format: "Filters":{"Tags":["TAGKEY=TAGVALUE"]}. -
VolumeIds: (optional) The IDs of the volumes. -
VolumeSizes: (optional) The sizes of the volumes, in gibibytes (GiB). -
VolumeStates: (optional) The states of the volumes (creating|available|in-use|deleting|error). -
VolumeTypes: (optional) The types of the volumes (standard|gp2|io1).
-
-
NextPageToken: (optional) The token to request the next page of results. Each token refers to a specific page. -
ResultsPerPage: (optional) The maximum number of logs returned in a single response (between1and1000, both included).
The ReadVolumes command returns the following elements:
-
NextPageToken: The token to request the next page of results. Each token refers to a specific page. -
ResponseContext: Information about the context of the response.-
RequestId: The ID of the request.
-
-
Volumes: Information about one or more volumes.-
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).
-
{
"Volumes": [
{
"VolumeId": "vol-12345678",
"Tags": [],
"VolumeType": "gp2",
"SubregionName": "eu-west-2a",
"State": "in-use",
"CreationDate": "2010-10-01T12:34:56.789Z",
"Iops": 100,
"LinkedVolumes": [
{
"VolumeId": "vol-12345678",
"DeleteOnVmDeletion": false,
"DeviceName": "/dev/sdb",
"State": "attached",
"VmId": "i-12345678"
}
],
"Size": 10
}
],
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Obtenir des informations sur vos volumes avec oapi-cli
|
À ce jour, cette section est disponible en anglais uniquement. |
The ReadVolumes command lists one or more specified Block Storage Unit (BSU) volumes.
$ oapi-cli --profile "default" ReadVolumes \
--Filters '{
"VolumeIds": ["vol-12345678"]
}'
$ oapi-cli --profile "default" ReadVolumes \
--Filters '{
"VolumeStates": ["in-use"],
"VolumeTypes": ["gp2", "io1"]
}'
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. -
Filters: (optional) One or more filters.-
ClientTokens: (optional) The idempotency tokens provided when creating the volumes. -
CreationDates: (optional) The dates and times at which the volumes were created, in ISO 8601 date-time format (for example,2020-06-30T00:00:00.000Z). -
LinkVolumeDeleteOnVmDeletion: (optional) Whether the volumes are deleted or not when terminating the VMs. -
LinkVolumeDeviceNames: (optional) The VM device names. -
LinkVolumeLinkDates: (optional) The dates and times at which the volumes were attached, in ISO 8601 date-time format (for example,2020-06-30T00:00:00.000Z). -
LinkVolumeLinkStates: (optional) The attachment states of the volumes (attaching|detaching|attached|detached). -
LinkVolumeVmIds: (optional) One or more IDs of VMs. -
SnapshotIds: (optional) The snapshots from which the volumes were created. -
SubregionNames: (optional) The names of the Subregions in which the volumes were created. -
TagKeys: (optional) The keys of the tags associated with the volumes. -
TagValues: (optional) The values of the tags associated with the volumes. -
Tags: (optional) The key/value combination of the tags associated with the volumes, in the following format: "Filters":{"Tags":["TAGKEY=TAGVALUE"]}. -
VolumeIds: (optional) The IDs of the volumes. -
VolumeSizes: (optional) The sizes of the volumes, in gibibytes (GiB). -
VolumeStates: (optional) The states of the volumes (creating|available|in-use|deleting|error). -
VolumeTypes: (optional) The types of the volumes (standard|gp2|io1).
-
-
NextPageToken: (optional) The token to request the next page of results. Each token refers to a specific page. -
ResultsPerPage: (optional) The maximum number of logs returned in a single response (between1and1000, both included).
The ReadVolumes command returns the following elements:
-
NextPageToken: The token to request the next page of results. Each token refers to a specific page. -
ResponseContext: Information about the context of the response.-
RequestId: The ID of the request.
-
-
Volumes: Information about one or more volumes.-
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).
-
{
"Volumes": [
{
"VolumeId": "vol-12345678",
"Tags": [],
"VolumeType": "gp2",
"SubregionName": "eu-west-2a",
"State": "in-use",
"CreationDate": "2010-10-01T12:34:56.789Z",
"Iops": 100,
"LinkedVolumes": [
{
"VolumeId": "vol-12345678",
"DeleteOnVmDeletion": false,
"DeviceName": "/dev/sdb",
"State": "attached",
"VmId": "i-12345678"
}
],
"Size": 10
}
],
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Obtenir des informations sur vos volumes avec AWS CLI
Avant de commencer : Installez et configurez AWS CLI. Pour en savoir plus, voir Installer et configurer AWS CLI. |
Pour obtenir des informations sur vos volumes, utilisez la commande describe-volumes en suivant cette syntaxe :
$ aws ec2 describe-volumes \
--profile YOUR_PROFILE \
--volume-id vol-12345678 \
--filters Name=X,Values=Y \
--endpoint https://fcu.eu-west-2.outscale.com
Cette commande contient les options suivantes que vous devez spécifier :
-
(optionnel)
profile: Le profil nommé que vous voulez utiliser, créé pendant la configuration d’AWS CLI. Pour en savoir plus, voir Installer et configurer AWS CLI. -
(optionnel)
volume-id: Un ou plusieurs ID de volumes.Si aucun ID de volume n’est spécifié, la requête renvoie une description de l’ensemble de vos volumes.
-
(optionnel)
filters: Un ou plusieurs filtres, au format "Name=X,Values=Y".Vous pouvez spécifier plusieurs valeurs pour un même filtre en utilisant le format "Name=X,Values=Y, Z".
Les filtres suivants sont disponibles :
-
attachment.attach-time: L’heure à laquelle l’attachement à été initié. -
attachment.delete-on-termination: Indique si le volume est supprimé lorsque l’instance est terminée. -
attachment.device: L’appareil sur lequel le volume est attaché. -
attachment.instance-id: L’ID de l’instance à laquelle le volume est attaché. -
attachment.status: L’état de l’attachement (attaching|attached|detaching|detached) -
availability-zone: L’Availability Zone dans laquelle le volume a été créé. Pour en savoir plus, voir À propos des Régions et Sous-régions. -
create-time: La date et l’heure de création.
-
tag-key: La clé d’un tag associé à la ressource. -
tag-value: La valeur d’un tag associé à la ressource. -
tag:XXXX: La valeur d’un tag associé à la ressource, oùXXXXest la clé du tag.Pour filtrer un tag dont la clé est
XXXXet la valeur estYYYY, vous pouvez donc utiliser un des deux formats suivants :-
--filters Name=tag-key,Values=XXXX Name=tag-value,Values=YYYY -
--filters Name=tag:XXXX,Values=YYYY
-
-
volume-id: L’ID du volume. -
volume-type: Le type du volume (standard|gp2|io1). -
snapshot-id: Le snapshot à partir duquel le volume a été créé. -
size: La taille du volume, en gibioctets (Gio). -
status: L’état du volume (creating|available|in-use|deleting|error). Pour en savoir plus, voir À propos des volumes.
-
-
endpoint: Le endpoint correspondant à la Région à laquelle vous voulez envoyer la requête. Pour en savoir plus, voir Installer et configurer AWS CLI.
La commande describe-volumes renvoie le résultat suivant :
-
Volumes: Informations à propos d’un ou plusieurs volumes. Cet élément contient les informations suivantes :-
AvailabilityZone: L’Availability Zone où vous avez placé le volume. -
Attachments: Informations sur votre volume. Cet élément contient les informations suivantes :-
AttachTime: La date et l’heure à laquelle votre volume a été attaché. -
InstanceId: L’ID de l’instance. -
VolumeId: L’ID du volume. -
State: L’état de l’attachement du volume (attaching|detaching|attached|detached). -
DeleteOnTermination: Sitrue, le volume est supprimé une fois l’instance terminée. Sifalse, le volume n’est pas supprimé une fois l’instance terminée. -
Device: Le nom du device.
-
-
Tags: Un ou plusieurs tags associés au volume. -
VolumeType: Le type de volume (standard|gp2|io1). Pour en savoir plus, voir À propos des volumes > Types de volumes et IOPS. -
VolumeId: L’ID du volume. -
State: L’état du volume. Pour en savoir plus, voir À propos des volumes. -
(io1 et gp2 uniquement)
Iops: Le nombre d’IOPS. Pour les volumes io1, le nombre d’IOPS provisionnées. Pour les volumes gp2, la performance de base du volume. Pour en savoir plus, voir À propos des volumes. -
SnapshotId: L’ID du snapshot à partir duquel vous avez créé le snapshot. -
CreateTime: La date et l’heure de la création. -
Size: La taille du volume (en Gio).
-
"Volumes": [
{
"AvailabilityZone": "eu-west-2a",
"Attachments": [
{
"AttachTime": "2015-03-18T09:36:45.728Z",
"InstanceId": "i-12345678",
"VolumeId": "vol-87654321",
"State": "attached",
"DeleteOnTermination": false,
"Device": "/dev/sdb"
}
],
"Tags": [],
"VolumeType": "io1",
"VolumeId": "vol-87654321",
"State": "in-use",
"Iops": 500,
"SnapshotId": null,
"CreateTime": "2015-01-26T11:01:08.381Z",
"Size": 50
}
]
Pages connexes
Méthodes API correspondantes
AWS™ et Amazon Web Services™ sont des marques de commerce d'Amazon Technologies, Inc. ou de ses affiliées aux États-Unis et/ou dans les autres pays.