确定 EC2 实例类型支持的启动模式 - Amazon Elastic Compute Cloud

确定 EC2 实例类型支持的启动模式

您可以使用 AWS CLI 或 Tools for PowerShell 确定实例类型支持的启动模式。

确定实例类型支持的启动模式

您可以使用以下方法确定实例类型支持的启动模式。

AWS CLI

使用 describe-instance-types 命令确定实例类型支持的启动模式。--query 参数筛选输出以仅返回支持的启动模式。

以下示例显示 m5.2xlarge 支持 UEFI 和传统 BIOS 启动模式。

aws ec2 describe-instance-types --region us-east-1 --instance-types m5.2xlarge --query "InstanceTypes[*].SupportedBootModes"

下面是示例输出。

[ [ "legacy-bios", "uefi" ] ]

以下示例显示 t2.xlarge 仅支持传统 BIOS。

aws ec2 describe-instance-types --region us-east-1 --instance-types t2.xlarge --query "InstanceTypes[*].SupportedBootModes"

下面是示例输出。

[ [ "legacy-bios" ] ]
PowerShell

使用 Get-EC2InstanceType(Tools for PowerShell)Cmdlet 确定实例类型支持的启动模式。

以下示例显示 m5.2xlarge 支持 UEFI 和传统 BIOS 启动模式。

Get-EC2InstanceType -Region us-east-1 -InstanceType m5.2xlarge | Format-List InstanceType, SupportedBootModes

下面是示例输出。

InstanceType : m5.2xlarge SupportedBootModes : {legacy-bios, uefi}

以下示例显示 t2.xlarge 仅支持传统 BIOS。

Get-EC2InstanceType -Region us-east-1 -InstanceType t2.xlarge | Format-List InstanceType, SupportedBootModes

下面是示例输出。

InstanceType : t2.xlarge SupportedBootModes : {legacy-bios}
确定支持 UEFI 的实例类型

您可以使用以下方法确定支持 UEFI 的实例类型:

AWS CLI

可用的实例类型因 AWS 区域 而异。要查看某个区域中支持 UEFI 的可用实例类型,请使用带 --region 参数的 describe-instance-types 命令。如果省略 --region 参数,则会在请求中使用配置的默认区域。包括 --filters 参数以将结果范围限定为支持 UEFI 的实例类型,并包括 --query 参数以将输出范围限定为 InstanceType 的值。

aws ec2 describe-instance-types --filters Name=supported-boot-mode,Values=uefi --query "InstanceTypes[*].[InstanceType]" --output text | sort

下面是示例输出。

a1.2xlarge a1.4xlarge a1.large a1.medium a1.metal a1.xlarge c5.12xlarge ...
PowerShell
PS C:\> Get-EC2InstanceType | ` Where-Object {$_.SupportedBootModes -Contains "uefi"} | ` Sort-Object InstanceType | ` Format-Table InstanceType -GroupBy CurrentGeneration

下面是示例输出。

CurrentGeneration: False InstanceType ------------ a1.2xlarge a1.4xlarge a1.large a1.medium a1.metal a1.xlarge CurrentGeneration: True InstanceType ------------ c5.12xlarge c5.18xlarge c5.24xlarge c5.2xlarge c5.4xlarge c5.9xlarge ...
确定支持 UEFI 安全启动并保留非易失性变量的实例类型

裸机实例不支持 UEFI 安全启动和非易失性变量,因此这些示例将它们从输出中排除。有关 UEFI 安全启动的信息,请参阅 适用于 Amazon EC2 实例的 UEFI 安全启动

AWS CLI

使用 describe-instance-types 命令,并通过包含 Name=bare-metal,Values=false 筛选条件从输出中排除裸机实例。

aws ec2 describe-instance-types --filters Name=supported-boot-mode,Values=uefi Name=bare-metal,Values=false --query "InstanceTypes[*].[InstanceType]" --output text | sort

下面是示例输出。

a1.2xlarge a1.4xlarge a1.large a1.medium ...
PowerShell
PS C:\> Get-EC2InstanceType | ` Where-Object { ` $_.SupportedBootModes -Contains "uefi" -and ` $_.BareMetal -eq $False } | ` Sort-Object InstanceType | ` Format-Table InstanceType, SupportedBootModes, BareMetal, @{Name="SupportedArchitectures"; Expression={$_.ProcessorInfo.SupportedArchitectures}}
InstanceType SupportedBootModes BareMetal SupportedArchitectures ------------ ------------------ --------- ---------------------- a1.2xlarge {uefi} False arm64 a1.4xlarge {uefi} False arm64 a1.large {uefi} False arm64 a1.medium {uefi} False arm64 a1.xlarge {uefi} False arm64 c5.12xlarge {legacy-bios, uefi} False x86_64 c5.18xlarge {legacy-bios, uefi} False x86_64