ECS can send notifications on ECS instances for events such as system events, changes in lifecycle status, and the release of preemptible instances.

Events

ECS can send notifications in the case of the following events:

System events

When a system event first occurs on an instance, ECS pushes an event notification for the first time. Every time the event status changes, ECS sends a notification. For more information about event notification names for various system events, see the following section Appendix: Names of event notifications corresponding to instance system events.

The following examples show the notifications in JSON format of the event that an instance is restarted after planned system maintenance or security update (SystemMaintenance.Reboot):

  • When ECS publishes the system event for the first time, the event is in the Scheduled state.
    {
      "ver": "1.0",
      "id": "2256A988-0B26-4E2B-820A-8A********E5",
      "product": "ECS",
      "resourceId": "acs:ecs:cn-hangzhou:169070********30:instance/i-bp1ecr********5go2go",
      "level": "CRITICAL",
      "name": "Instance:SystemMaintenance.Reboot:Scheduled",
      "userId": "169070********30",
      "eventTime": "20190409T121826.922+0800",
      "regionId": "cn-hangzhou",
      "content": {
        "eventId": "e-bp11trd********pqum2",
        "publishTime": "2019-04-09T04:18:26Z",
        "notBefore": "2019-04-12T01:01:01Z",      
        "instanceId": "i-bp1ecr********5go2go",   
        "eventType": "SystemMaintenance.Reboot",  
        "eventStatus": "Scheduled"
      }
    }
  • If you restart the instance before the scheduled execution time of the system event (notBefore), the system event is bypassed and ECS publishes the notification that the system event status changes to Avoided.
    {
      "ver": "1.0",
      "id": "2256A988-0B26-4E2B-820A-8A********E5",
      "product": "ECS",
      "resourceId": "acs:ecs:cn-hangzhou:169070********30:instance/i-bp1ecr********5go2go",
      "level": "CRITICAL",
      "name": "Instance:SystemMaintenance.Reboot:Scheduled",
      "userId": "169070********30",
      "eventTime": "20190410T160101.922+0800",
      "regionId": "cn-hangzhou",
      "content": {
        "eventId": "e-bp11trdr********qum2",
        "publishTime": "2019-04-09T04:18:26Z",
        "notBefore": "2019-04-12T01:01:01Z",
        "instanceId": "i-bp1ecr********5go2go",
        "eventType": "SystemMaintenance.Reboot",
        "eventStatus": "Avoided",
        "executeStartTime": "2019-04-10T08:01:01Z",  
        "executeFinishTime": "2019-04-10T08:01:01Z"  
      }
    }
Description of the content field:
Field Description Example
eventId The ID of the system event. e-t4navn7********6x5no
publishTime The time when the system event is published. 2019-04-09T04:18:26Z
notBefore The scheduled time when the system event is executed. The notBefore field has a value only for maintenance-type system events and has no value for exception system events. 2019-04-12T01:01:01Z
instanceId The ID of the affected instance. i-bp1ecr********5go2go
eventType The type of the system event. For more information about the field values, see System events. SystemMaintenance.Reboot
eventStatus The status of the system event. For more information about the field values, see System events. Avoided
executeStartTime The time when the system event starts being executed. It is in UTC. 2019-04-10T08:01:01Z
executeFinishTime The time when the system event is completely executed. It is in UTC.
Note ECS returns the executeStartTime and executeFinishTime parameter values only when the system events are in one of the following states: Executing, Executed, Canceled, and Avoided.
2019-04-10T08:01:01Z

Changes in lifecycle status

If the instance status changes, ECS sends an event notification. For more information about instance status changes, see ECS instance lifecycle.

The following example shows the format of an event notification when the status of the instance that is in the Running state changes:

{
  "ver": "1.0",
  "id": "2256A988-0B26-4E2B-820A-8A********E5",
  "product": "ECS",
  "resourceId": "acs:ecs:cn-hangzhou:169070********30:instance/i-bp1ecr********5go2go",
  "level": "INFO",
  "name": "Instance:StateChange",
  "userId": "169070********30",
  "eventTime": "20190409T121826.922+0800",
  "regionId": "cn-hangzhou",
  "content": {
    "resourceId": "i-bp1ecr********5go2go",  
    "resourceType": "ALIYUN::ECS::Instance", 
    "state": "Running"                       
  }
}
Description of the content field:
Field Description Example
resourceId The ID of the instance. i-bp1ecr********5go2go
resourceType The type of the resource. Set the value to ALIYUN::ECS::Instance. ALIYUN::ECS::Instance
state The status of the instance. Valid values:
  • Pending: The instance is being prepared.
  • Starting: The instance is being started.
  • Running: The instance is running.
  • Stopping: The instance is being stopped or restarted.
  • Stopped: The instance has been stopped.
  • Deleted: The instance has been released.
