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

Background information

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

View and handle system events on the Events page in the ECS console

You can view 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 appears next to a category of system events, it indicates that some events of this category are pending. Different handling methods are recommended for different system events. For example, 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 execute the O&M task related to an event as instructed in the ECS console, or wait for the task to be automatically executed. eventpage
  4. If your instance needs to be restarted or redeployed in response to an event, use the ECS console or call an API operation to restart or redeploy the instance. Otherwise, the restart or redeployment operation does not take effect.
    For more information, see Restart instances or RebootInstance.
    Note The restart operation does not take effect if you run the reboot command in the operating system to restart the instance.

View and handle system events on the Instance Details page in the ECS console

You can view the system events of an instance on the Instance Details page in the ECS console.

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Instances & Images > Instances.
  3. In the top navigation bar, select a region.
  4. Find the instance whose system events that you want to view and click Manage in the Actions column.
  5. Click the Events tab.
  6. View pending system events.
    If a number appears next to a category of system events, it indicates that some events of this category are pending. Different handling methods are recommended for different system events. For example, 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 execute the O&M task related to an event as instructed in the ECS console, or wait for the task to be automatically executed. instance-detail
  7. If your instance needs to be restarted or redeployed in response to an event, use the ECS console or call an API operation to restart or redeploy the instance. Otherwise, the restart or redeployment operation does not take effect.
    For more information, see Restart instances or RebootInstance.
    Note The restart operation does not take effect if you run the reboot command in the operating system to restart the instance.

Query and handle system events by using Alibaba Cloud CLI

You can use Alibaba Cloud CLI to call API operations. For more information, see What is Alibaba Cloud CLI? This section describes a sample procedure on how to query and handle system events by calling API operations in Alibaba Cloud CLI.

  1. Call the DescribeInstances operation to obtain 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 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 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 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 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 corresponding API operations.
    Examples:
    • For a system event in the Inquiring state, call the AcceptInquiredSystemEvent operation to authorize Alibaba Cloud to execute the O&M task related to the event, or ignore the event.
    • For a system event that an instance is scheduled to be redeployed, call the RedeployInstance operation to redeploy the instance, or wait for the instance to be automatically redeployed.
    • For a system event that a subscription instance has expired, 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, use the ECS console or call an API operation to restart or redeploy the instance. Otherwise, the restart or redeployment operation does not take effect.
    For more information, see Restart instances or RebootInstance.
    Note The restart operation does not take effect if you run the reboot command in the operating system to restart the instance.

Allow ECS event notifications to be received

If you want to receive event notifications by internal message or by email, you must 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. In the right part 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 need, and then select one or more notification methods such as internal message and email that suit your needs.
    Example notification types: Product operation notifications, Notifications of Product Expiration, and ECS Fault Notifications. notice-center-intl