amazon-ec2 - 我们可以在 boto3 中找到 AWS 实例的根卷吗?
问题描述
I need to find the volume id of root volume of my EC2 instance in boto3
I tried getting volumes by describe_volumes
but there is no identifier for root volume
解决方案
您可以使用aws ec2 describe-instances
查看附加的磁盘。卷将出现在以下BlockDeviceMappings
部分:
"BlockDeviceMappings": [
{
"DeviceName": "/dev/xvda",
"Ebs": {
"AttachTime": "2016-01-24T06:46:06+00:00",
"DeleteOnTermination": true,
"Status": "attached",
"VolumeId": "vol-686feca2"
}
}
],
推荐阅读
- angular - 显示来自服务器的图像不适用于 tiff 文件的图像标记。角
- ocaml - OCaml - 未绑定记录字段
- html - 使用 innerHTML Angular 2 输入
- visual-studio - 将 Xamarin .net 标准 2.0 解决方案升级到 .net 核心或 .net 5 选项/路径?
- javascript - 来自对象的名称未定义
- algorithm - 红黑树颜色的位域存储
- powershell - 如何使用PowerShell在IIS中使用自定义帐户启用匿名身份验证
- microsoft-teams - 在 Microsoft Teams 中以公司的身份发送格式化的消息
- python - 必须为每组用户 django 显示特定内容
- python - 如何在 django rest 框架中打印计算结果