確定 EC2 執行個體類型的支援開機模式 - Amazon Elastic Compute Cloud

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

確定 EC2 執行個體類型的支援開機模式

您可以使用 AWS CLI 或 Tools for PowerShell 來判斷執行個體類型的支援開機模式。

確定執行個體類型的支援開機模式

您可以使用下列方法來確定執行個體類型的支援開機模式。

AWS CLI

使用 describe-instance-types 命令確定執行個體類型的支援開機模式。--query 參數會篩選輸出,只傳回支援的開機模式。

下列範例顯示 m5.2xlarge 同時支援 UEFI 和 Legacy BIOS 開機模式。

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

下列為範例輸出。

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

下列範例顯示 t2.xlarge 僅支援 Legacy 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 和 Legacy BIOS 開機模式。

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

下列為範例輸出。

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

下列範例顯示 t2.xlarge 僅支援 Legacy 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 的可用執行個體類型,請使用 describe-instance-types 命令,搭配 --region 參數。如果您省略 --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