Monitor Windows fast launch
This section covers how to monitor the Amazon EC2 Windows Server AMIs in your account that have Windows fast launch enabled.
Monitor Windows fast launch state changes with EventBridge
When the state changes for a Windows AMI with Windows fast launch enabled, Amazon EC2 generates an
EC2 Fast Launch State-change Notification
event. Then Amazon EC2 sends the
state change event to Amazon EventBridge (formerly known as Amazon CloudWatch Events).
You can create EventBridge rules that trigger one or more actions in response to the state change event. For example, you can create an EventBridge rule that detects when Windows fast launch is enabled and performs the following actions:
-
Sends a message to an Amazon SNS topic that notifies its subscribers.
-
Invokes a Lambda function that performs some action.
-
Sends the state change data to Amazon Kinesis Data Firehose for analytics.
For more information, see Creating Amazon EventBridge rules that react to events in the Amazon EventBridge User Guide.
State change events
The Windows fast launch feature emits JSON formatted state change events on a best-effort basis. Amazon EC2 sends the events to EventBridge in near real time. This section describes the event fields and shows an example of the event format.
EC2 Fast Launch State-change Notification
- imageId
-
Identifies the AMI with the Windows fast launch state change.
- resourceType
-
The type of resource to use for pre-provisioning. Supported value:
snapshot
. The default value issnapshot
. - state
-
The current state of the Windows fast launch feature for the specified AMI. Valid values include the following:
-
enabling – You've enabled the Windows fast launch feature for the AMI, and Amazon EC2 has started creating snapshots for the pre-provisioning process.
-
enabling-failed – Something went wrong that caused the pre-provisioning process to fail the first time that you enabled the Windows fast launch for an AMI. This can happen anytime during the pre-provisioning process.
-
enabled – The Windows fast launch feature is enabled. The state changes to
enabled
as soon as Amazon EC2 creates the first pre-provisioned snapshot for a newly enabled Windows fast launch AMI. If the AMI was already enabled and goes through pre-provisioning again, the state change happens right away. -
enabled-failed – This state applies only if this is not the first time your Windows fast launch AMI goes through the pre-provisioning process. This can happen if the Windows fast launch feature is disabled and then later enabled again, or if there is a configuration change or other error after pre-provisioning is completed for the first time.
-
disabling – The AMI owner has turned off the Windows fast launch feature for the AMI, and Amazon EC2 has started the clean up process.
-
disabled – The Windows fast launch feature is disabled. The state changes to
disabled
as soon as Amazon EC2 completes the clean up process. -
disabling-failed – Something went wrong that caused the clean up process to fail. This means that some pre-provisioned snapshots may still remain in the account.
-
- stateTransitionReason
-
The reason that the state changed for the Windows fast launch AMI.
Note
All fields in this event message are required.
The following example shows a newly enabled Windows fast launch AMI that has launched
the first instance to start the pre-provisioning process. At this point, the state is
enabling
. After Amazon EC2 creates the first pre-provisioned snapshot, the
state changes to enabled
.
{ "version": "0", "id": "01234567-0123-0123-0123-012345678901", "detail-type": "EC2 Fast Launch State-change Notification", "source": "aws.ec2", "account": "123456789012", "time": "2022-08-31T20:30:12Z", "region": "us-east-1", "resources": [ "arn:aws:ec2:us-east-1:123456789012:image/ami-123456789012" ], "detail": { "imageId": "ami-123456789012", "resourceType": "snapshot", "state": "enabling", "stateTransitionReason": "Client.UserInitiated" } }
Monitor Windows fast launch metrics with CloudWatch
Amazon EC2 AMIs with Windows fast launch enabled send metrics to Amazon CloudWatch. You can use the Amazon Web Services Management Console, the Amazon CLI,
or an API to list the metrics that Windows fast launch sends to CloudWatch. The AWS/EC2
namespace includes the following Windows fast launch metrics:
Metric | Description |
---|---|
NumberOfAvailableFastLaunchSnapshots |
The number of pre-provisioned snapshots available per Windows fast launch enabled AMI. |
NumberOfInstancesFastLaunched |
The number of instances per Windows fast launch enabled AMI that were launched from pre-provisioned snapshots. |
NumberOfInstancesNotFastLaunched |
The number of instances per Windows fast launch enabled AMI that resulted in a cold boot due to the lack of available pre-provisioned snapshots at launch time. |
FastLaunchSnapshotUsedToRefillStartTime |
The timestamp when Amazon EC2 launched a new image from a Windows fast launch enabled AMI to create another snapshot after an existing snapshot was used. |
FastLaunchSnapshotCreationTime |
Measures the time it took for Amazon EC2 to launch an instance and create a snapshot for a Windows fast launch enabled AMI. |