Running

Release of a preemptible instance

Preemptible instances may be automatically released due to changes in market prices or insufficient resources. Five minutes before a preemptible instance is released, ECS sends an event notification to warn you about the interruption of the instance. For more information, see Overview.

The following example shows the event notification in JSON format:

{
  "ver": "1.0",
  "id": "2256A988-0B26-4E2B-820A-8A********E5",
  "product": "ECS",
  "resourceId": "acs:ecs:cn-hangzhou:169070********30:instance/i-bp1ecr********5go2go",
  "level": "INFO",
  "name": "Instance:PreemptibleInstanceInterruption",
  "userId": "169070********30",
  "eventTime": "20190409T121826.922+0800",
  "regionId": "cn-hangzhou",
  "content": {
    "instanceId": "i-bp1ecr********5go2go",  
    "action": "delete"                       
  }
}
Description of the content field:
Field Description Example
instanceId The ID of the preemptible instance. i-bp1ecr********5go2go
action The operation event for the preemptible instance. Set the value to delete. delete

Hot migration of ECS instances on a dedicated host

You can call the ModifyInstanceDeployment operation to implement hot migration of ECS instances between dedicated hosts. Hot migration of ECS instances is asynchronous and the status of the ECS instances does not change during migration. By configuring the event notification (Instance:LiveMigrationAcrossDDH), you can receive updates when the operation is complete.

The following examples show the event notifications in JSON format:

  • The hot migration starts:
    {
      "ver": "1.0",
      "id": "2256A988-0B26-4E2B-820A-8A0580D0B8E5",
      "product": "ECS",
      "resourceId": "acs:ecs:cn-hangzhou:169070********30:instance/i-bp1ecr********5go2go",
      "level": "INFO",
      "instanceName": "instance-event-subscription",
      "name": "Instance:LiveMigrationAcrossDDH",
      "userId": "169070********30",
      "eventTime": "20180608T092537.922+0800",
      "regionId": "cn-hangzhou",
      "content": {
          "instanceId" : "i-bp1ecr********5go2go",
          "sourceDedicatedHostId" : "dh-2ze3lm********t8nr82",
          "destinationDedicatedHostId" : "dh-2ze3lm********t8nr83",
          "startTime" : "2018-06-08T01:25:37Z",
          "status" : "started"
      }
    }
  • The hot migration succeeds:
    {
      "ver": "1.0",
      "id": "2256A988-0B26-4E2B-820A-8A0580D0B8E5",
      "product": "ECS",
      "resourceId": "acs:ecs:cn-hangzhou:169070********30:instance/i-bp1ecr********5go2go",
      "level": "INFO",
      "instanceName": "instance-event-subscription",
      "name": "Instance:LiveMigrationAcrossDDH",
      "userId": "169070********30",
      "eventTime": "20180608T092545.922+0800",
      "regionId": "cn-hangzhou",
      "content": {
          "instanceId" : "i-bp1ecr********5go2go",
          "sourceDedicatedHostId" : "dh-2ze3lm********t8nr82",
          "destinationDedicatedHostId" : "dh-2ze3lm********t8nr83",
          "startTime" : "2018-06-08T01:25:37Z",
          "endTime" : "2018-06-08T01:25:45Z",
          "status" : "accomplished"
      }
    }
  • The hot migration fails:
    {
      "ver": "1.0",
      "id": "2256A988-0B26-4E2B-820A-8A0580D0B8E5",
      "product": "ECS",
      "resourceId": "acs:ecs:cn-hangzhou:169070********30:instance/i-bp1ecr********5go2go",
      "level": "INFO",
      "instanceName": "instance-event-subscription",
      "name": "Instance:LiveMigrationAcrossDDH",
      "userId": "169070********30",
      "eventTime": "20180608T092545.922+0800",
      "regionId": "cn-hangzhou",
      "content": {
          "instanceId" : "i-bp1ecr********5go2go",
          "sourceDedicatedHostId" : "dh-2ze3lm********t8nr82",
          "destinationDedicatedHostId" : "dh-2ze3lm********t8nr83",
          "startTime" : "2018-06-08T01:25:37Z",
          "endTime" : "2018-06-08T01:25:45Z",
          "status" : "failed"
      }
    }
