Elastic Compute Service (ECS) can send notifications for instance events such as system events, instance state changes, and release of preemptible instances.
Events
ECS can send notifications for the following instance events:
System events
When a system event occurs on an instance, ECS sends an initial notification for the event, and sends subsequent notifications every time the event state changes. For the names of notifications for system events, see Appendix: Notifications for instance-related system events.
The following examples show notifications in the JSON format for an Instance restart due to system maintenance (SystemMaintenance.Reboot) event.
- The initial notification indicates that the event is in the Scheduled (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 time specified by the notBefore subparameter, the system event is avoided and ECS sends a notification to indicate
that the event state is changed to Avoided (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" } }
Subparameter | 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 start time of the event. This subparameter is available only for system maintenance 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 subparameter values, see Overview. | SystemMaintenance.Reboot |
eventStatus | The state of the system event. For more information about the subparameter values, see Overview. | Avoided |
executeStartTime | The start time of the system event. The time is in UTC. | 2019-04-10T08:01:01Z |
executeFinishTime | The end time of the system event. The time is in UTC.
Note The executeStartTime and and executeFinishTime subparameters are available only for events in the Executing (Executing), Executed (Executed), Canceled (Canceled), or Avoided (Avoided) state.
|
2019-04-10T08:01:01Z |
Instance state changes
When the state of your instance changes, ECS sends you an event notification. For more information about instance state changes, see Instance lifecycle.
The following example shows a notification for the event that the state of an instance changes to Running (Running):
{
"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"
}
}
Subparameter | 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 state of the instance. Valid values:
|
Running |
Release of a preemptible instance
Preemptible instances may be released due to fluctuations 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 such an event notification in the 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"
}
}
Subparameter | Description | Example |
---|---|---|
instanceId | The ID of the preemptible instance. | i-bp1ecr********5go2go |
action | The operation on the preemptible instance. Set the value to delete. | delete |
Hot migration of ECS instances between dedicated hosts
You can call the ModifyInstanceDeployment operation to perform hot migration of ECS instances between dedicated hosts. Hot migration of ECS instances is asynchronous, and the states of the ECS instances do not change during the migration. You can configure notifications for the Instance:LiveMigrationAcrossDDH event to receive updates about the migration progress.
The following examples show the event notifications in the JSON format.
- Notification for the event that 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" } }
- Notification for the event that the hot migration is complete:
{ "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" } }
- Notification for the event that 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" } }
Subparameter | Description | Example |
---|---|---|
instanceId | The ID of the 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. The time is in UTC. | 2018-06-08T01:25:37Z |
endTime | The end time of the migration. The time is in UTC. | 2018-06-08T01:25:45Z |
status | The state of the hot migration. Valid values:
|
accomplished |
Changes in the performance mode of burstable instances
If the performance mode of a burstable instance changes, ECS sends a notification for the Instance:PerformanceModeChange event.
The following example shows such an event notification in the 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"
}
}
Subparameter | Description | Example |
---|---|---|
instanceId | The ID of the instance. | i-bp1ecr********5go2go |
creditSpecification | The new performance mode of the burstable instance. Valid values:
|
Standard |
operator | The operator that triggers the event. Valid values:
|
User |
Limited performance of burstable instances
The following example shows such an event notification in the 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"
}
}
Subparameter | Description | Example |
---|---|---|
instanceId | The ID of the instance. | i-bp1ecr********5go2go |
intervalStart | The start time of the event. The time is in UTC. | 2019-11-11T11:00Z |
intervalEnd | The end time of the event. The time is in UTC. | 2019-11-11T12:00Z |
Appendix: Notifications for instance-related system events
Impact | Event type and code | Event notification name and code |
---|---|---|
The instance is restarted. | Instance restart due to system maintenance: SystemMaintenance.Reboot |
|
The instance is unexpectedly restarted. | Instance restart due to system errors: SystemFailure.Reboot |
|
The instance is unexpectedly restarted. | Instance restart due to instance errors: InstanceFailure.Reboot |
|
The instance is redeployed. | Instance redeployment due to system maintenance: SystemMaintenance.Redeploy |
|
The instance is redeployed. | Instance redeployment due to system errors: SystemFailure.Redeploy |
|
The instance is restarted and the damaged local disk is isolated. | Instance restart and local disk replacement due to system maintenance: SystemMaintenance.RebootAndIsolateErrorDisk |
|
The instance is restarted and the damaged local disk is restored. | Instance restart and local disk re-initialization due to system maintenance: SystemMaintenance.RebootAndReInitErrorDisk |
|
The instance is released. | Automatic instance release due to instance creation failures: SystemFailure.Delete |
|