ECS sends event notifications for instance events such as O&M events, lifecycle state changes, and preemptible instance interruptions.
Event types
ECS sends event notifications for the following instance events:
O&M events
ECS sends an initial notification when an O&M event occurs, and a new notification each time the event status changes. For a list of notification names that correspond to specific O&M events, see Appendix: Notification names for instance O&M events.
The following example is a JSON notification for an instance restart due to system maintenance (SystemMaintenance.Reboot) event.
When an O&M event is first published, the event is in the Scheduled (Scheduled) state.
{ "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 an instance before its scheduled O&M event time (notBefore), the event is avoided and a notification is published stating that the event status has changed to Avoided.
{ "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 parameter:
Field | Description | Example |
eventId | The ID of the O&M event. | e-t4navn7********6x5no |
publishTime | The time when the O&M event was published. | 2019-04-09T04:18:26Z |
notBefore | The scheduled execution time of the O&M event. This parameter is specified only for maintenance O&M events. Exception O&M events do not have a notBefore time. | 2019-04-12T01:01:01Z |
instanceId | The ID of the affected instance. | i-bp1ecr********5go2go |
eventType | The type of the O&M event. For more information, see Overview of ECS system events. | SystemMaintenance.Reboot |
eventStatus | The status of the O&M event. For more information, see Overview of ECS system events. | Avoided |
executeStartTime | The start time of the O&M task, in UTC. | 2019-04-10T08:01:01Z |
executeFinishTime | The end time of the O&M task, in UTC. Note Only O&M events in the Executing (Executing), Executed (Executed), Canceled (Canceled), and Avoided (Avoided) states return the executeStartTime and executeFinishTime attributes. | 2019-04-10T08:01:01Z |
Lifecycle state changes
ECS sends an event notification when an instance's state changes. For more information about instance states, see Instance lifecycle.
Taking a state change to Running (Running) as an example, the format of the event notification is as follows.
{
"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"
}
}content field description:
Field | Description | Example |
resourceId | The instance ID. | i-bp1ecr********5go2go |
resourceType | Resource type. Valid values: ALIYUN::ECS::Instance. | ALIYUN::ECS::Instance |
state | The state of the instance. Valid values:
| Running |
Preemptible instance interruptions
A preemptible instance can be automatically released due to market price changes or resource inventory adjustments. Five minutes before the release, ECS sends a preemptible instance interruption event. For more information, see What is a preemptible instance?.
The following is an example JSON notification.
{
"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"
}
}The content field is described as follows:
Field | Description | Example |
instanceId | The ID of the preemptible instance. | i-bp1ecr********5go2go |
action | The operation event for the preemptible instance. Valid values: delete. | delete |
Hot migration on dedicated hosts
You can call the ModifyInstanceDeployment operation to perform a hot migration of an ECS instance between dedicated hosts. Hot migration is an asynchronous operation, and the status of the ECS instance does not change during the migration. You can set up an event notification for the Instance:LiveMigrationAcrossDDH event to know if the hot migration is successful.
The following are example JSON notifications.
Hot migration started:
{ "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" } }Hot migration successful:
{ "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" } }Hot migration failed:
{ "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 migration start time, in UTC. | 2018-06-08T01:25:37Z |
endTime | The migration end time, in UTC. | 2018-06-08T01:25:45Z |
status | The migration status. Valid values:
| accomplished |
Performance mode changes for burstable instances
After a burstable instance switches its performance mode, it sends an event notification named Instance:PerformanceModeChange.
The following is an example JSON notification.
{
"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 new performance mode. Valid values:
| Standard |
operator | The operator that triggered the event. Valid values:
| User |
Performance restrictions for burstable instances
The instance performance is limited to below the baseline performance because its CPU credits are used up. When this happens, the burstable instance enters standard mode. The event name is Instance:BurstablePerformanceRestricted.
ECS generates these events hourly. An event indicates that a performance restriction occurred at some point within that one-hour interval. If the instance's performance remains restricted, a new event is generated every hour.
The following is an example JSON notification.
{
"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"
}
}content field:
Field | Description | Example |
instanceId | The ID of the ECS instance. | i-bp1ecr********5go2go |
intervalStart | The start time of the event interval, in UTC. | 2019-11-11T11:00Z |
intervalEnd | The end time of the event interval, in UTC. | 2019-11-11T12:00Z |
Appendix: Notification names for instance O&M events
Impact | Event type and code | Event notification name and code |
Instance restart | Instance restart due to system maintenance (SystemMaintenance.Reboot) |
|
Unexpected instance restart | Instance restart due to a system error (SystemFailure.Reboot) |
|
Unexpected instance restart | Instance restart due to an instance error (InstanceFailure.Reboot) |
|
Instance redeployment | Instance redeployment due to system maintenance (SystemMaintenance.Redeploy) |
|
Instance redeployment | Instance redeployment due to a system error (SystemFailure.Redeploy) |
|
Instance restart and isolation of a damaged local disk | Scheduled instance restart and replacement of a damaged local disk due to system maintenance (SystemMaintenance.RebootAndIsolateErrorDisk) |
|
Instance restart and recovery of a damaged local disk | Scheduled instance restart and re-initialization of a damaged local disk due to system maintenance (SystemMaintenance.RebootAndReInitErrorDisk) |
|
Instance release | Automatic instance release due to a creation failure (SystemFailure.Delete) |
|