Perform an in-place upgrade - Amazon Elastic Compute Cloud

Perform an in-place upgrade

Before you perform an in-place upgrade, you must determine which network drivers the instance is running. PV network drivers enable you to access your instance using Remote Desktop. Starting with Windows Server 2008 R2, instances use either AWS PV, Intel Network Adapter, or the Enhanced Networking drivers. Instances with Windows Server 2003 and Windows Server 2008 use Citrix PV drivers. For more information, see Paravirtual drivers for Windows instances.

Automated upgrades

For steps on how to use AWS Systems Manager to automate the upgrade of your Windows Server 2008 R2 to Server 2012 R2 or from SQL Server 2008 R2 on Windows Server 2012 R2 to SQL Server 2016, see Upgrade Your End of Support Microsoft 2008 Workloads in AWS with Ease.

Before you begin an in-place upgrade

Complete the following tasks and note the following important details before you begin your in-place upgrade.

Upgrade an instance in-place with AWS PV, Intel Network Adapter, or the Enhanced Networking drivers

Use the following procedure to upgrade a Windows Server instance using the AWS PV, Intel Network Adapter, or the Enhanced Networking network drivers.

To perform the in-place upgrade
  1. Create an AMI of the system you plan to upgrade for either backup or testing purposes. You can then perform the upgrade on the copy to simulate a test environment. If the upgrade completes, you can switch traffic to this instance with little downtime. If the upgrade fails, you can revert to the backup. For more information, see Create a custom Windows AMI.

  2. Ensure that your Windows Server instance is using the latest network drivers. See Upgrade PV drivers on Windows instances for information on upgrading your AWS PV driver.

  3. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  4. In the navigation pane, choose Instances. Locate the instance. Make a note of the instance ID and Availability Zone for the instance. You need this information later in this procedure.

  5. If you are upgrading from Windows Server 2012 or 2012 R2 to Windows Server 2016, 2019, or 2022, perform the following on your instance before proceeding:

    1. Uninstall the EC2Config service. For more information, see Stop, restart, delete, or uninstall EC2Config.

    2. Install EC2Launch v1 or the EC2Launch v2 agent. For more information, see Configure a Windows instance using EC2Launch and Configure a Windows instance using EC2Launch v2.

    3. Install the AWS Systems Manager SSM Agent. For more information, see Working with SSM Agent in the AWS Systems Manager User Guide.

  6. Create a new volume from a Windows Server installation media snapshot.

    1. In the left navigation pane, under Elastic Block Store, choose Snapshots. In the search bar filter, choose Public Snapshots.

    2. Add the Owner alias filter to the search bar and choose amazon.

    3. Add the Description filter and enter Windows. Select Enter.

    4. Select the snapshot that matches the system architecture and language preference you are upgrading to. For example, select Windows 2019 English Installation Media to upgrade to Windows Server 2019.

    5. Choose Actions, Create Volume.

    6. In the Create Volume dialog box, choose the Availability Zone that matches your Windows instance, and choose Create Volume.

  7. In the Create Volume Request Succeeded message, choose the volume that you just created.

  8. Choose Actions, Attach Volume.

  9. In the Attach Volume dialog box, enter the instance ID of your Windows instance and choose Attach.

  10. Make the new volume available for use by following the steps at Make an Amazon EBS volume available for use on Windows.

    Important

    Do not initialize the disk because doing so will delete the existing data.

  11. In Windows PowerShell, switch to the new volume drive. Begin the upgrade by opening the installation media volume you attached to the instance.

    1. If you are upgrading to Windows Server 2016 or later, run the following:

      .\setup.exe /auto upgrade /dynamicupdate disable
      Note

      Running the setup.exe with the /dynamicupdate option set to disabled prevents Windows from installing updates during the Windows Server upgrade process, as installing updates during the upgrade can cause failures. You can install updates with Windows Update after the upgrade completes.

      If you are upgrading to an earlier version of Windows Server, run the following:

      Sources\setup.exe
    2. For Select the operating system you want to install, select the full installation SKU for your Windows Server instance, and choose Next.

    3. For Which type of installation do you want?, choose Upgrade.

    4. Complete the wizard.

Windows Server Setup copies and processes files. After several minutes, your Remote Desktop session closes. The time it takes to upgrade depends on the number of applications and server roles running on your Windows Server instance. The upgrade process could take as little as 40 minutes or several hours. The instance fails status check 1 of 2 during the upgrade process. When the upgrade completes, both status checks pass. You can check the system log for console output or use Amazon CloudWatch metrics for disk and CPU activity to determine whether the upgrade is progressing.

Note

If upgrading to Windows Server 2019, after the upgrade is complete you can change the desktop background manually to remove the previous operating system name if desired.

If the instance has not passed both status checks after several hours, see Troubleshoot an upgrade.

Upgrade an instance in-place with Citrix PV drivers

