presents by IT Consulting 109

AWS – M5 次世代の汎用EC2インスタンスへの変更時の注意

概要

インスタンスタイプでM5が使用できるようになり、既存のインスタンスタイプから変更した際、以下のエラーが発生する場合があります。

Enhanced networking with the Elastic Network Adapter (ENA) is required for the 'm5.large' instance type. Ensure that your instance 'InstanceID' is enabled for ENA.

これは、Elastic Network Adapterが有効になっていない為で、追加の設定を行えば解消されます。
※対象インスタンスの「EnaSupport」値の設定が「false」の場合が該当する。

参考:Linux インスタンスにおける Elastic Network Adapter (ENA) を使用した拡張ネットワーキングの有効化

 

手順

1.カーネルモジュールの確認

modinfo ena

 実行結果①

filename:       /lib/modules/4.4.11-23.53.amzn1.x86_64/kernel/drivers/amazon/net/ena/ena.ko
version:        0.6.6
license:        GPL
description:    Elastic Network Adapter (ENA)
author:         Amazon.com, Inc. or its affiliates
srcversion:     3141E47566402C79D6B8284
alias:          pci:v00001D0Fd0000EC21sv*sd*bc*sc*i*
alias:          pci:v00001D0Fd0000EC20sv*sd*bc*sc*i*
alias:          pci:v00001D0Fd00001EC2sv*sd*bc*sc*i*
alias:          pci:v00001D0Fd00000EC2sv*sd*bc*sc*i*
depends:
intree:         Y
vermagic:       4.4.11-23.53.amzn1.x86_64 SMP mod_unload modversions
parm:           debug:Debug level (0=none,...,16=all) (int)
parm:           push_mode:Descriptor / header push mode (0=automatic,1=disable,3=enable)
			  0 - Automatically choose according to device capability (default)
			  1 - Don't push anything to device memory
			  3 - Push descriptors and header buffer to device memory (int)
parm:           enable_wd:Enable keepalive watchdog (0=disable,1=enable,default=1) (int)
parm:           enable_missing_tx_detection:Enable missing Tx completions. (default=1) (int)
parm:           numa_node_override_array:Numa node override map
 (array of int)
parm:           numa_node_override:Enable/Disable numa node override (0=disable)
 (int)

上記結果の場合、ENA モジュールがインストールされています。

 
実行結果②

ERROR: modinfo: could not find module ena

上記結果の場合、ENA モジュールがインストールされいない場合になります。
Linux での拡張ネットワーキングの有効化を参照してインストールしてください。

 
 
2.EnaSupportの確認
コマンド

aws ec2 describe-instances --instance-ids i-xxxxxxxxxxxxxxxxx --query 'Reservations[].Instances[].EnaSupport'

実行結果

false

「無効」であることを確認したら以下の手順を用いて「有効」にします。

 
 
3.EnaSupportの有効化
コマンド

aws ec2 modify-instance-attribute --instance-id i-xxxxxxxxxxxxxxxxx --ena-support

再確認

aws ec2 describe-instances --instance-ids i-xxxxxxxxxxxxxxxxx --query 'Reservations[].Instances[].EnaSupport'

実行結果

true

これで、インスタンスタイプの変更が可能となります。

 

補足

エラー①

英:An error occurred (UnauthorizedOperation) when calling the ModifyInstanceAttribute operation: You are not authorized to perform this operation.
日:ModifyInstanceAttribute操作を呼び出すときにエラー(UnauthorizedOperation)が発生しました。この操作を実行する権限がありません。

原因
権限が足りない状態で変更を行なった場合。

対策
aws configureでEC2の操作権限があるアクセスキーを設定する。

 
 
エラー②

英:An error occurred (IncorrectInstanceState) when calling the ModifyInstanceAttribute operation: The instance 'i-xxxxxxxxxxxxxxxxx' is not in the 'stopped' state.
日:ModifyInstanceAttribute操作を呼び出すと、エラー(IncorrectInstanceState)が発生しました。インスタンス 'i-xxxxxxxxxxxxxxxxx'が '停止'状態ではありません。

原因
対象のEC2インスタンスを起動している状態で変更を行った場合。

対策
対象のインスタンスを停止する。

この記事を書いた人
名前:TRUE's。 千葉県育ち、神奈川県在住のIT系フリーエンジニア。 IT系のナレッジサイトを不定期で更新中。 フォトグラファー兼エンジニアとして日々勤しんでいる。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です