This topic describes the system event of instance creation failure, and how to improve the success rate of instance creation and O&M efficiency of ECS instances.
Introduction to the system event of instance creation failure
When you create instances by using the ECS console or calling the RunInstances operation, the instances are created while they enter the Running (Running) state. However, ECS instances may fail to be created because of insufficient resource inventory in the current region or insufficient number of private IP addresses in the VSwitch. In this case, ECS triggers the system event of instance creation failure with the SystemFailure.Delete event code.
- Wait for the system to release the ECS instance. An ECS instance is released within five minutes if it fails to be created.
- Manually release the instance.
View the event of instance creation failure
In this example, the DescribeInstanceHistoryEvents operation is called through Alibaba Cloud CLI for you to check whether an event of ECS instance in the Executing or Executed state exists. For information about how to use other developer tools to call this API operation, see Quick start.
aliyun ecs DescribeInstanceHistoryEvents --RegionId TheRegionId --InstanceEventCycleStatus.1 Executing --InstanceEventCycleStatus.2 Executed --EventType SystemFailure.Delete
For information about how to use the ECS console to view events of instance creation failure, see Overview of system events.
The following table describes different states that are returned when you query instance states and the system event of instance creation failure (SystemFailure.Delete) on the Instances page in the ECS console or by calling the DescribeInstances operation.
|Operation status||Instance state||Event state|
|The instance is being created.||Starting (Pending)||N/A|
|The event of instance creation failure is triggered.||Stopped (Stopped)||Executing (Executing)|
|The instance is manually released.||N/A||Aborted (Avoided)|
|The instance is automatically released.||N/A||Executed (Executed)|
Improve the success rate of instance creation
We recommend that you perform the following steps to create an ECS instance and improve the success rate:
- Call the DescribeAvailableResource operation to check whether sufficient resource inventory is available in the specified region and zone, and whether sufficient private IP addresses are available in the VSwitch.
- Create instances by using the ECS console or by calling the RunInstances operation.
- Call the DescribeInstanceStatus or DescribeInstances operation to check the status of the new instances, and whether the instances enter the Running state.
- If one of the instances stays at the Starting state for an extended period of time, call the DescribeInstanceHistoryEvents operation to check whether an event of instance creation failure occurs.