Windows Ec2 ephemeral drive not detected as ephemeral

0

We have multiple EC2 instances running SQL Server in Windows and when we run InitializeDisks.ps1 the ephemeral drive always is mapped to Z:\

However, in the last instance we have created, the aforementioned script maps the ephemeral to D:, digging into that script, there is a function called Test-Ephemeral, which returns false and then map it to D:\

If I run the following code in any other of our instances, it returns True, for this one, False

$disk = Get-CimInstance -ClassName Win32_DiskDrive | Where-Object -Property Caption -EQ "NVMe Amazon EC2 NVMe SCSI Disk Device"

$DiskIndex = $disk.Index;

$DiskSCSITargetId = $disk.SCSITargetId

Test-EphemeralDisk -DiskIndex $disk.Index -DiskSCSITargetId $disk.SCSITargetId;

This is an important issue since we place [tempdb] on that drive and it it's not mapped correctly SQL Server won't start.

Any help would be highly appreciated.

Thanks

Raul
asked 14 days ago236 views
1 Answer
0

Hello,

Thank you for writing in.

The InitializeDisks.ps1 script helps you to initialize the disk and assign the drive letter as per the DriveLetterMappingConfig.json if everything is successful. Now it depends on what configuration you have inside your Drivelettermappingconfig.json file and according to that mapping would take place.

You can review the json file by going to the C:\ProgramData\Amazon\EC2-Windows\Launch\Config\DriveLetterMappingConfig.json location and make sure it reflects as Drive Letter as D. Please review this document for more information.

In case you are still facing an issue, I would suggest raising a Support Ticket with us so that we can take a deeper look.

Thanks!

AWS
answered 13 days ago
profile picture
EXPERT
reviewed 13 days ago
  • Thanks Rashid, we found out the problem.

    The instances that have the issue have an outdated version of the script C:\ProgramData\Amazon\EC2-Windows\Launch\Module\Scripts\Test-Ephemeral.ps1. We spotted it by comparing to another instance where the ephemeral was correctly mapped to Z.

    It seems that new hardware returns disk information slightly different and the check for ephemeral has changed from

    if ($disk.BusType -eq 'NVMe' -and $disk.SerialNumber -like "AWS*") { return $true }

    to

    Set-Variable awsSsdSerialNumberPattern -Option Constant -Value "AWS*"

    if ($disk.BusType -eq 'NVMe' -and ($disk.SerialNumber -like $awsSsdSerialNumberPattern -or $disk.AdapterSerialNumber -like $awsSsdSerialNumberPattern)) { return $true }

    The extended check picks the ephemeral correctly and maps it to Z:, the json file is not relevant, as I changed it to be Z and it's completely ignored for some reason.

    To update the script pack to the latest version we just followed this steps https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2launch-download.html

    Thanks!