All Products
Search
Document Center

Elastic Compute Service:Query and handle ECS system events

Last Updated:Dec 18, 2024

This topic describes how to query and handle Elastic Compute Service (ECS) system events in the ECS console or by using Alibaba Cloud CLI.

Background information

You can view and handle ECS system events in the ECS console. You can also view the system events of ECS and other Alibaba Cloud services and configure system event notifications in the CloudMonitor console. For more information, see View system events and Configure event notifications.

View and handle system events

Using the ECS console

You can view the system events of all instances on the Events page in the ECS console.

  1. Log on to the ECS console.

  2. In the left-side navigation pane, click Events.

  3. View pending system events.

    If a number is displayed next to a category of system events, specific events of the category are pending. Different handling methods are recommended for different system events. For an instance expiration event, we recommend that you renew the expired instance. For a local disk damage event, we recommend that you repair the damaged local disk. You can manually run the O&M task that is related to an event by following the instructions in the ECS console, or wait for the task to automatically run.eventpage

  4. If your instance needs to be restarted or redeployed in response to an event, you can restart or redeploy the instance only in the ECS console or by calling an API operation.

    For more information, see Restart an instance or RebootInstance.

    Note

    If you run the reboot command in the operating system to restart the instance, the restart operation does not take effect.

Using Alibaba Cloud 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:

Note

Replace <TheRegionId> in the following command with the actual region ID.

  1. Call the DescribeInstances operation to query the ID of an instance.

    aliyun ecs DescribeInstances --RegionId <TheRegionId> --output cols=InstanceId,InstanceName rows=Instances.Instance[]
  2. Call the DescribeInstanceHistoryEvents operation to query the system events of 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=rows=InstanceSystemEventSet.InstanceSystemEventType[]
    • Query system events that are in the Scheduled, Inquiring, Executing, Executed, Avoided, Canceled, and Failed states.

      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=rows=InstanceSystemEventSet.InstanceSystemEventType[]
    • Query system events that are in the Executed, Avoided, Canceled, and Failed states.

      aliyun ecs DescribeInstanceHistoryEvents --RegionId <TheRegionId> --InstanceId <YourInstanceId> --InstanceEventCycleStatus.1 Executed --InstanceEventCycleStatus.2 Avoided --InstanceEventCycleStatus.3 Canceled --InstanceEventCycleStatus.4 Failed --output cols=EventId,EventTypeName rows=rows=InstanceSystemEventSet.InstanceSystemEventType[]
    • Query system events that are in the Scheduled, Inquiring, and Executing states.

      aliyun ecs DescribeInstanceHistoryEvents --RegionId <TheRegionId> --InstanceId <YourInstanceId> --InstanceEventCycleStatus.1 Scheduled --InstanceEventCycleStatus.2 Inquiring --InstanceEventCycleStatus.3 Executing --output cols=EventId,EventTypeName rows=rows=InstanceSystemEventSet.InstanceSystemEventType[]
  3. Select appropriate methods to handle the events and call the corresponding API operations.

    Examples:

    • For a system event in the Inquiring state, call the AcceptInquiredSystemEvent operation to authorize Alibaba Cloud to run the O&M task that is related to the event, or ignore the event.

    • For a system event that indicates the scheduled redeployment of an instance, call the RedeployInstance operation to redeploy the instance or wait for the instance to be automatically redeployed.

    • For a system event that indicates the expiration of a subscription instance, call the RenewInstance operation to renew the instance or wait for the instance to be automatically stopped and released.

  4. If your instance needs to be restarted or redeployed in response to an event, you can restart or redeploy the instance only in the ECS console or by calling an API operation.

    For more information, see Restart an instance or RebootInstance.

    Note

    If you run the reboot command in the operating system to restart the instance, the restart operation does not take effect.

Allow ECS system event notifications to be received

If you want to receive system event notifications by internal message or email, allow notifications, such as resource expiration notifications, O&M notifications, and fault notifications, to be received in the Message Center.

  1. Log on to the ECS console.

  2. On the right side of the top navigation bar, move the pointer over the notice icon and click Message Settings.

  3. In the Message Center, choose Message Settings > Common Settings to go to the Common Settings page, find the notification types that you want to use, and then select one or more notification methods, such as internal message and email, based on your business requirements.

    Sample notification types: Product operation notifications, Notifications of Product Expiration, and ECS Fault Notifications.notice-center-intl

References

  • DescribeInstancesFullStatus: queries the full status information of one or more ECS instances. The full status information includes the instance status and the status of instance system events. The instance status is the lifecycle status of instances. The status of instance system events is the health status of maintenance events.

  • DescribeInstanceHistoryEvents: queries the system events of ECS instances. When you call this operation, you can specify parameters, such as InstanceId and EventType, in the request. By default, inactive system events are queried.