Description of the content field:
Field Description Example
instanceId The ID of the ECS instance. i-bp1ecr********5go2go
sourceDedicatedHostId The ID of the source dedicated host. dh-2ze3lm********t8nr82
destinationDedicatedHostId The ID of the destination dedicated host. dh-2ze3lm********t8nr83
startTime The start time of the migration. It is in UTC. 2018-06-08T01:25:37Z
endTime The end time of the migration. It is in UTC. 2018-06-08T01:25:45Z
status The status of the hot migration. Valid values:
  • started: The migration has started.
  • failed: The migration has failed.
  • accomplished: The migration succeeded.
accomplished

Changes in the performance mode of a burstable instance

If the performance mode of a burstable instance changes, ECS sends an event notification which is named Instance:PerformanceModeChange.

The following example shows the event notification in JSON format:

{
    "ver": "1.0",
    "id": "2256A988-0B26-4E2B-820A-8A0580D0B8E5",
    "product": "ECS",
    "resourceId": "acs:ecs:cn-hangzhou:169070********30:instance/i-bp1ecr********5go2go",
    "level": "INFO",
    "name": "Instance:PerformanceModeChange",
    "userId": "169070********30",
    "eventTime": "20190409T121826.922+0800",
    "regionId": "cn-hangzhou",
    "content": {
        "instanceId" : "i-bp1ecr********5go2go",
        "creditSpecification" : "Unlimited",
        "operator" : "System"
    }
}
Description of the content field:
Field Description Example
instanceId The ID of the ECS instance. i-bp1ecr********5go2go
creditSpecification The performance mode after the change. Valid values:
  • Standard: standard mode.
  • Unlimited: unlimited mode.
Standard
operator The person (thing) who triggered the event. Valid values:
  • User: You change the instance performance mode by using the ECS console or manually calling API operations.
  • System: The system automatically changes the instance performance mode due to CPU credit exhaustion, usage limits on the feature of No Fees for Stopped Instances, and overdue payments. For more information, see Manage performance modes of a burstable performance instance.
User

Limits on the performance of burstable instances

If CPU credits are exhausted, the instance performance is limited to below the baseline performance. When the performance is limited, the burstable instance is in the limited mode. The event notification name is Instance:BurstablePerformanceRestricted.
Note If the granularity of performance limit events, namely the interval between the event start time and the event end time, is one hour, the performance limit event occurred but did not necessarily persist on the burstable instance during the event period. If the instance remains in a limited state for a long time, an event is generated every hour.

The following example shows the event notification in JSON format:

{
    "ver": "1.0",
    "id": "2256A988-0B26-4E2B-820A-8A0580D0B8E5",
    "product": "ECS",
    "resourceId": "acs:ecs:cn-hangzhou:169070********30:instance/i-bp1ecr********5go2go",
    "level": "INFO",
    "name": "Instance:BurstablePerformanceRestricted",
    "userId": "169070********30",
    "eventTime": "20190409T121826.922+0800",
    "regionId": "cn-hangzhou",
    "content": {
        "instanceId" : "i-bp1ecr********5go2go",
        "intervalStart" : "2019-11-11T11:00Z",
        "intervalEnd" : "2019-11-11T12:00Z"
    }
}
Description of the content field:
Field Description Example
instanceId The ID of the ECS instance. i-bp1ecr********5go2go
intervalStart The start time of the performance limit period. It is in UTC. 2019-11-11T11:00Z
intervalEnd The end time of the performance limit period. It is in UTC. 2019-11-11T12:00Z

Appendix: Names of event notifications corresponding to instance system events

Impact Type and code of event Name and code of event notification
The instance is restarted. An instance is restarted after planned system maintenance or security update (SystemMaintenance.Reboot)
  • Notifications of scheduled instance reboot due to system maintenance: Instance:SystemMaintenance.Reboot:Scheduled
  • The scheduled instance reboot due to system maintenance is being executed: Instance:SystemMaintenance.Reboot:Executing
  • The scheduled instance reboot due to system maintenance is completed: Instance:SystemMaintenance.Reboot:Executed
  • The scheduled instance reboot due to system maintenance is bypassed: Instance:SystemMaintenance.Reboot:Avoided
  • The scheduled instance reboot due to system maintenance is canceled: Instance:SystemMaintenance.Reboot:Canceled
  • The scheduled instance reboot due to system maintenance fails: Instance:SystemMaintenance.Reboot:Failed
