简体   繁体   English

如何检测EBS卷类型?

[英]How do I detect the EBS volume type?

Is it possible to detect if an attached EBS volume is using GP2 (SSD) or provisioned IOPS (io2)? 是否可以检测连接的EBS卷是使用GP2(SSD)还是预配置的IOPS(io2)?

Is there a simple curl command I can issue to detect what is attached to my instance? 我可以发出一个简单的curl命令来检测附加到实例的内容吗? I am on the instance that I want to run this command on. 我在要在其上运行此命令的实例上。

I'd also like to do it without requiring the AWS credentials 我也想在不需要AWS凭证的情况下进行操作

There is no curl command that will let you know what is the volume type. 没有curl命令可以让您知道什么是卷类型。 You will either have check that through the console. 您可以通过控制台进行检查。 Or another way is using a AWS CLI command. 或另一种方式是使用AWS CLI命令。 Also that is not possible without using AWS Credentials . 同样,如果不使用AWS Credentials,这是不可能的。

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-describing-volumes.html https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-describing-volumes.html

Using CLI Command. 使用CLI命令。

aws ec2 describe-volumes

Sample Output 样本输出

{
    "Volumes": [
        {
            "AvailabilityZone": "us-east-1a",
            "Attachments": [
                {
                    "AttachTime": "2013-12-18T22:35:00.000Z",
                    "InstanceId": "i-1234567890abcdef0",
                    "VolumeId": "vol-049df61146c4d7901",
                    "State": "attached",
                    "DeleteOnTermination": true,
                    "Device": "/dev/sda1"
                }
            ],
            "VolumeType": "standard",
            "VolumeId": "vol-049df61146c4d7901",
            "State": "in-use",
            "SnapshotId": "snap-1234567890abcdef0",
            "CreateTime": "2013-12-18T22:35:00.084Z",
            "Size": 8
        },
        {
            "AvailabilityZone": "us-east-1a",
            "Attachments": [],
            "VolumeType": "io1",
            "VolumeId": "vol-1234567890abcdef0",
            "State": "available",
            "Iops": 1000,
            "SnapshotId": null,
            "CreateTime": "2014-02-27T00:02:41.791Z",
            "Size": 100
        }
    ]
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM