Common Issues of AWS

Madhu Cynix
5 min readAug 7, 2019

The following are troubleshooting tips to help you solve common issues with EC2 instance running Windows Server.

Issues

  • EBS volumes don’t initialize on Windows Server 2016 and later AMIs
  • Boot an EC2 Windows Instance into Directory Services Restore Mode (DSRM)
  • Instance loses network connectivity or scheduled tasks don’t run when expected
  • Unable to get console output
  • Windows Server 2012 R2 not available on the network

EBS volumes don’t initialize on Windows Server 2016 and later AMIs

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 EC2Launch to initialize these disks automatically. To-Get depth Knowledge on Amazon EC2

To map drive letters to volumes

  1. Connect to the instance to configure and open the C:\ProgramData\Amazon\EC2-Windows\Launch\Config\DriveLetterMappingConfig.json file in a text editor.
  2. Specify the volume settings using the following format:{ "driveLetterMapping": [ { "volumeName": "sample volume", "driveLetter": "H" } ] }
  3. Save your changes and close the file.
  4. 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
  5. 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

Boot an EC2 Windows Instance into Directory Services Restore Mode (DSRM)

If an instance running Microsoft Active Directory experiences a system failure or other critical issues you can troubleshoot the instance by booting into a special version of Safe Mode called Directory Services Restore Mode (DSRM). In DSRM you can repair or recover Active Directory.

Driver Support for DSRM

How you enable DSRM and boot into the instance depends on the drivers the instance is running. In the EC2 console you can view driver version details for an instance from the System Log. For More about Driver Support for DSRM

Configure an Instance to Boot into DSRM

EC2 Windows instances do not have network connectivity before the operating system is running. For this reason, you cannot press the F8 button on your keyboard to select a boot option. You must use one of the following procedures to boot an EC2 Windows Server instance into DSRM.

If you suspect that Active Directory has been corrupted and the instance is still running, you can configure the instance to boot into DSRM using either the System Configuration dialog box or the command prompt.

To boot an online instance into DSRM using the System Configuration dialog box

  1. In the Run dialog box, type msconfig and press Enter.
  2. Choose the Boot tab.
  3. Under Boot options choose Safe boot.
  4. Choose Active Directory repair and then choose OK. The system prompts you to reboot the server.

To boot an online instance into DSRM using the command line

From a Command Prompt window, run the following command:

bcdedit /set safeboot dsrepair

If an instance is offline and unreachable, you must detach the root volume and attach it to another instance to enable DSRM mode.

To boot an offline instance into DSRM

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  2. In the navigation pane, choose Instances.
  3. Locate the affected instance. Open the context (right-click) menu for the instance, choose Instance State, and then choose Stop.
  4. Choose Launch Instance and create a temporary instance in the same Availability Zone as the affected instance. Choose an instance type that uses a different version of Windows. For example, if your instance is Windows Server 2008, then choose a Windows Server 2008 R2 instance.
  5. In the navigation pane, choose Volumes.
  6. Locate the root volume of the affected instance. Detach the volume and attach it to the temporary instance you created earlier. Attach it with the default device name (xvdf).
  7. Use Remote Desktop to connect to the temporary instance, and then use the Disk Management utility to make the volume available for use.
  8. Open a command prompt and run the following command. Replace D with the actual drive letter of the secondary volume you just attached:bcdedit /store D:\Boot\BCD /set {default} safeboot dsrepair
  9. In the Disk Management Utility, choose the drive you attached earlier, open the context (right-click) menu, and choose Offline.
  10. In the EC2 console, detach the affected volume from the temporary instance and reattach it to your original instance with the device name /dev/sda1. You must specify this device name to designate the volume as a root volume.
  11. Start the instance.
  12. After the instance passes the health checks in the EC2 console, connect to the instance using Remote Desktop and verify that it boots into DSRM mode.
  13. (Optional) Delete or stop the temporary instance you created in this procedure.

Take your career to new heights of success with a AWS Online Training

Instance loses network connectivity or scheduled tasks don’t run when expected

If you restart your instance and it loses network connectivity, it’s possible that the instance has the wrong time.

By default, Windows instances use Coordinated Universal Time (UTC). If you set the time for your instance to a different time zone and then restart it, the time becomes offset and the instance temporarily loses its IP address. The instance regains network connectivity eventually, but this can take several hours. The amount of time that it takes for the instance to regain network connectivity depends on the difference between UTC and the other time zone.

This same time issue can also result in scheduled tasks not running when you expect them to. In this case, the scheduled tasks do not run when expected because the instance has the incorrect time.

To use a time zone other than UTC persistently, you must set the RealTimeIsUniversal registry key. Without this key, an instance uses UTC after you restart it.

To resolve time issues that cause a loss of network connectivity

  1. Ensure that you are running the recommended PV drivers. For more information, see Upgrading PV Drivers on Your Windows Instances.
  2. Verify that the following registry key exists and is set to 1:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal
  3. AWS Instance Types

Unable to get console output

For Windows instances, the instance console displays the output from tasks performed during the Windows boot process. If Windows boots successfully, the last message logged is Windows is Ready to use. Note that you can also display event log messages in the console, but this feature is not enabled by default.

To get the console output for your instance using the Amazon EC2 console, select the instance, choose Actions, Instance Settings, and then Get System Log. To get the console output using the command line, use one of the following commands: get-console-output (AWS CLI) or Get-EC2ConsoleOutput (AWS Tools for Windows PowerShell).

For instances running Windows Server 2012 R2 and earlier, if the console output is empty, it could indicate an issue with the EC2Config service, such as a misconfigured configuration file, or that Windows failed to boot properly. To fix the issue, download and install the latest version of EC2Config. For more information, see Installing the Latest Version of EC2Config.

Windows Server 2012 R2 not available on the network

For information about troubleshooting a Windows Server 2012 R2 instance that is not available on the network, see Windows Server 2012 R2 loses network and storage connectivity after an instance reboot.

This Article Source From https://docs.aws.amazon.com

Related Articles

  1. Configuring AWS Lambda Functions
  2. AWS Lambda?
  3. AWS ─ Route 53
  4. AWS Architecture

AWS User Group São Paulo AWS User Groups AWS Amplify AWS Startups AWS Identity Alexandra Samuel AWS User Group Bosnia

--

--