All Products
Search
Document Center

Lifecycle of an elastic container instance

Last Updated: May 19, 2022

This topic describes different states in the lifecycle of an elastic container instance. You can design and implement your business logic based on the states. Elastic Container Instance is seamlessly connected to Kubernetes. You can directly use elastic container instances as pods in Kubernetes clusters.

Status of elastic container instances

The following table describes the states of an elastic container instance during its lifecycle.

State

Description

Scheduling

The elastic container instance is being created.

Pending

One or more containers in the elastic container instance are being started, and no containers are running.

Running

All containers in the elastic container instance are created, and at least one container is running or restarting.

Restarting

The elastic container instance is restarting.

Updating

The elastic container instance is being updated.

Terminating

The elastic container instance is being terminated. A running instance configured with preStop enters the Terminating state when the instance is being deleted. After you run the preStop function, the instance is deleted.

Succeeded

All containers in the elastic container instance are terminated after they successfully run and not about to restart.

Failed

All containers in the elastic container instance are terminated after they run, and at least one container is terminated due to runtime errors, which indicates that the container exits with a non-zero status or is terminated by the system.

Expired

The elastic container instance is a preemptible instance and is terminated due to resource expiration and recycling.

ScheduleFailed

The elastic container instance failed to be created. The system deletes the elastic container instance after 24 hours, and you are not charged for the elastic container instance.

Notice

The restart policy of an elastic container instance applies only to containers within the elastic container instance. The elastic container instance itself does not automatically restart.

The following figure shows the state transition of an elastic container instance during its lifecycle. Lifecycle of an elastic container instance

Note

The system automatically releases the instances that are in the Succeeded or Failed state, but retains the metadata of the latest 100 instances. When the system releases the instances, other resources such as Elastic IP Addresses (EIPs) that are created along with the instances are also released.

Container status

State

Description

Waiting

The container is waiting for being created.

Typically, application containers remain in the Waiting state before an init container exits the Running state.

Running

The container is created and running.

Terminated

The container is terminated and exits after a successful or failed run.