Each Elastic Container Instance (ECI) instance corresponds to a container group. The instance provides basic resources, such as vCPUs, memory, and networking, to run one or more containers. This topic describes the basic configurations, creation methods, and lifecycle of ECI instances.
Basic configurations
An ECI instance includes basic components such as instance types, container images, networking, and storage. You can customize the instance configuration. You have full control over the ECI instance and do not need to manage or configure the underlying servers. You only need to provide a packaged container image to run your containers.
Instance types
An ECI instance is primarily defined by its vCPU and memory specifications. When you create an instance, you can specify the required vCPU and memory. Alternatively, you can specify an ECS instance type to meet special requirements, such as for GPUs or enhanced networking.
Container images
An ECI instance consists of one or more containers. Before you deploy a containerized application, you must prepare a container image that contains the programs, library files, and configurations required to run the application. Ensure that the network is accessible when you pull an image. You can use the image cache feature to reduce the instance startup time.
Network
An ECI instance uses one Elastic Network Interface (ENI) resource from a vSwitch in its VPC. By default, the instance has a private IP address. To connect to the internet, such as to pull an image from the public network, you can attach an elastic IP address (EIP) to the ECI instance or configure a NAT Gateway for the VPC.
Storage
By default, an ECI instance has 30 GiB of temporary storage space. You can increase this space as needed. To persist stored files, you can mount an external volume. You can mount Alibaba Cloud storage volumes such as disks, NAS, and OSS.
Creation methods
Overview of creation methods
Based on your business and usage scenarios, ECI supports two ways to define an instance. Each way corresponds to a different billing method. For more information about ECI instance billing, see ECI instance billing.
Creation method | Billing description | References |
Specify vCPUs and memory | You are charged for pods based on the vCPU and memory specifications that you specify when you create the pods. You can also specify a compute category based on your cost and performance requirements. For vCPU and memory specifications that are not supported, the system adjusts the instance specifications and charges you based on the new specifications. | |
Specify an ECS instance type | You are charged for pods based on the ECS instance types that you specify when you create the pods. You can specify an ECS instance type as the underlying support of your Elastic Container Instance pod based on your business requirements. This way, the pod can obtain the specific capabilities of the ECS instance type. For example, if you specify the ecs.gn6i-c4g1.xlarge instance type, the pod can obtain the GPU-accelerated capabilities. |
The default CPU architecture for ECI instances is x86. Arm architecture is also supported. For more information about how to create an ECI instance with an Arm architecture, see Create an instance with an Arm architecture.
Optimize usage costs
Depending on your workload characteristics, you can use spot instances, reserved instances, and savings plans in addition to the standard pay-as-you-go option to reduce resource costs.
For stateless and fault-tolerant workloads, use spot instances. For more information, see Create a spot instance.
For stable, long-running workloads, you can use reserved instances or savings plans to offset your ECI instance bills. The supported scenarios vary based on the ECI billing method:
ECI instances that are billed by vCPU and memory support General-purpose savings plans.
ECI instances that are billed by ECS instance type support General-purpose savings plans, ECS Compute savings plans, and reserved instances.
Choose the appropriate method based on your ECI instance's billing type. For more information, see Use reserved instances and Use savings plans.
Handle out-of-stock issues
When you create instances on a large scale, the specified resources may be out of stock in your region and zone. To ensure a high success rate for instance creation, you can create instances across multiple zones and specify multiple instance types. For more information, see:
Lifecycle
If you do not use a Kubernetes cluster to connect to ECI, you must manage the ECI instance lifecycle to ensure application reliability and avoid resource waste. Your application logic should handle different instance states accordingly. For more information, see ECI instance lifecycle.
Instance management
You can use tags to categorize ECI instances based on your management or business requirements. This makes it easier to filter and manage the instances. For more information, see Use tags to manage ECI instances.