Citrix PV drivers are used in Windows Server 2003 and 2008. There is a known issue during the upgrade process where Windows Setup removes portions of the Citrix PV drivers that enable you to connect to the instance by using Remote Desktop. To avoid this problem, the following procedure describes how to use the Upgrade Helper Service during your in-place upgrade.

Using the upgrade helper service

You must run the Upgrade Helper Service before you start the upgrade. After you run it, the utility creates a Windows service that runs during the post-upgrade steps to correct the driver state. The executable is written in C# and can run on .NET Framework versions 2.0 through 4.0.

When you run Upgrade Helper Service on the system before the upgrade, it performs the following tasks:

  • Creates a new Windows service named UpgradeHelperService.

  • Verifies that the Citrix PV drivers are installed.

  • Checks for unsigned boot critical drivers and presents a warning if any are found. Unsigned boot critical drivers could cause system failure after the upgrade if the drivers are not compatible with the newer Windows Server version.

When you run Upgrade Helper Service on the system after the upgrade, it performs the following tasks:

  • Enables the RealTimeIsUniversal registry key for the correct time synchronization.

  • Restores the missing PV driver by executing the following command:

    pnputil -i -a "C:\Program Files (x86)\Citrix\XenTools\*.inf"
  • Installs the missing device by executing the following command:

    C:\Temp\EC2DriverUtils.exe install "C:\Program Files (x86)\Citrix\XenTools\xevtchn.inf" ROOT\XENEVTCHN
  • Automatically removes UpgradeHelperService when complete.

Perform the upgrade on instances running Citrix PV drivers

To complete the upgrade, you must attach the installation media volume to your EC2 instance and use UpgradeHelperService.exe.

To upgrade a Windows Server instance running Citrix PV drivers
  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. In the navigation pane, choose Instances and locate the instance. Make a note of the instance ID and Availability Zone for the instance. You need this information later in this procedure.

  3. Create a new volume from a Windows Server installation media snapshot.

    1. In the navigation pane, choose Snapshots, and next to the filter field, choose Public snapshots.

    2. From the Search field, choose Owner alias, then =, then amazon (new console), or choose Owner and then Amazon images (old console).

    3. From the Search field, choose Description, then : (contains), and then enter Windows (new console), or choose Description and then enter Windows (old console). Press Enter.

    4. Select the snapshot that matches the system architecture of your instance. For example, Windows 2012 Installation Media.

    5. Choose Actions, Create volume from snapshot (new console) or Create Volume (old console).

    6. In the Create volume dialog box, select the Availability Zone that matches your Windows instance, and choose Create volume.

  4. (New console) From the navigation pane, choose Volumes, and then choose the volume that you just created

    (Old console) In the Volume Successfully Created dialog box, choose the volume that you just created.

  5. Choose Actions, Attach volume.

  6. In the Attach volume dialog box, enter the instance ID and choose Attach volume.

  7. On your Windows instance, on the C:\ drive, create a folder named temp.

    Important

    This folder must be available in the same location after the upgrade. Creating the folder in a Windows system folder or a user profile folder, such as the desktop, can cause the upgrade to fail.

  8. Download OSUpgrade.zip and extract the files into the C:\temp folder.

  9. Run C:\temp\UpgradeHelperService.exe and review the C:\temp\Log.txt file for any warnings.

  10. Uninstall PowerShell from the Windows Server 2003 instance.

  11. Begin the upgrade by using Windows Explorer to open the installation media volume that you attached to the instance.

  12. Run the Sources\Setup.exe file.

  13. For Select the operating system you want to install, select the full installation SKU for your Windows Server instance, and then choose Next.

  14. For Which type of installation do you want?, choose Upgrade.

  15. Complete the wizard.

Windows Server Setup copies and processes files. After several minutes, your Remote Desktop session closes. The time it takes to upgrade depends on the number of applications and server roles running on your Windows Server instance. The upgrade process could take as little as 40 minutes or several hours. The instance fails status check 1 of 2 during the upgrade process. When the upgrade completes, both status checks pass. You can check the system log for console output or use Amazon CloudWatch metrics for disk and CPU activity to determine whether the upgrade is progressing.

Post upgrade tasks

  1. Log in to the instance to initiate an upgrade for the .NET Framework and reboot the system when prompted.

  2. Install the latest version of the EC2Config service (Windows 2012 R2 and earlier) or EC2Launch (Windows 2016 and later). For more information, see Install the latest version of EC2Config or Install the latest version of EC2Launch.

  3. Install Microsoft hotfix KB2800213.

  4. Install Microsoft hotfix KB2922223.

  5. If you upgraded to Windows Server 2012 R2, we recommend that you upgrade the PV drivers to AWS PV drivers. If you upgraded on a Nitro-based instance, we recommend that you install or upgrade the NVME and ENA drivers. For more information, see Windows Server 2012 R2, Install or upgrade AWS NVMe drivers using PowerShell, or Enable enhanced networking on Windows.

  6. Re-enable antivirus and anti-spyware software and firewalls.