Launch Microsoft Windows Server instances on Amazon EC2 up to 65% faster than before
AWS customers running Microsoft Windows Server instances face long wait times while provisioning instances, as the Windows Server operating system (OS) goes through a lengthy boot process. For developers and IT professionals, this can make it difficult to support deployment time and system capacity service level agreements (SLAs). When meeting highly-demanding SLAs for mission-critical workloads, IT teams often require faster provisioning of compute resources, while avoiding cost overruns. Faster and more reliable provisioning of resources can meet the time sensitive requirements of mission-critical workloads in scaling or recovery.
AWS announced the functionality to launch Amazon Elastic Compute Cloud (Amazon EC2) instances running Microsoft Windows Server OS at up to 65% faster than before. Customers can use the faster launching functionality for both stock (AWS managed) and custom Amazon Machine Images (AMIs). For custom AMIs, the launch time is reduced to about 85s from a typical 242s, and for stock AMIs, launch times of about 45s are being achieved. By launching Windows instances faster, the new functionality helps in the timely provisioning of instances at scale, improved SLAs in supporting spiky workloads, and faster response in meeting recovery or fail-over service requests.
In this blog post, we take you through some use cases for this faster launching functionality and provide a detailed step-by-step procedure to enable it on your AMIs through the Amazon EC2 console or AWS Command Line Interface (CLI) or Application Programming Interface (API).
The fast launching of custom Windows AMIs helps meet the requirement for time-sensitive or high-demand instances where launch time is critical for success. The custom Windows AMIs generally run software, such as Microsoft SharePoint, Microsoft Dynamics CRM, Microsoft Active Directory, or a custom .NET-based application deployed on Windows Server or on Microsoft Internet Information Server (IIS). Following are a few use cases where fast launching custom AMIs can be leveraged.
Scalable workload deployment helps meet fluctuating resource demand and optimizes cost performance by on-demand, optimal use of resources. One of the use cases is handling time-sensitive, large-scale events, such as large-scale migrations, social or corporate events, a country’s election, etc. Another use case is batch processing jobs for daily, weekly or monthly handling of data ingestion, cleansing, and curation. Timely scaling of custom Windows AMI-based EC2 instances are important for the success of these events. The Windows faster launching feature helps scale with a faster launch of the EC2 instances.
Disaster Recovery (DR)
Customers may deploy a disaster recovery plan in backup & restore, Pilot Light or Warm Standby configurations. These deployments extensively use custom windows AMIs with the Microsoft stack of software, such as SharePoint, Dynamics CRM, etc. Fast launch of the EC2 instances at the DR site is important to meet the Recovery Time Objective (RTO). The Windows faster launching feature helps meet the RTO requirement for the deployment strategy.
Many 3rd-party software or AWS partner solutions use an active-passive clustering mechanism to address fail-over requirement. When the active EC2 instance(s) become unavailable, the passive EC2 instance(s) take over and become active. Most of these configurations use custom Windows AMIs that run Microsoft software or AWS partner solutions using Microsoft software. Faster restoration of the passive EC2 instance(s) helps resume the cluster service. The Windows fast launching feature expedites the cluster resumption time.
Windows faster launching is available for both stock AMIs (AWS pre-optimizes 20 of the most popular Amazon-managed images) and custom Windows AMIs. For the stock AMIs, it’s available out of the box, and for the custom AMIs, image optimization configuration is required.
Custom AMIs are configured for image optimization using the AWS Management Console, AWS CLI, API, or Amazon EC2 Image Builder. When configuring custom AMIs for image optimization, you need to select Enable Windows faster launching configuration option and also specify anticipated image launch frequency. The anticipated image launch frequency is used to specify how many EC2 instances you want to launch in an hour. The launch frequency can be selected from a pre-defined frequency, such as low – 5 launches per hour, or can also be defined as a custom value, such as 50 launches per hour. (Theoretical limit for the parameter is 200,000, but for all practical purposes, it is not advisable to try.)
Pre-provisioned snapshots are used to reduce the EC2 Windows Instance launch time when using optimized Windows AMIs. Amazon EC2 launches an instance using Windows AMI in order to create pre-provisioned snapshots. It completes steps such as Sysprep specialize, Windows Out of Box Experience (OOBE), and rebooting as required. Finally, it stops the instance and creates snapshots, which are then used for the subsequent launches, making the launches faster.
Based on launch frequency configuration, the reserved snapshots automatically replenish when used up. You can increase the launch frequency in advance to address the need for a spike in the number of instances to handle any special event. The launch frequency can be reset back when the requirements return to normal.
Enabling the feature
Please review the Prerequisites section before enabling this feature and kindly note that the Windows AMI must be created using Sysprep with the shutdown option in order to choose this faster launching feature on the AMI.
For the demo outlines in this blog post, there are two Windows custom AMIs created using sysprep Windows EC2 instances (see Figure 1). One AMI includes pre-configured Microsoft Active Directory, while the other includes pre-configured Microsoft SQL Server (see Figure 2) — both configured with a default root drive.
Figure 1. EC2 Instances
Figure 2. Custom AMIs
Using these AMIs, the following sections describe how to enable the Windows faster launching feature using the AWS Management Console and CLI.
Using AWS Management Console
Follow these steps to enable this Windows faster launching feature in the AWS Management Console.
- Open the Amazon EC2 console athttps://console.aws.amazon.com/ec2/. In the navigation pane, under Images, choose AMIs (see Figure 3).
Figure 3. EC2 Console AMI Menu Option
- Choose the AMI for which you want to enable the feature (see Figure 4).
Figure 4. Select the Custom AMI
- From the Actions menu, choose Manage image optimization (see Figure 5). This opens the Manage image optimizations page, where you can configure the settings for faster launching.
Figure 5. Image Optimization Option
- Select the Enable Windows faster launching check box (see Figure 6).
Figure 6. Windows Faster Launching Configuration
- From the Set anticipated launch frequency drop-down list, select a value to specify the number of snapshots that are to be created and maintained to cover your expected instance launch volume. For this demo, I selected Low-5 launches per hour option (see Figure 7).
Figure 7. Image Launch Frequency Configuration
- Select the Save Changes button to enable the feature when you complete the configuration.
- When you enable the feature, a few configuration and automation happen under the hood which are worth knowing:
- A number of EC2 instances are launched as per the launch frequency configuration. These EC2 instances are used for creating the snapshots for the fast launching. These EC2 instances automatically terminate when the snapshots are created and ready (see Figure 8).
Figure 8. EC2 Instances Launched for Snapshots
- A default Launch template gets created under the Launch templates, which is version-controlled. The launch templates dictate the instance type to be launched.
Figure 9. Launch Template
Figure 10. Service Linked Role
- Under Snapshots, you can see the snapshots that were created for the images (see Figure 11). These snapshots are used for the subsequent launches.
Figure 11. The Snapshots
Disabling the feature through the AWS Management Console
Clear the Enable Windows faster launching check box to stop faster launching for EC2 Windows instances and to remove pre-provisioned snapshots (see Figure 6). The AMI will then use the standard launch process for each instance going forward.
Please refer to the Windows Fast Launch Config documentation for more information and options.
In this section, we covered the steps to configure the Windows faster launching feature using the AWS Management Console. In the next section, we will configure the feature using AWS CLI.
Using AWS CLI
Following are the steps to enable Windows faster launching feature using AWS CLI. Please be sure to sysprep the Windows EC2 instance before enabling this feature.
Note: Please make sure you are running the latest CLI version (at least 2.4.15) in order for the enable-fast-launch command to show up. You can also use CloudShell from the console to do the same.
Run the following AWS CLI command to enable Windows faster launching feature for an AMI. In this example, the AMI image ID is ami-07d3ee0bb1b8e8614 (see Figure 12
aws ec2 enable-fast-launch --image-id ami-07d3ee0bb1b8e8614 --snapshot-configuration TargetResourceCount=10 --resource-type snapshot
Figure 12. AWS CLI for Faster Launch
Estimated cost of using the service
There is no additional service charge for using the faster launching functionality. Only the underlying AWS resources running in the customer Account as part of the service are billed.
To illustrate, let us look at the scenario of enabling faster launching with a default frequency setting of 5 launches per hour. The service pre-launches 5 T instances in the background, taking Windows Server OS through the Sysprep stages in boot process. This step takes around 15 minutes (this varies depending on how busy the zone/region is and how large the AMI is). The runtime of each T instance and the attached EBS volume are billed. Next, the service takes a snapshot corresponding to each instance and stores them. The storage of 5 snapshots in S3 is billed. Each snapshot gets used up when an instance is fast launched from the AMI. So, the cost of S3 storage depends on the duration for which the snapshot is stored before getting used up for a fast launch from the AMI.
Typically, we see that a snapshot lives for around 4-8 hours before being used. When all 5 snapshots are consumed, the service automatically replenishes them in the background by running T instances and capturing snapshots. If the service is used for a whole month, the total cost per AMI would be around $5.00 – $6.00 per month for a 50 GB volume AMI with a default setting of 5 launches per hour. The cost calculations provided here are only estimates and actual costs may vary based on usage and other factors.
In this post, we covered how customers can set up essential, time-sensitive images – such as those used for scaling, disaster recovery, or fail-over events – to be readied for fast launch with a simple feature configuration. The configuration is enabled in the AMI Management section of the Amazon EC2 Console via API/CLI commands or in Image Builder. Learn more from the What’s New announcement and the documentation for launching Windows instances faster.
AWS can help you assess how your company can get the most out of cloud. Join the millions of AWS customers that trust us to migrate and modernize their most important applications in the cloud. To learn more on modernizing Windows Server or SQL Server, visit Windows on AWS. Contact us to start your migration journey today.