确定 EC2 实例类型支持的启动模式 - Amazon Elastic Compute Cloud
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

您可以确定实例类型支持的启动模式。

Amazon EC2 控制台不会显示实例类型支持的启动模式。

Amazon CLI

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

以下示例显示,指定的实例类型同时支持 UEFI 和传统 BIOS 启动模式。

aws ec2 describe-instance-types \ --instance-types m5.2xlarge \ --query "InstanceTypes[*].SupportedBootModes"

下面是示例输出。

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

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

aws ec2 describe-instance-types \ --instance-types t2.xlarge \ --query "InstanceTypes[*].SupportedBootModes"

下面是示例输出。

[ [ "legacy-bios" ] ]
PowerShell

使用 Get-EC2InstanceType cmdlet 确定实例类型支持的启动模式。

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

Get-EC2InstanceType -InstanceType m5.2xlarge | Format-List InstanceType, SupportedBootModes

下面是示例输出。

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

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

Get-EC2InstanceType -InstanceType t2.xlarge | Format-List InstanceType, SupportedBootModes

下面是示例输出。

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

您可以确定支持 UEFI 的实例类型。Amazon EC2 控制台不会显示实例类型是否支持 UEFI。

Amazon CLI

可用的实例类型因 Amazon Web Services 区域 而异。要查看某个区域中支持 UEFI 的可用实例类型,请使用 describe-instance-types 命令。包括 --filters 参数以将结果范围限定为支持 UEFI 的实例类型,并包括 --query 参数以将输出范围限定为 InstanceType 的值。

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

可用的实例类型因 Amazon Web Services 区域 而异。要查看某个区域中支持 UEFI 的可用实例类型,请使用 Get-EC2InstanceType cmdlet。

Get-EC2InstanceType | ` Where-Object {$_.SupportedBootModes -Contains "uefi"} | ` Sort-Object InstanceType | ` Format-Table InstanceType -GroupBy CurrentGeneration
确定支持 UEFI 安全启动并保留非易失性变量的实例类型

裸机实例不支持 UEFI 安全启动和非易失性变量,因此这些示例将它们从输出中排除。

Amazon CLI

使用 describe-instance-types 命令,并从输出中排除裸机实例。

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

使用 Get-EC2InstanceType cmdlet,并从输出中排除裸机实例。

Get-EC2InstanceType | ` Where-Object { ` $_.SupportedBootModes -Contains "uefi" -and ` $_.BareMetal -eq $False } | ` Sort-Object InstanceType | ` Format-Table InstanceType, SupportedBootModes, BareMetal, ` @{Name="SupportedArchitectures"; Expression={$_.ProcessorInfo.SupportedArchitectures}}