This topic describes how to query and respond to Elastic Compute Service (ECS) system events in the ECS console or using the Alibaba Cloud command-line interface (CLI).
Background information
In addition to the ECS console, you can use Cloud Monitor to query system events for various products, including ECS. You can also set up event notifications for events that you want to follow. For more information, see Query system events and Subscribe to ECS system event notifications.
Query and respond to system events
Console
You can query all system events related to your instances on the Events page in the ECS console.
Go to ECS console - Events.
Query pending system events.
A number next to a category indicates pending system events. The console provides recommended actions for different system events. For example, for an instance expiration event, the recommended action is to renew the instance. For a local disk damage event, the recommended action is to repair the disk. You can follow the instructions on the console or wait for the system to perform them automatically.

To restart an instance or redeploy it in response to an event, you must perform the operation in the console or using OpenAPI.
For information about the API operations, see RebootInstance or RedeployInstance.
NoteRebooting an instance from its operating system with a command such as
rebootis not effective.
CLI
An Elastic Compute Service (ECS) instance is created. Alibaba CLI is installed on the instance. For information about how to install Alibaba Cloud CLI on different operating systems, see the following topics:
In the following commands, replace <TheRegionId> with your actual Region ID.
Call the DescribeInstances operation to obtain the instance ID.
aliyun ecs DescribeInstances --RegionId <TheRegionId> --output cols=InstanceId,InstanceName rows=Instances.Instance[]Call the DescribeInstanceHistoryEvents operation to query system events related to the instance.
Query system events that are in the Scheduled state:
aliyun ecs DescribeInstanceHistoryEvents --RegionId <TheRegionId> --InstanceId <YourInstanceId> --InstanceEventCycleStatus.1 Scheduled --output cols=EventId,EventTypeName rows=InstanceSystemEventSet.InstanceSystemEventType[]Query system events that are in all states (Scheduled, Inquiring, Executing, Executed, Avoided, Canceled, and Failed):
aliyun ecs DescribeInstanceHistoryEvents --RegionId <TheRegionId> --InstanceId <YourInstanceId> --InstanceEventCycleStatus.1 Scheduled --InstanceEventCycleStatus.2 Inquiring --InstanceEventCycleStatus.3 Executing --InstanceEventCycleStatus.4 Executed --InstanceEventCycleStatus.5 Canceled --InstanceEventCycleStatus.6 Avoided --InstanceEventCycleStatus.7 Failed --output cols=EventId,EventTypeName rows=InstanceSystemEventSet.InstanceSystemEventType[]Query system events that are in a finished state (Executed, Avoided, Canceled, or Failed):
aliyun ecs DescribeInstanceHistoryEvents --RegionId <TheRegionId> --InstanceId <YourInstanceId> --InstanceEventCycleStatus.1 Executed --InstanceEventCycleStatus.2 Avoided --InstanceEventCycleStatus.3 Canceled --InstanceEventCycleStatus.4 Failed --output cols=EventId,EventTypeName rows=InstanceSystemEventSet.InstanceSystemEventType[]Query system events that are in an unfinished state (Scheduled, Inquiring, or Executing):
aliyun ecs DescribeInstanceHistoryEvents --RegionId <TheRegionId> --InstanceId <YourInstanceId> --InstanceEventCycleStatus.1 Scheduled --InstanceEventCycleStatus.2 Inquiring --InstanceEventCycleStatus.3 Executing --output cols=EventId,EventTypeName rows=InstanceSystemEventSet.InstanceSystemEventType[]
Call the appropriate API operation to respond to the event.
For example:
or a system event in the
Inquiringstatus, call the AcceptInquiredSystemEvent operation to authorize Alibaba Cloud to perform the action, or ignore the notification to deny authorization.For a system event that requires you to redeploy an instance, call the RedeployInstance operation to redeploy the instance, or wait for the system to automatically perform the action.
For a system event that notifies you of the expiration of a subscription instance, call the RenewInstance operation to renew the instance. Otherwise, the system automatically stops and then releases the instance.
To restart an instance or redeploy it in response to an event, you must perform the operation in the console or using OpenAPI.
For information about the API operations, see RebootInstance or RedeployInstance.
NoteRebooting an instance from its operating system with a command such as
rebootis not effective.
Enable message notifications
To receive event notifications by internal message, email, you must enable the related message types in the Message Center. These types include ECS expiration notices, product O&M notices, and ECS failure notices.
-
Log on to the ECS console.
In the upper-right corner of the page, hover over the
icon and click Message Settings.On the Common Settings page, find the message types that you want to follow. In the Internal Message, Email columns, select the corresponding check boxes.
For example, message types related to ECS system events include Product O&M Notification and ECS Failure Notification.

References
DescribeInstancesFullStatus: Queries the full status of one or more ECS instances. The full status includes the instance status and the system event status. The instance status indicates the lifecycle state of the instance. The system event status indicates the health status related to maintenance events.
DescribeInstanceHistoryEvents: Queries the system event information for a specified instance. You can specify parameters such as InstanceId and EventType. By default, this operation queries historical system events that are in an inactive state.
ReportInstancesStatus: Reports exceptions on one or more ECS instances.