tail -f /dev/null

If you haven't had any obstacles lately, you're not challenging. be the worst.

AWS Windows Server 2012R2 非 Nitro instance を Nitro 世代の instance へ変更する

Environment

  • Windows Server2012R2

Overview

  • Windows instance type を非 Nitro 世代から Nitro 世代 へ変更する.
  • 2018/08 以前に作成された Amazon 提供の AMI は Nitro 世代への変更が推奨されている.

Install & Upgrade AWS PV Drivers

最新の driver package を download する.

download した AWSPVDriver.zip を解凍し, AWSPVDriverSetup.msi を実行する.

Invoke-WebRequest -Uri https://s3.amazonaws.com/ec2-windows-drivers-downloads/AWSPV/Latest/AWSPVDriver.zip -OutFile C:\setup\AWSPVDriver.zip
Expand-Archive C:\setup\AWSPVDriver.zip -DestinationPath C:\setup\AWSPVDriver

AWS PV Drivers Setup Wizard

AWS PV Drivers は C:\Program Files\Amazon\XenTools\ へ install される.

AWS PV Drivers Installing AWS PV Drivers

install 完了後, instance は自動で再起動する.

再度 RDP 接続できるようになるまで 15min 程度かかった.

Device Manager > Storage Controllers > AWS PV Storage Host Adapter

install された driver の version を確認する. AWS PV driver package history を確認し, latest version が install されたことを確認する.

PS C:\Windows\system32> Get-ItemProperty HKLM:\SOFTWARE\Amazon\PVDriver
Version      : 8.4.2
PSPath       : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Amazon\PVDriver
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Amazon
PSChildName  : PVDriver
PSDrive      : HKLM
PSProvider   : Microsoft.PowerShell.Core\Registry

Install & Upgrade AWS NVMe deriver

NVMe driver package を download する.

AWSNVMe Device Driver Installation Wizard

Invoke-WebRequest -Uri https://s3.amazonaws.com/ec2-windows-drivers-downloads/NVMe/Latest/AWSNVMe.zip -OutFile C:\setup\AWSNVMe.zip
Expand-Archive C:\setup\AWSNVMe.zip -DestinationPath C:\setup\AWSNVMe

dpinst.exe を実行して driver を install する.

PowerShell session を管理者として起動し, 次のコマンドを実行する.

start rundll32.exe sppnp.dll,Sysprep_Generalize_Pnp -wait

Nitro instance type へ変更し, 起動できることを確認する.

Install & Update EC2Config

Invoke-WebRequest -Uri https://s3.amazonaws.com/ec2-downloads-windows/EC2Config/EC2Install.zip -OutFile C:\setup\EC2Install.zip

download した EC2Install.exe を実行する.

EC2ConfigService Setup

Install & Update EC2Launch

C:\ProgramData\Amazon\EC2-Windows\Launch\Config を backup しておく.

EC2-Windows-Launch と install 用のスクリプトを download し, install.ps1 を実行する.

Invoke-WebRequest -Uri https://s3.amazonaws.com/ec2-downloads-windows/EC2Launch/latest/EC2-Windows-Launch.zip -OutFile C:\setup\EC2-Windows-Launch.zip
Invoke-WebRequest -Uri https://s3.amazonaws.com/ec2-downloads-windows/EC2Launch/latest/install.ps1 -OutFile C:\setup\install.ps1

.\install.ps1
Attempting it again with [System.IO.Compression.ZipFile]::ExtractToDirectory
Successfully extract files to C:\ProgramData\Amazon\EC2-Windows\Launch
True

Update Power Management Settings

Power Management Settings を更新することで display 消灯を避け, Nitro system で graceful な OS shutdown が可能となる.

powercfg /setacvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 7516b95f-f776-4464-8c53-06167f40cc99 3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e 0
powercfg /setacvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 7516b95f-f776-4464-8c53-06167f40cc99 3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e 0
powercfg /setacvalueindex a1841308-3541-4fab-bc81-f71556f20b4a 7516b95f-f776-4464-8c53-06167f40cc99 3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e 0

References

Migrate to latest generation instance types