The instance is unexpectedly restarted. An instance is restarted due to system failure (SystemFailure.Reboot)
  • Instance reboot due to system failure begins: SystemFailure.Reboot:Executing
  • Instance reboot due to system failure ends: Instance:SystemFailure.Reboot:Executed
The instance is unexpectedly restarted. An instance is restarted due to instance failure (InstanceFailure.Reboot)
  • Instance reboot due to instance failure begins: Instance:InstanceFailure.Reboot:Executing
  • Instance reboot due to instance failure ends: Instance:InstanceFailure.Reboot:Executed
The instance is redeployed. An instance is redeployed due to system maintenance (SystemMaintenance.Redeploy)
  • Notifications of scheduled instance redeployment due to system maintenance: Instance:SystemMaintenance.Redeploy:Scheduled
  • The scheduled instance redeployment due to system maintenance is being executed: Instance:SystemMaintenance.Redeploy:Executing
  • The scheduled instance redeployment due to system maintenance is completed: Instance:SystemMaintenance.Redeploy:Executed
  • The scheduled instance redeployment due to system maintenance is bypassed: Instance:SystemMaintenance.Redeploy:Avoided
  • The scheduled instance redeployment due to system maintenance is canceled: Instance:SystemMaintenance.Redeploy:Canceled
The instance is redeployed. Instance is redeployed due to system failure (SystemFailure.Redeploy)
  • Notifications of scheduled instance redeployment due to system failure: Instance:SystemFailure.Redeploy:Scheduled
  • Instance redeployment due to system failure is being executed: Instance:SystemFailure.Redeploy:Executing
  • Instance redeployment due to system failure is completed: Instance:SystemFailure.Redeploy:Executed
  • Instance redeployment due to system failure is bypassed: Instance:SystemFailure.Redeploy:Avoided
  • Instance redeployment due to system failure is canceled: Instance:SystemFailure.Redeploy:Canceled
The instance is restarted and the damaged local disk is isolated. The instance is restarted and the damaged local disk is replaced due to scheduled system maintenance (SystemMaintenance.RebootAndIsolateErrorDisk)
  • The events that the instance is restarted and the damaged disk is isolated due to system maintenance are under query: Instance:SystemMaintenance.RebootAndIsolateErrorDisk:Inquiring
  • The events that the instance is restarted and the damaged disk is isolated due to system maintenance are being executed: Instance:SystemMaintenance.RebootAndIsolateErrorDisk:Executing
  • The events that the instance is restarted and the damaged disk is isolated due to system maintenance are completed: Instance:SystemMaintenance.RebootAndIsolateErrorDisk:Executed
  • The events that the instance is restarted and the damaged disk is isolated due to system maintenance are bypassed: Instance:SystemMaintenance.RebootAndIsolateErrorDisk:Avoided
  • The events that the instance is restarted and the damaged disk is isolated due to system maintenance are canceled: Instance:SystemMaintenance.RebootAndIsolateErrorDisk:Canceled
The instance is restarted and the damaged local disk recovers. The instance is restarted and the damaged local disk is reinitialized due to scheduled system maintenance (SystemMaintenance.RebootAndReInitErrorDisk)
  • The events that the instance is restarted and the damaged local disk is reinitialized due to scheduled system maintenance are under query: Instance:SystemMaintenance.RebootAndReInitErrorDisk:Inquiring
  • The events that the instance is restarted and the damaged local disk is reinitialized due to scheduled system maintenance are being executed: Instance:SystemMaintenance.RebootAndReInitErrorDisk:Executing
  • The events that the instance is restarted and the damaged local disk is reinitialized due to scheduled system maintenance are completed: Instance:SystemMaintenance.RebootAndReInitErrorDisk:Executed
  • The events that the instance is restarted and the damaged local disk is reinitialized due to scheduled system maintenance are bypassed: Instance:SystemMaintenance.RebootAndReInitErrorDisk:Avoided
  • The events that the instance is restarted and the damaged local disk is reinitialized due to scheduled system maintenance are canceled: Instance:SystemMaintenance.RebootAndReInitErrorDisk:Canceled
The instance is released. The instance is automatically released due to instance creation failure (SystemFailure.Delete)
  • The event that the instance is automatically released due to instance creation failure is being executed: Instance:SystemFailure.Delete:Executing
  • The event that the instance is automatically released due to instance creation failure is completed: Instance:SystemFailure.Delete:Executed
  • The event that the instance is automatically released due to instance creation failure is bypassed: Instance:SystemFailure.Delete:Avoided