Instances created from Windows Server 2016 and later Amazon Machine Images (AMIs) use the EC2Launch service for a variety of startup tasks, including initializing EBS volumes. By default, EC2Launch does not initialize secondary volumes. You can configure Amazon EC2 Launch to initialize these disks automatically.
To map drive letters to volumes
-
Connect to the instance to configure and open the C:\ProgramData\Amazon\EC2-Windows\Launch\Config\DriveLetterMappingConfig.json
file in a text editor.
-
Specify the volume settings using the following format:
{
"driveLetterMapping": [
{
"volumeName": "sample volume
", "driveLetter": "H
" } ] }
-
Save your changes and close the file.
-
Open Windows PowerShell and use the following command to run the EC2Launch script that initializes the disks:
PS C:\>
C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeDisks.ps1
To initialize the disks each time the instance boots, add the -Schedule
flag as follows:
PS C:\>
C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeDisks.ps1 -Schedule
------------------------------
madhu Dm
------------------------------
#CloudPakforDataGroup