All Products
Search
Document Center

:Create a job-optimized elastic container instance

Last Updated:Dec 15, 2023

You can run short-term jobs on elastic container instances to improve resource utilization and reduce computing costs. Job-optimized elastic container instances provide multiple benefits. For example, a job-optimized elastic container instance can be started in seconds. This topic describes how to create a job-optimized elastic container instance.

Introduction to job-optimized elastic container instances

Important

Alibaba Cloud stops maintaining job-optimized elastic container instances. The instances of this type are only available for existing users.

Job-optimized elastic container instances are suitable for job-type scenarios. The instances have the following features:

  • Job-optimized elastic container instances can be started faster than regular elastic container instances. The cold start time of job-optimized elastic container instances is only half of the cold start time of regular elastic container instances.

  • For batch tasks that are continuously executed, the image caching feature is automatically enabled.

  • Job-optimized elastic container instances allow you to only access external services from the instances. You cannot access the instances from external services. For example, you can access the Internet as well as Apsara File Storage NAS (NAS) and Object Storage Service (OSS) in your virtual private cloud (VPC).

    The following table describes the network types that are supported by job-optimized elastic container instances.

    Network type

    Description

    N/A

    You cannot access the Internet or VPCs from the instance. You can only pull images from image repositories that are created based on Container Registry and are stored in VPCs in the instance region. For example, if your instance is deployed in the China (Beijing) region, you can pull the registry-vpc.cn-beijing.aliyuncs.com/eci_open/busybox:1.30 image.

    Internet

    You can access the Internet from the instance and pull images over the Internet. You do not need to configure a NAT gateway.

    VPC

    You can access the services in VPCs from the instance. To access your VPCs from the instance, you must configure the vSwitches and security groups of the VPCs.

    Internet and VPC

    You can access the Internet and services in VPCs from the instance.

    • To access the Internet from the instance, you do not need to configure a NAT gateway.

    • To access your VPCs from the instance, you must configure the vSwitches and security groups of the VPCs.

    Note

    • If your instance does not need to access VPCs, you can set the network type to N/A or Internet. In this case, you do not need to configure vSwitches or security groups.

    • If Alibaba Cloud DNS PrivateZone is used for domain name resolution, set the network type to VPC. In this case, to access the Internet, you can configure a NAT gateway for the vSwitch.

    • If the network type is VPC or Internet and VPC, only two IP addresses in the vSwitch are used. New elastic container instances do not use extra IP addresses in the vSwitch.

Limits

  • Region: Job-optimized elastic container instances can be created only in the China (Hangzhou), China (Shanghai), China (Beijing), and China (Shenzhen) regions.

  • Billing method: Only the pay-as-you-go billing method is supported. Preemptible instances are not supported.

  • Network: You can only access external services from job-optimized elastic container instances. You cannot access job-optimized elastic container instances from external services. As a result, job-optimized elastic container instances cannot provide services to external resources.

  • Network bandwidth: The upper limit is 1 Gbit/s.

  • Instance specifications: A job-optimized elastic container instance can contain a maximum of 16 vCPUs. The following table describes the supported instance specifications.

    Number of vCPUs

    Memory (GiB)

    0.25

    0.5 and 1

    0.5

    1 and 2

    1

    2, 4, and 8

    2

    1, 2, 4, 8, and 16

    4

    2, 4, 8, 16, and 32

    8

    4, 8, 16, 32, and 64

    12

    12, 24, 48, and 96

    16

    16, 32, 64, and 128

    Note

    You can create a job-optimized instance by specifying the number of vCPUs and the memory size. You cannot create a job-optimized instance by specifying an ECS instance type.

  • Other limits:

    • You cannot associate an elastic IP address (EIP) with a job-optimized elastic container instance.

    • You cannot add a job-optimized elastic container instance as a backend server to a Server Load Balancer (SLB) instance.

    • You cannot assign RAM roles to job-optimized elastic container instances.

    • You cannot add metadata to job-optimized elastic container instances.

    • You cannot use disk volumes for persistent storage on job-optimized elastic container instances. If the network type of a job-optimized elastic container instance is set to N/A or Internet, you cannot use an Apsara File Storage NAS (NAS) volume or an OSS bucket for persistent storage on the instance.

    • Job-optimized elastic container instances do not support coredump or tcpdump.

Configurations

API mode

If you call the CreateContainerGroup API operation to create an elastic container instance, you can use tag-related parameters to configure a job-optimized elastic container instance after you specify the number of vCPUs and memory size that are supported. The following table describes these parameters. For more information, see CreateContainerGroup.

Parameter

Type

Example

Description

Tag.N.Key

String

eci_networkConfig

The key of tag N. If you set Tag.N.Key to eci_networkConfig, the instance is a job-optimized elastic container instance.

Tag.N.Value

String

nat_vpc

The value of tag N. If you set Tag.N.Key to eci_networkConfig, the Tag.N.Value parameter specifies the network type of the job-optimized elastic container instance. Valid values:

  • none: N/A.

  • nat_internet: Internet.

  • nat_vpc: VPC.

  • nat_internet_vpc: Internet and VPC.

VSwitchId

String

vsw-bp1xpiowfm5vo8o3c****

The vSwitch ID. If you set Tag.N.Value to nat_vpc or nat_internet_vpc, you must configure this parameter.

SecurityGroupId

String

sg-uf66jeqopgqa9hdn****

The ID of the security group to which the instance belongs. If you set Tag.N.Value to nat_vpc or nat_internet_vpc, you must configure this parameter.

Sample configurations:

  • N/A

    Tag.1.Key = eci_networkConfig
    Tag.1.Value = none 
  • Internet

    Tag.1.Key = eci_networkConfig
    Tag.1.Value = nat_internet 
  • VPC

    Tag.1.Key = eci_networkConfig
    Tag.1.Value = nat_vpc
    VSwitchId = vsw-bp1xpiowfm5vo8o3c****
    SecurityGroupId = sg-uf66jeqopgqa9hdn****
  • Internet and VPC

    Tag.1.Key = eci_networkConfig
    Tag.1.Value = nat_internet_vpc
    VSwitchId = vsw-bp1xpiowfm5vo8o3c****
    SecurityGroupId = sg-uf66jeqopgqa9hdn****

Console mode

If you set the Billing Method parameter to Pay-as-you-go when you create a job-optimized elastic container instance on the buy page, you can set the Type of Instance parameter to Job Instance and configure the network type.

Note

You cannot create multiple job-optimized elastic container instances at a time.

Job型

Description about the network types:

  • If you select N/A or Internet for Network Type, you do not need to configure the VPC, vSwitch, or security group.

  • If you select VPC or Internet and VPC for Network Type, to access the VPC from the elastic container instance, you must configure the VPC, vSwitch, and security group.