CLI로 DescribeVolumeStatus 사용 - AWS SDK 코드 예제

AWS SDK 예제 GitHub 리포지토리에 더 많은 AWS문서 SDK 예제가 있습니다.

CLI로 DescribeVolumeStatus 사용

다음 코드 예시는 DescribeVolumeStatus의 사용 방법을 보여 줍니다.

CLI
AWS CLI

단일 볼륨의 상태 설명

이 예시 명령은 볼륨 vol-1234567890abcdef0의 상태를 설명합니다.

명령:

aws ec2 describe-volume-status --volume-ids vol-1234567890abcdef0

출력:

{ "VolumeStatuses": [ { "VolumeStatus": { "Status": "ok", "Details": [ { "Status": "passed", "Name": "io-enabled" }, { "Status": "not-applicable", "Name": "io-performance" } ] }, "AvailabilityZone": "us-east-1a", "VolumeId": "vol-1234567890abcdef0", "Actions": [], "Events": [] } ] }

손상된 볼륨의 상태 설명

이 예시 명령은 손상된 모든 볼륨의 상태를 설명합니다. 이 예시 출력에서는 손상된 볼륨이 없습니다.

명령:

aws ec2 describe-volume-status --filters Name=volume-status.status,Values=impaired

출력:

{ "VolumeStatuses": [] }

상태 확인에 실패한 볼륨이 있는 경우(상태가 손상됨) Amazon EC2 사용 설명서의 손상된 볼륨 작업을 참조하세요.

PowerShell
Tools for PowerShell V4

예제 1: 이 예제에서는 지정된 볼륨의 상태를 설명합니다.

Get-EC2VolumeStatus -VolumeId vol-12345678

출력:

Actions : {} AvailabilityZone : us-west-2a Events : {} VolumeId : vol-12345678 VolumeStatus : Amazon.EC2.Model.VolumeStatusInfo
(Get-EC2VolumeStatus -VolumeId vol-12345678).VolumeStatus

출력:

Details Status ------- ------ {io-enabled, io-performance} ok
(Get-EC2VolumeStatus -VolumeId vol-12345678).VolumeStatus.Details

출력:

Name Status ---- ------ io-enabled passed io-performance not-applicable
  • API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조(V4)DescribeVolumeStatus를 참조하세요.

Tools for PowerShell V5

예제 1: 이 예제에서는 지정된 볼륨의 상태를 설명합니다.

Get-EC2VolumeStatus -VolumeId vol-12345678

출력:

Actions : {} AvailabilityZone : us-west-2a Events : {} VolumeId : vol-12345678 VolumeStatus : Amazon.EC2.Model.VolumeStatusInfo
(Get-EC2VolumeStatus -VolumeId vol-12345678).VolumeStatus

출력:

Details Status ------- ------ {io-enabled, io-performance} ok
(Get-EC2VolumeStatus -VolumeId vol-12345678).VolumeStatus.Details

출력:

Name Status ---- ------ io-enabled passed io-performance not-applicable
  • API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조(V5)DescribeVolumeStatus를 참조하세요.