本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
許多支援 EFA 的執行個體類型也具有多個網路卡。如需詳細資訊,請參閱網路卡。如果您計劃搭配其中一個執行個體類型使用 EFA,我們建議您使用下列基本組態:
-
針對主要網路介面 (網路卡索引
0
、裝置索引0
),建立 EFA (EFA 搭配 ENA) 介面。您不能使用僅限 EFA 的網路介面做為主要網路介面。 -
對於每個額外的網路介面,根據您的使用案例,例如 ENA 頻寬需求或 IP 位址空間,使用下一個未使用的網路卡索引
1
、裝置索引 和 EFA (EFA 搭配 ENA) 或僅限 EFA 網路介面。如需使用案例範例,請參閱P5 執行個體的 EFA 組態。
注意
P5 執行個體需要以特定方式設定網路介面,才能啟用最大網路頻寬。如需詳細資訊,請參閱P5 執行個體的 EFA 組態。
下列範例示範如何根據這些建議啟動執行個體。
使用啟動執行個體精靈,在中啟動執行個體
-
在網路設定區段中選擇編輯。
-
展開 進階網路組態。
-
針對主要網路介面 (網路介面 1),選取網路卡索引 = 0、裝置索引 = 0,以及介面類型 = EFA 搭配 ENA。
-
針對所需的每個額外網路介面,選擇新增網路介面。針對網路卡索引,選取下一個未使用的索引,然後選取裝置索引 = 1,且介面類型 = EFA 搭配 ENA 或僅限 EFA。
使用 run-instances 命令在執行個體啟動期間指定 EFAs
針對 --network-interfaces
,指定所需的網路介面數量。對於主要網路介面,針對 NetworkCardIndex=0
和 DeviceIndex=0
指定 InterfaceType=efa
。對於任何其他網路介面, 會NetworkCardIndex
指定下一個未使用的索引DeviceIndex=1
、 和 InterfaceType=efa
或 efa-only
。
下列範例命令程式碼片段顯示具有 32 個 EFA 網路介面的請求。
$
aws --region $REGION ec2 run-instances \ --instance-type p5.48xlarge \ --count 1 \ --key-namekey_pair_name
\ --image-idami_id
\ --network-interfaces "NetworkCardIndex=0,DeviceIndex=0,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa" \ "NetworkCardIndex=1,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=2,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=3,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=4,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=5,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=6,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=7,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=8,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=9,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=10,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=11,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=12,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=13,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=14,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=15,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=16,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=17,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=18,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=19,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=20,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=21,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=22,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=23,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=24,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=25,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=26,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=27,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=28,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=29,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=30,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" \ "NetworkCardIndex=31,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa|efa-only
" ...
P5 執行個體的 EFA 組態
P5 執行個體的總網路頻寬容量為 3,200Gbps,其中最多 800Gbps 可用於 IP 網路流量。由於 EFA 和 IP 網路流量共用相同的基礎資源,因此一個使用的頻寬將減少另一個可用的頻寬。這表示只要總頻寬不超過 3,200 Gbps,且 IP 頻寬不超過 800 Gbps,您就可以在 EFA 流量和 IP 流量之間以任何組合分配網路頻寬。
使用案例 1:儲存 IP 位址並避免潛在的 Linux IP 問題
此組態提供高達 3,200 Gbps 的 EFA 網路頻寬,以及高達 100 Gbps 的 IP 網路頻寬,並具有一個私有 IP 位址。此組態也有助於避免潛在的 Linux IP 問題,例如不允許自動指派公有 IP 位址和 IP 路由挑戰 (主機名稱對 IP 位址映射問題和來源 IP 位址不相符),如果執行個體具有多個網路介面,則可能會發生這種情況。例如,如果您使用 400 Gbps 或 IP 頻寬,您可以同時達到高達 2,800 Gbps 的 EFA 頻寬。
-
對於主要網路介面 (網路卡索引 0、裝置索引 0),請使用 EFA (EFA 搭配 ENA) 網路介面。
-
對於剩餘的網路介面 (網路卡索引 1-31、裝置索引 1),請使用僅限 EFA 的網路介面。
使用案例 2:最大 EFA 和 IP 網路頻寬
此組態提供高達 3,200 Gbps 的 EFA 網路頻寬,以及高達 800 Gbps 的 IP 網路頻寬和 8 個私有 IP 位址。您無法使用此組態自動指派公有 IP 位址。但是,在啟動進行網際網路連線之後,可以將彈性 IP 位址連接至主要網路介面 (NetworkCardIndex=0、DeviceIndex=0)。
-
對於主要網路介面 (網路卡索引 0、裝置索引 0),請使用 EFA (EFA 搭配 ENA) 網路介面。
-
對於其餘的介面,請執行下列動作:
-
在網路卡索引 1、2 和 3 上指定僅限 EFA 的網路介面,並使用裝置索引 1。
-
在下列每個網路卡索引子集中指定一個 EFA (EFA 搭配 ENA) 網路介面和三個僅限 EFA 的網路介面,並使用裝置索引 1:
-
[4、5、6、7]
-
[8、9、10、11]
-
[12、13、14、15]
-
[16、17、18、19]
-
[20、21、22、23]
-
[24、25、26、27]
-
[28、29、30、31]
-
-
下圖說明了此設定。
$ aws --region $REGION ec2 run-instances \ --instance-type p5.48xlarge \ --count 1 \ --key-name key_pair_name \ --image-id ami_id \ --network-interfaces "NetworkCardIndex=0,DeviceIndex=0,Groups=
security_group_id
,SubnetId=subnet_id
,InterfaceType=efa" \ "NetworkCardIndex=1,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=2,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=3,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=4,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa" \ "NetworkCardIndex=5,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=6,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=7,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=8,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa" \ "NetworkCardIndex=9,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=10,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=11,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=12,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa" \ "NetworkCardIndex=13,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=14,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=15,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=16,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa" \ "NetworkCardIndex=17,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=18,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=19,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=20,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa" \ "NetworkCardIndex=21,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=22,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=23,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=24,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa" \ "NetworkCardIndex=25,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=26,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=27,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=28,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa" \ "NetworkCardIndex=29,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=30,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" \ "NetworkCardIndex=31,DeviceIndex=1,Groups=security_group_id
,SubnetId=subnet_id
,InterfaceType=efa-only" ...