Creates an Elastic Container Instance (ECI), which is a container group.
Operation description
When you call the CreateContainerGroup operation to create an ECI, the system automatically creates a service-linked role named AliyunServiceRoleForECI for you to access related cloud services such as ECS and VPC. For more information, see Service-linked role for Elastic Container Instance.
When you create an ECI, you can configure features such as instances, images, and storage as needed. For the parameters and descriptions related to each feature, see the following documentation:
Instances
ECI supports the following two methods to create instances:
Both creation methods support the following features:
Images
Networking
Storage
Container configuration
Logging and O&M
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
eci:CreateContainerGroup |
create |
*ContainerGroup
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. |
cn-hangzhou |
| ZoneId |
string |
No |
The zone to which the instance belongs. If this parameter is left empty, the system selects a zone. Default value: empty. |
cn-hangzhou-b |
| SecurityGroupId |
string |
No |
The ID of the security group to which the instance belongs. Instances within the same security group can access each other. If you do not specify a security group, the system automatically uses the default security group in the selected region. You must ensure that the inbound rules of this security group include the protocols and ports that the container needs to expose. If no default security group exists in the region, the system performs automatic creation of a default security group and adds the declared container protocols and ports to the inbound rules of the security group. |
sg-uf66jeqopgqa9hdn**** |
| VSwitchId |
string |
No |
The ID of the vSwitch to which the instance belongs. You can specify multiple vSwitch IDs. A maximum of 10 vSwitch IDs can be specified at a time. Separate multiple vSwitch IDs with commas (,), for example, If you do not specify a vSwitch, the system automatically uses the default vSwitch in the default VPC of the selected region. If no default VPC or default vSwitch exists in the region, the system performs automatic creation of a default VPC and a default vSwitch. Note
The number of IP addresses in the vSwitch CIDR block determines the maximum number of ECIs that can be created under the vSwitch. Plan the CIDR block in advance. |
vsw-bp1xpiowfm5vo8o3c****,vsw-bp1rkyjgr1xwoho6k**** |
| ContainerGroupName |
string |
Yes |
The name of the ECI, which is the name of the container group. The name must meet the following requirements:
|
nginx-test |
| RestartPolicy |
string |
No |
The restart policy of the instance. Valid values:
Default value: Always. |
Always |
| EipInstanceId |
string |
No |
The ID of the Elastic IP Address (EIP). |
eip-uf66jeqopgqa9hdn**** |
| Cpu |
number |
No |
The number of vCPUs for the instance. Unit: cores. |
1.0 |
| Memory |
number |
No |
The memory size for the instance. Unit: GiB. |
2.0 |
| ResourceGroupId |
string |
No |
The ID of the resource group. |
rg-uf66jeqopgqa9hdn**** |
| DnsPolicy |
string |
No |
The DNS policy. Valid values:
|
Default |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence. |
123e4567-xxxx-12d3-xxxx-426655440000 |
| InstanceType |
string |
No |
The ECS instance type. Multiple instance types are supported. For more information, see Create an instance by specifying an ECS instance type. |
ecs.c5.xlarge |
| ImageSnapshotId |
string |
No |
The ID of the image cache. For more information, see Use an image cache to accelerate instance creation. |
imc-2zebxkiifuyzzlhl**** |
| RamRoleName |
string |
No |
The name of the RAM role for the instance. ECIs and ECS instances share the same RAM roles. For more information, see Use an instance RAM role by calling API operations. |
RamTestRole |
| TerminationGracePeriodSeconds |
integer |
No |
The buffer time for the program to handle operations before it is terminated. Unit: seconds. |
60 |
| AutoMatchImageCache |
boolean |
No |
Specifies whether to automatically match an image cache. Default value: false. |
false |
| Ipv6AddressCount |
integer |
No |
The number of IPv6 addresses. Set the value to 1, which indicates that an ECI can be associated with one IPv6 address. |
1 |
| ActiveDeadlineSeconds |
integer |
No |
The validity period of the ECI. If the running time of the ECI exceeds this period, the ECI is forcibly terminated. Unit: seconds. |
1000 |
| SpotStrategy |
string |
No |
The preemption policy for the instance. Valid values:
Default value: NoSpot. |
SpotWithPriceLimit |
| SpotPriceLimit |
number |
No |
The maximum hourly price for the spot instance. The value can be accurate to three decimal places. You must specify this parameter when SpotStrategy is set to SpotWithPriceLimit. |
0.025 |
| ScheduleStrategy |
string |
No |
The scheduling policy for the ECI when multiple zones are configured by specifying multiple vSwitches in the VSwitchId parameter. Valid values:
For more information, see Create an instance in multiple zones. |
VSwitchOrdered |
| CorePattern |
string |
No |
The custom directory where the core files generated by coredump are saved. For more information, see Save core files to a volume. Note
The configured path cannot start with |
/xx/xx/core |
| ShareProcessNamespace |
boolean |
No |
Specifies whether to use a shared namespace. Default value: false. |
false |
| AutoCreateEip |
boolean |
No |
Specifies whether automatic creation of an EIP is performed and the EIP is attached to the instance. |
true |
| EipBandwidth |
integer |
No |
The bandwidth of the EIP. Default value: 5 Mbit/s. |
5 |
| EipISP |
string |
No |
The line type of the EIP. Valid values:
|
BGP |
| EipCommonBandwidthPackage |
string |
No |
The ID of the existing Internet Shared Bandwidth instance to associate. |
cbwp-2zeukbj916scmj51m**** |
| HostName |
string |
No |
The hostname. |
test |
| IngressBandwidth |
integer |
No |
The inbound bandwidth limit. Unit: Bps. |
1024000 |
| EgressBandwidth |
integer |
No |
The outbound bandwidth limit. Unit: Bps. |
1024000 |
| CpuOptionsCore |
integer |
No |
The number of physical CPU cores. Custom settings are supported only for specific instance types. |
2 |
| CpuOptionsThreadsPerCore |
integer |
No |
The number of threads per core. Custom settings are supported only for specific instance types. A value of 1 indicates that hyper-threading is disabled. |
2 |
| CpuOptionsNuma |
string |
No |
This parameter is not supported. |
1 |
| EphemeralStorage |
integer |
No |
The size of the additional temporary storage space. Unit: GiB. |
20 |
| Tag |
array<object> |
No |
The list of tags. You can bind up to 20 tags. For more information, see Use tags to manage instances. |
|
|
object |
No |
The list of tags. You can bind up to 20 tags. For more information, see Use tags to manage instances. |
||
| Key |
string |
No |
The tag key. If you specify this parameter, it cannot be an empty string and must be unique. It can be up to 64 characters in length. It cannot start with |
version |
| Value |
string |
No |
The tag value. If you specify this parameter, it can be an empty string. It can be up to 128 characters in length. It cannot start with |
3 |
| ImageRegistryCredential |
array<object> |
No |
The information about the image repository. |
|
|
object |
No |
The information about the image repository. |
||
| Password |
string |
No |
The password for the image repository. |
yourpassword |
| Server |
string |
No |
The address of the image repository. |
registry-vpc.cn-shanghai.aliyuncs.com |
| UserName |
string |
No |
The username for the image repository. |
yourusername |
| Container |
array<object> |
Yes |
The container information. |
|
|
array<object> |
No |
The container information. |
||
| Arg |
array |
No |
The arguments for the container startup command. Up to 10 arguments are supported. |
100 |
|
string |
No |
The arguments for the container startup command. Up to 10 arguments are supported. |
100 |
|
| Command |
array |
No |
The container startup commands. Up to 20 commands are supported. Each command can contain up to 256 characters. |
sleep |
|
string |
No |
The container startup commands. Up to 20 commands are supported. Each command can contain up to 256 characters. |
sleep |
|
| Cpu |
number |
No |
The number of vCPUs for the container. Unit: cores. |
0.25 |
| EnvironmentVar |
array<object> |
No |
The environment variables of the container. |
|
|
object |
No |
The environment variables of the container. |
||
| FieldRef.FieldPath |
string |
No |
The reference to the environment variable value. Currently, only status.podIP is supported. |
status.podIP |
| Key |
string |
No |
The name of the environment variable. The name must be 1 to 128 characters in length and can contain letters, digits, and underscores (_). It cannot start with a digit. |
PATH |
| Value |
string |
No |
The value of the environment variable. The value must be 0 to 256 characters in length. |
/usr/local/bin |
| EnvironmentVarHide |
boolean |
No |
Specifies whether to hide environment variable information when you query the details of the elastic container instance. Valid values:
|
false |
| Gpu |
integer |
No |
The number of GPUs allocated to the container. |
1 |
| Image |
string |
Yes |
The container image. |
registry-vpc.cn-hangzhou.aliyuncs.com/eci_open/nginx:latest |
| ImagePullPolicy |
string |
No |
Pull image pull policy. Valid values:
|
Always |
| LifecyclePostStartHandlerExec |
array |
No |
The command to run in the container when the postStart callback function is configured by using the command line. |
["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"] |
|
string |
No |
The command to run in the container when the postStart callback function is configured by using the command line. |
["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"] |
|
| LifecyclePostStartHandlerHttpGetHost |
string |
No |
The host address that receives the HTTP GET request when the postStart callback function is configured by using an HTTP request. |
10.0.XX.XX |
| LifecyclePostStartHandlerHttpGetHttpHeader |
array<object> |
No |
The generated HTTP request header parameters. |
|
|
object |
No |
The generated HTTP request header parameters. |
||
| Name |
string |
No |
The custom field name in the HTTP GET request header when the postStart callback function is configured by using an HTTP request. |
Xiao-Custom-Header |
| Value |
string |
No |
The custom field value in the HTTP GET request header when the postStart callback function is configured by using an HTTP request. |
test-postStart |
| LifecyclePostStartHandlerHttpGetPath |
string |
No |
The path to check by using the HTTP GET request when the postStart callback function is configured by using an HTTP request. |
/healthyz |
| LifecyclePostStartHandlerHttpGetPort |
integer |
No |
The port number to check by using the HTTP GET request when the postStart callback function is configured by using an HTTP request. |
5050 |
| LifecyclePostStartHandlerHttpGetScheme |
string |
No |
The protocol type of the HTTP GET request when the postStart callback function is configured by using an HTTP request. Valid values:
|
HTTPS |
| LifecyclePostStartHandlerTcpSocketHost |
string |
No |
The host address to check by using a TCP socket when the postStart callback function is configured by using a TCP socket. |
10.0.XX.XX |
| LifecyclePostStartHandlerTcpSocketPort |
integer |
No |
The port to check by using a TCP socket when the postStart callback function is configured by using a TCP socket. |
80 |
| LifecyclePreStopHandlerExec |
array |
No |
The command to run in the container when the preStop callback function is configured by using the command line. |
["/bin/sh", "-c","echo Hello from the preStop handler > /usr/share/message"] |
|
string |
No |
The command to run in the container when the preStop callback function is configured by using the command line. |
["/bin/sh", "-c","echo Hello from the preStop handler > /usr/share/message"] |
|
| LifecyclePreStopHandlerHttpGetHost |
string |
No |
The host address that receives the HTTP GET request when the preStop callback function is configured by using an HTTP request. |
10.0.XX.XX |
| LifecyclePreStopHandlerHttpGetHttpHeader |
array<object> |
No |
The generated HTTP request header parameters. |
|
|
object |
No |
The generated HTTP request header parameters. |
||
| Name |
string |
No |
The custom field name in the HTTP GET request header when the preStop callback function is configured by using an HTTP request. |
Xiao-Custom-Header |
| Value |
string |
No |
The custom field value in the HTTP GET request header when the preStop callback function is configured by using an HTTP request. |
test-preStop |
| LifecyclePreStopHandlerHttpGetPath |
string |
No |
The path to check by using the HTTP GET request when the preStop callback function is configured by using an HTTP request. |
/healthyz |
| LifecyclePreStopHandlerHttpGetPort |
integer |
No |
The port number to check by using the HTTP GET request when the preStop callback function is configured by using an HTTP request. |
88 |
| LifecyclePreStopHandlerHttpGetScheme |
string |
No |
The protocol type of the HTTP GET request when the preStop callback function is configured by using an HTTP request. Valid values:
|
HTTP |
| LifecyclePreStopHandlerTcpSocketHost |
string |
No |
The host address to check by using a TCP socket when the preStop callback function is configured by using a TCP socket. |
10.0.XX.XX |
| LifecyclePreStopHandlerTcpSocketPort |
integer |
No |
The port to check by using a TCP socket when the preStop callback function is configured by using a TCP socket. |
90 |
| LivenessProbe.Exec.Command |
array |
No |
The command to run in the container when a health check is performed by using the command line. Note
When you configure LivenessProbe parameters, you can select only one of the following check methods: HTTP GET, Exec, and TCP socket. |
|
|
string |
No |
The command to run in the container when a health check is performed by using the command line. |
cat /tmp/healthy |
|
| LivenessProbe.FailureThreshold |
integer |
No |
The minimum number of consecutive failures for a probe to be considered failed after having succeeded. Default value: 3. |
3 |
| LivenessProbe.HttpGet.Path |
string |
No |
The path to check by using the HTTP GET request when a health check is performed by using an HTTP request. Note
When you configure LivenessProbe parameters, you can select only one of the following check methods: HTTP GET, Exec, and TCP socket. |
/healthz |
| LivenessProbe.HttpGet.Port |
integer |
No |
The port number to check by using the HTTP GET request when a health check is performed by using an HTTP request. Note
When you configure LivenessProbe parameters, you can select only one of the following check methods: HTTP GET, Exec, and TCP socket. |
8888 |
| LivenessProbe.HttpGet.Scheme |
string |
No |
The protocol type of the HTTP GET request when a health check is performed by using an HTTP request. Valid values:
Note
When you configure LivenessProbe parameters, you can select only one of the following check methods: HTTP GET, Exec, and TCP socket. |
HTTP |
| LivenessProbe.InitialDelaySeconds |
integer |
No |
The number of seconds after the container has started before liveness probes are initiated. |
5 |
| LivenessProbe.PeriodSeconds |
integer |
No |
The period in seconds for performing a probe. Default value: 10. Minimum value: 1. |
5 |
| LivenessProbe.SuccessThreshold |
integer |
No |
The minimum number of consecutive successes for a probe to be considered successful after having failed. Default value: 1. The value must be 1. |
1 |
| LivenessProbe.TcpSocket.Port |
integer |
No |
The port to check by using a TCP socket when a health check is performed by using a TCP socket. Note
When you configure LivenessProbe parameters, you can select only one of the following check methods: HTTP GET, Exec, and TCP socket. |
8080 |
| LivenessProbe.TimeoutSeconds |
integer |
No |
The timeout period in seconds for a probe. Default value: 1. Minimum value: 1. |
1 |
| Memory |
number |
No |
The memory size of the container. Unit: GiB. |
0.5 |
| Name |
string |
Yes |
The name of the container. |
nginx |
| Port |
array<object> |
No |
The port number. |
|
|
object |
No |
The port number. |
||
| Port |
integer |
No |
The port number. Valid values: 1 to 65535. |
80 |
| Protocol |
string |
No |
The protocol type. Valid values:
|
TCP |
| ReadinessProbe.Exec.Command |
array |
No |
The command to execute in the container when a health check is performed by using the command line. Note
When you configure ReadinessProbe parameters, you can select only one of the following check methods: HTTP GET, Exec, and TCP socket. |
|
|
string |
No |
The command to run in the container when a health check is performed by using the command line. |
cat /tmp/healthy |
|
| ReadinessProbe.FailureThreshold |
integer |
No |
The minimum number of consecutive failures for a probe to be considered failed after having succeeded. Default value: 3. |
3 |
| ReadinessProbe.HttpGet.Path |
string |
No |
The path to check by using the HTTP GET request when a health check is performed by using an HTTP request. Note
When you configure ReadinessProbe parameters, you can select only one of the following check methods: HTTP GET, Exec, and TCP socket. |
/healthz |
| ReadinessProbe.HttpGet.Port |
integer |
No |
The port number to check by using the HTTP GET request when a health check is performed by using an HTTP request. Note
When you configure ReadinessProbe parameters, you can select only one of the following check methods: HTTP GET, Exec, and TCP socket. |
8080 |
| ReadinessProbe.HttpGet.Scheme |
string |
No |
The protocol type of the HTTP GET request when a health check is performed by using an HTTP request. Valid values:
Note
When you configure ReadinessProbe parameters, you can select only one of the following check methods: HTTP GET, Exec, and TCP socket. |
HTTP |
| ReadinessProbe.InitialDelaySeconds |
integer |
No |
The number of seconds after the container has started before liveness probes are initiated. |
3 |
| ReadinessProbe.PeriodSeconds |
integer |
No |
The period in seconds for performing a probe. Default value: 10. Minimum value: 1. |
3 |
| ReadinessProbe.SuccessThreshold |
integer |
No |
The minimum number of consecutive successes for a probe to be considered successful after having failed. Default value: 1. The value must be 1. |
1 |
| ReadinessProbe.TcpSocket.Port |
integer |
No |
The port to check by using a TCP socket when a health check is performed by using a TCP socket. Note
When you configure ReadinessProbe parameters, you can select only one of the following check methods: HTTP GET, Exec, and TCP socket. |
8000 |
| ReadinessProbe.TimeoutSeconds |
integer |
No |
The timeout period in seconds for a probe. Default value: 1. Minimum value: 1. |
1 |
| SecurityContext.Capability.Add |
array |
No |
The specific permissions granted to processes in the container. Currently, only NET_ADMIN and NET_RAW are supported. Note
NET_RAW is not supported by default. To use NET_RAW, submit a ticket. |
|
|
string |
No |
The specific permissions granted to processes in the container. Currently, only NET_ADMIN and NET_RAW are supported. Note
NET_RAW is not supported by default. To use NET_RAW, submit a ticket. |
NET_ADMIN |
|
| SecurityContext.ReadOnlyRootFilesystem |
boolean |
No |
Specifies whether the root file system of the container is read-only. Currently, only true is supported. |
true |
| SecurityContext.RunAsUser |
integer |
No |
The user ID used to run the container. |
1000 |
| SecurityContextPrivileged |
boolean |
No |
Specifies whether to run the container in privileged mode. Valid values:
Note
The privileged container feature is in invitational preview. To use this feature, submit a ticket. |
true |
| SecurityContextRunAsGroup |
integer |
No |
The user group used to run the container. |
3000 |
| SecurityContextRunAsNonRoot |
boolean |
No |
Specifies whether to run the container as a non-root user. Valid values:
|
true |
| Stdin |
boolean |
No |
Specifies whether to allocate a buffer for standard input during container runtime. If this parameter is not set, reading from standard input in the container results in an EOF. Default value: false. |
false |
| StdinOnce |
boolean |
No |
Specifies whether the standard input stream maintains the enabling status across multiple attached sessions when standard input is set to true. |
false |
| TerminationMessagePath |
string |
No |
The path to the termination message of the container. |
/tmp/termination-log |
| TerminationMessagePolicy |
string |
No |
The message notification policy. Default value: empty. Currently, only message notifications of MSMQ are supported. |
FallbackToLogsOnError |
| Tty |
boolean |
No |
Specifies whether to enable interactive mode. Default value: false. Set this parameter to true when Command is set to /bin/bash. |
false |
| VolumeMount |
array<object> |
No |
The volume mount information. |
|
|
object |
No |
The volume mount information. |
||
| MountPath |
string |
No |
The directory where the volume is mounted in the container. Note
The content in the container mount path is directly overwritten by the volume content. Use with caution. |
/pod/data |
| MountPropagation |
string |
No |
The mount propagation setting for the volume. Mount propagation allows volumes mounted by a container to be shared with other containers in the same pod, or even with other pods on the same node. Valid values:
Default value: None. |
None |
| Name |
string |
No |
The name of the volume. This must match the Name of a volume. |
default-volume1 |
| ReadOnly |
boolean |
No |
Specifies whether the volume is read-only. Default value: false. |
false |
| SubPath |
string |
No |
The subpath of the volume. |
data2/ |
| WorkingDir |
string |
No |
The working directory of the container. |
/usr/local/ |
| Volume |
array<object> |
No |
The volume mount information. |
|
|
array<object> |
No |
The volume mount information. |
||
| ConfigFileVolume.ConfigFileToPath |
array<object> |
No |
The information about the ConfigFile volume. If multiple ConfigFileToPath items are configured, the total length of the corresponding Content values cannot exceed 60 KB. |
|
|
object |
No |
The information about the ConfigFile volume. |
||
| Content |
string |
No |
The content of the configuration file. The content must be Base64-encoded. A single configuration file cannot exceed 32 KB in size. |
bGl1bWk= |
| Mode |
integer |
No |
The permissions of the configuration file. If this parameter is not specified, the value of ConfigFileVolume.DefaultMode is used. The permissions are represented by a four-digit octal number. For example, 0644 indicates that the permissions are rw-r--r--, which means the user has read and write permissions, the group has read permissions, and others have read permissions. Permission description:
|
0644 |
| Path |
string |
No |
The relative path of the configuration file relative to the mount directory. |
test/config-test.cnf |
| ConfigFileVolume.DefaultMode |
integer |
No |
The default permissions of the ConfigFile volume. |
0644 |
| DiskVolume.DiskId |
string |
No |
The ID of the disk volume. |
d-xx |
| DiskVolume.DiskSize |
integer |
No |
The size of the disk volume. Unit: GiB. |
15 |
| DiskVolume.FsType |
string |
No |
The file system type of the disk volume. |
xfs |
| EmptyDirVolume.Medium |
string |
No |
The storage medium of the emptyDir volume. By default, this parameter is left empty and the node file system is used. A value of memory indicates that the memory is used. |
memory |
| EmptyDirVolume.SizeLimit |
string |
No |
The size of the emptyDir volume. Unit: GiB. |
2 |
| FlexVolume.Driver |
string |
No |
The driver type used to mount the volume by using the FlexVolume plug-in. Valid values:
|
alicloud/disk |
| FlexVolume.FsType |
string |
No |
The type of the file system to be mounted. The default value depends on the script of the FlexVolume. |
ext4 |
| FlexVolume.Options |
string |
No |
The list of options for the FlexVolume object. The options are passed as key-value pairs in JSON format. For example, when you mount a cloud disk by using FlexVolume, Options specifies the configuration parameters of the cloud disk. You can configure the following parameters:
|
{"volumeId":"d-2zehdahrwoa7srg****","performanceLevel": "PL2"} |
| HostPathVolume.Path |
string |
No |
The directory path of the hostPath volume on the host. |
/pod/data |
| HostPathVolume.Type |
string |
No |
The type of the hostPath volume. Valid values:
Note
The hostPath volume is available only to users in the whitelist. |
Directory |
| NFSVolume.Path |
string |
No |
The path of the NFS volume. |
/share |
| NFSVolume.ReadOnly |
boolean |
No |
Specifies whether the NFS volume is read-only. Default value: false. |
false |
| NFSVolume.Server |
string |
No |
The address of the NFS server. |
3f9cd4a596-naw76.cn-shanghai.nas.aliyuncs.com |
| Name |
string |
No |
The name of the volume. |
default-volume1 |
| Type |
string |
No |
The type of the volume. Valid values:
|
ConfigFileVolume |
| InitContainer |
array<object> |
No |
The list of init containers. |
|
|
array<object> |
No |
The list of init containers. |
||
| Arg |
array |
No |
The startup arguments of the container. |
10 |
|
string |
No |
The startup arguments of the container. |
10 |
|
| Command |
array |
No |
The startup commands of the container. |
sleep |
|
string |
No |
The startup commands of the container. |
sleep |
|
| Cpu |
number |
No |
The number of vCPUs for the container. Unit: cores. |
0.5 |
| EnvironmentVar |
array<object> |
No |
The list of environment variables for the container. |
|
|
object |
No |
The list of environment variables for the container. |
||
| FieldRef.FieldPath |
string |
No |
The reference to the environment variable value. Currently, only status.podIP is supported. |
status.podIP |
| Key |
string |
No |
The name of the environment variable. The name must be 1 to 128 characters in length and can contain letters, digits, and underscores (_). It cannot start with a digit. |
Path |
| Value |
string |
No |
The value of the environment variable. The value must be 0 to 256 characters in length. |
/usr/bin/ |
| Gpu |
integer |
No |
The number of GPUs allocated to the container. |
1 |
| Image |
string |
No |
The image used by the container. |
nginx |
| ImagePullPolicy |
string |
No |
Pull image pull policy. Valid values:
|
Always |
| Memory |
number |
No |
The memory size of the container. Unit: GiB. |
1.0 |
| Name |
string |
No |
The name of the container. |
test-init |
| Port |
array<object> |
No |
The port number of the init container. |
|
|
object |
No |
The port number of the init container. |
||
| Port |
integer |
No |
The port number. Valid values: 1 to 65535. |
8888 |
| Protocol |
string |
No |
The protocol type. Valid values:
|
TCP |
| SecurityContext.Capability.Add |
array |
No |
The specific permissions granted to processes in the container. Currently, only NET_ADMIN and NET_RAW are supported. Note
NET_RAW is not supported by default. To use NET_RAW, submit a ticket. |
|
|
string |
No |
The specific permissions granted to processes in the container. Currently, only NET_ADMIN and NET_RAW are supported. Note
NET_RAW is not supported by default. To use NET_RAW, submit a ticket. |
NET_ADMIN |
|
| SecurityContext.ReadOnlyRootFilesystem |
boolean |
No |
Specifies whether the root file system of the container is read-only. Only true is supported. |
true |
| SecurityContext.RunAsUser |
integer |
No |
The user ID used to run the container. |
587 |
| TerminationMessagePath |
string |
No |
The source of the termination message when the container exits. When the container exits, the termination message is retrieved from the specified termination message file. |
/tmp/termination-log |
| TerminationMessagePolicy |
string |
No |
The mount information. Default value: empty. |
***** |
| VolumeMount |
array<object> |
No |
The list of volumes to be mounted. |
|
|
object |
No |
The list of volumes to be mounted. |
||
| MountPath |
string |
No |
The mount directory. The content in the mount directory of the container is directly overwritten by the content of the volume. Use this parameter with caution. |
/usr/share/ |
| MountPropagation |
string |
No |
The mount propagation setting for the volume. Mount propagation allows volumes mounted by a container to be shared with other containers in the same pod, or even with other pods on the same node. Valid values:
Default value: None. |
None |
| Name |
string |
No |
The name of the volume to be mounted. |
test-empty |
| ReadOnly |
boolean |
No |
Specifies whether the mount path is read-only. Default value: false. |
false |
| SubPath |
string |
No |
The subdirectory in the volume. This allows a pod to mount different directories in the same volume to different directories in the container. |
/usr/sub/ |
| WorkingDir |
string |
No |
The working directory. |
/usr/local |
| DnsConfig.NameServer |
array |
No |
The list of IP addresses of DNS servers. |
172.10.*.** |
|
string |
No |
The list of IP addresses of DNS servers. |
172.10.*.** |
|
| DnsConfig.Search |
array |
No |
The list of DNS search domains. |
svc.local.kubenetes |
|
string |
No |
The list of DNS search domains. |
svc.local.kubernetes |
|
| DnsConfig.Option |
array<object> |
No |
The list of options for the object. |
|
|
object |
No |
The list of options for the object. |
||
| Name |
string |
No |
The name of the object. |
name |
| Value |
string |
No |
The value of the object. |
value |
| HostAliase |
array<object> |
No |
Adds an alias for the elastic container instance. |
|
|
object |
No |
Adds an alias for the elastic container instance. |
||
| Hostname |
array |
No |
The hostname to be added. |
hehe.com |
|
string |
No |
The hostname to be added. |
hehe.com |
|
| Ip |
string |
No |
The IP address to be added. |
1.1.1.1 |
| SecurityContext.Sysctl |
array<object> |
No |
Modifies secure sysctl parameters by using the security context. For more information, see Configure a security context. |
|
|
object |
No |
Modifies secure sysctl parameters by using the security context. For more information, see Configure a security context. |
||
| Name |
string |
No |
The name of the secure sysctl parameter to be modified by using the security context. Valid values:
|
net.ipv4.ping_group_range |
| Value |
string |
No |
The value of the secure sysctl parameter to be modified by using the security context. |
65536 |
| HostSecurityContext.Sysctl |
array<object> |
No |
Modifies unsafe sysctl parameters by using the security context. For more information, see Configure a security context. |
|
|
object |
No |
Modifies unsafe sysctl parameters by using the security context. For more information, see Configure a security context. |
||
| Name |
string |
No |
The name of the unsafe sysctl parameter to be modified by using the security context. Valid values:
|
kernel.msgmax |
| Value |
string |
No |
The value of the unsafe sysctl parameter to be modified by using the security context. |
65536 |
| NtpServer |
array |
No |
The NTP server. |
ntp.cloud.aliyuncs.com |
|
string |
No |
The NTP server. |
ntp.cloud.aliyuncs.com |
|
| AcrRegistryInfo |
array<object> |
No |
The list of ACR Enterprise instances. For more information, see Pull ACR images without a password. |
|
|
object |
No |
The list of ACR Enterprise instances. |
||
| ArnService |
string |
No |
The ARN of the RAM role in the account of resource ownership for resources such as the ECI instance. |
acs:ram::1609982529******:role/role-assume |
| ArnUser |
string |
No |
The ARN of the RAM role in the account to which the ACR instance belongs. |
acs:ram::1298452580******:role/role-acr |
| Domain |
array |
No |
The domain name of the ACR Enterprise instance. By default, all domain names of the instance are used. You can specify one or more domain names. Separate multiple domain names with commas (,). |
*****-****-registry.cn-beijing.cr.aliyuncs.com |
|
string |
No |
The domain name of the ACR Enterprise instance. By default, all domain names of the instance are used. You can specify one or more domain names. Separate multiple domain names with commas (,). |
*****-****-registry.cn-beijing.cr.aliyuncs.com |
|
| InstanceId |
string |
No |
The instance ID of the ACR Enterprise instance. |
cri-nwj395hgf6f3**** |
| InstanceName |
string |
No |
The name of the ACR Enterprise instance. |
acr-test |
| RegionId |
string |
No |
The region ID of the ACR Enterprise instance. |
cn-beijing |
| SpotDuration |
integer |
No |
The protection period of the spot instance. Unit: hours. Default value: 1. A value of 0 indicates that no protection period is configured. |
1 |
| StrictSpot |
boolean |
No |
Specifies whether to run the instance periodically. Valid values:
|
true |
| PlainHttpRegistry |
string |
No |
The address of the self-pull image repository. When you create an ECI instance by using an image from a self-pull image repository that uses the HTTP protocol, you must configure this parameter so that ECI uses the HTTP protocol to pull the image. This prevents image pull failures caused by protocol mismatches. |
"harbor***.pre.com,192.168.XX.XX:5000,reg***.test.com:80" |
| InsecureRegistry |
string |
No |
The address of the self-managed image repository. When you create an ECI instance by using an image from a self-managed image repository that uses a self-signed certificate, you must configure this parameter to skip certificate verification. This prevents image pull failures caused by certificate verification failures. |
"harbor***.pre.com,192.168.XX.XX:5000,reg***.test.com:80" |
| ImageAccelerateMode |
string |
No |
The image acceleration mode. Valid values:
|
imc |
| Ipv6GatewayBandwidthEnable |
boolean |
No |
Specifies whether to enable IPv6 Internet communication for the ECI instance. |
true |
| Ipv6GatewayBandwidth |
string |
No |
The peak Internet bandwidth of the IPv6 address. This parameter takes effect only when Ipv6GatewayBandwidthEnable is set to true. Valid values:
|
100 |
| ContainerResourceView |
boolean |
No |
Specifies whether to enable the container resource view feature. If the allocated ECI specifications are higher than the requested specifications, you can enable this feature to ensure that the resources visible inside the container match the requested resources. |
false |
| FixedIp |
string |
No |
Specifies whether to assign a fixed IP address to the instance. A value of true indicates that a fixed IP address is assigned. For more information, see Assign a fixed IP address to an ECI instance. |
true |
| FixedIpRetainHour |
integer |
No |
The retention period of the fixed IP address after the instance is released. Unit: hours. Default value: 48. |
24 |
| DataCacheBucket |
string |
No |
The data cache bucket. |
default |
| DataCachePL |
string |
No |
The performance level of the cloud disk used for data cache. ESSDs are preferred. Default value: PL1. |
PL1 |
| DataCacheProvisionedIops |
integer |
No |
The provisioned read and write IOPS of the ESSD AutoPL disk used for data cache. Valid values: 0 to the minimum of 50,000 and (1,000 × Capacity - Baseline performance). Baseline performance = the minimum of (1,800 + 50 × Capacity) and 50,000. For more information, see ESSD AutoPL disks. |
40000 |
| DataCacheBurstingEnabled |
boolean |
No |
Specifies whether to enable the burst feature for the ESSD AutoPL disk used for data cache. For more information, see ESSD AutoPL disks. |
false |
| DryRun |
boolean |
No |
Specifies whether to only precheck the request. Valid values:
|
false |
| PrivateIpAddress |
string |
No |
The private IP address of the ECI instance. Only IPv4 addresses are supported. Make sure that the IP address is not in use. |
172.16.0.1 |
| OsType |
string |
No |
The operating system of the ECI instance. Valid values:
Note
Windows instances are in invitational preview. To use Windows instances, submit a ticket. |
Windows |
| CpuArchitecture |
string |
No |
The CPU architecture of the ECI instance. Valid values:
|
ARM64 |
| ComputeCategory |
array |
No |
The computing power category. For more information, see Create an instance by specifying a computing power category. |
|
|
string |
No |
The computing power category. Valid values:
|
economy |
|
| GpuDriverVersion |
string |
No |
The GPU driver version. Note
Only specific instance types support switching the GPU driver version. For more information, see Create an instance by specifying GPU specifications. |
tesla=535 |
| MaxPendingMinute |
integer |
No |
The maximum pending duration of the ECI instance. Unit: minutes. Valid values: 10 to 1440. If the pending duration exceeds this value, the system automatically terminates the instance. Default value: 240. |
10 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| ContainerGroupId |
string |
The instance ID, which is the container group ID. |
eci-uf6fonnghi50u374**** |
| RequestId |
string |
The request ID. |
89945DD3-9072-47D0-A318-353284CFC7B3 |
Examples
Success response
JSON format
{
"ContainerGroupId": "eci-uf6fonnghi50u374****",
"RequestId": "89945DD3-9072-47D0-A318-353284CFC7B3"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Account.Arrearage | Your account has an outstanding payment. | Your account has an outstanding payment. |
| 400 | DryRunOperation | Request validation has been passed with DryRun flag set. | Request validation has been passed with DryRun flag set. |
| 400 | InvalidParameter.CPU.Memory | The specified cpu and memory are not allowed | |
| 400 | InvalidParameter.DuplicatedName | The container group include containers with duplicate names. | The container group contains containers with duplicate names. |
| 400 | InvalidParameter.DuplicatedVolumeName | The container group includes volumes with duplicate names. | The container group includes volumes with duplicate names. |
| 400 | IncorrectStatus | %s | The specified instance status is invalid. |
| 400 | ServiceNotEnabled | %s | The service on which this request depends has not been activated. Please activate and try again. |
| 400 | ImageSnapshot.IncorrectStatus | %s | The status of the specified snapshot is invalid. |
| 400 | ImageSnapshot.NotSupport | %s | Image caching based on data disk snapshots is not available for all users. If you want to enable this function, contact us. |
| 400 | DiskVolume.NotSupport | The disk volume is not supported. | Disk volume does not support your structure. If you want to enable this function, contact us. |
| 400 | RamRole.NotSupport | The RAM role is not supported. | The RAM role is not supported. |
| 400 | DiskNumber.LimitExceed | The maximum number of disks in an instance is exceeded. | The maximum number of disks in an instance is exceeded. |
| 400 | InvalidPaymentMethod.InsufficientBalance | No payment method is specified for your account. We recommend that you add a payment method or add funds to the prepayment balance. | No payment method is specified for your account. We recommend that you add a payment method or add funds to the prepayment balance. |
| 400 | DiskVolume.NotInSameZone | The instance to be created and the disk are not in the same zone. | The instance to be created and the disk are not in the same zone. |
| 400 | NoPermission | You are not authorized to use the "Product on ECI" feature. | |
| 400 | HighCpuMemConfigRequired | You need to apply to be added to the whitelist of the specified CPU and memory. | You need to apply to be added to the whitelist of the specified CPU and memory. |
| 400 | RecommendEmpty.InstanceTypeFamilyNotMatched | The recommended instance type is unavailable in the current zone. Try again later. | No recommended instance types are available in the current zone. Try again later or create instances in another zone. |
| 400 | LocalDiskAmountNotMatch | The number of local volumes does not match the instance type. | The number of local disks does not match the instance type. |
| 400 | Payfor.CreditPayInsufficientBalance | Your payment credit line is insufficient. | Your payment credit line is insufficient. |
| 400 | InvalidOperation.KMS.InstanceTypeNotSupport | The specified instance is invalid. Only I/O optimized instances support KMS key. | The specified instance is invalid. Only I/O optimized instances support KMS key. |
| 400 | InvalidParameter.Encrypted.KmsNotEnabled | KMS must be enabled for encrypted disks. | Encrypted cloud disks require Key Management Service to be enabled. |
| 400 | InvalidParameter.KMS.EncryptedIllegal | After configuring the parameter KmsKeyId, you must enable encryption. | After configuring the parameter KmsKeyId, you must enable encryption. |
| 400 | InvalidSpotCpuMemorySpec | The specified CPU and memory are not allowed. You must create spot ECI using standard ECS specifications for CPU and memory. | A standard ECS instance type must be used to create a spot elastic container instance. |
| 400 | Ipv6AddressNotSupportVsw | IPv6 is not supported in the specified vSwitch. | The vSwitch does not have IPv6 enabled. |
| 400 | Ipv6AddressNotSupport | Ipv6 is not supported in specified region. | The current region does not support IPv6 addresses. |
| 400 | Ipv6AddressNotSupportInstanceType | IPv6 is not supported for the specified instance type. | The specified instance type does not support IPv6. |
| 400 | EipPayInsufficientBalance | Your account does not have enough balance to purchase eip. | The current account balance is insufficient to purchase an EIP. |
| 400 | EipPurchaseFlowControl | Request was denied due to eip frequent purchase. | EIP purchases are too frequent. Try again later. |
| 400 | Throttling | You have made too many requests within a short time; your request is denied due to request throttling | |
| 400 | JobInstanceBatchCreateNotSupport | ECI job instance not support batch create | |
| 400 | JobInstanceDiskNotSupport | ECI job instance not support disk volume | |
| 400 | JobInstanceEipNotSupport | ECI job instance not support eip | |
| 400 | JobInstanceFeatureNotMatch | ECI job instance feature not match | |
| 400 | JobInstanceImageCacheNotSupport | ECI job instance not support image cache | |
| 400 | JobInstanceIPv6NotSupport | ECI job instance not support IPv6 | |
| 400 | JobInstanceRamRoleNotSupport | ECI job instance not support ram role | |
| 400 | JobInstanceRegionNotSupport | ECI job instance not support in this region | |
| 400 | JobInstanceSpotNotSupport | ECI job instance not support spot | |
| 400 | InvalidInstanceTypeForEciSpotDurationBuy | Current instance type does not support spot duration instance. | The specified instance type does not support spot instances with custom duration. |
| 400 | InvalidInstanceTypeForEciBuy | Sales of this current instance type is not supported in eci. | The specified instance type is not within the range of container group types available for sale. |
| 400 | InstanceTypeNotMatchCpuArch | %s. | The CPU architecture of the specified ECS instance type does not match the specified CPU architecture. |
| 400 | JobInstanceEcsInstanceTypeNotSupport | Job-optimized elastic container instances cannot be created by specifying ECS instance types. | Job-optimized container group instances do not support creation with a specified ECS instance type. |
| 400 | PrivatePoolInstanceSpotNotSupport | Spot is not supported for PrivatePool. | |
| 400 | DryRun.Success | This request is a dryrun request with successful result. | The dry run request has passed validation. |
| 400 | PrivateIpAddress.Already.InUse | The specific PrivateIpAddress already in use. | The private IP address is already in use. |
| 400 | IncorrectOperation | %s | You cannot perform this operation on the specified resource. |
| 400 | FeatureBasedConstraintConflict | A conflict occurs in specified feature constraints: [%s]. | A conflict occurs in specified feature constraints |
| 400 | OperationFailed.RiskControl | %s. | We have detected that your account has security risks. Please contact customer service personnel for details. |
| 400 | RISK.RISK_CONTROL_REJECTION | To protect the security of your account, your request has been denied by the risk control system. Please contact Alibaba Cloud Customer Service for details. | In order to protect the security of your account, your request was rejected by the wind control system. Please contact customer service for details. |
| 400 | InvalidInstanceTypeForRaid | %s. | The current specification does not support Raid. |
| 400 | RegionDissolved | %s. | Alibaba Cloud is scheduled to make adjustments in this region. ECI service in this region will be suspended. |
| 400 | MultiAttachedCloudDiskNotSupport | %s. | You cannot mount a cloud disk with the multi-mount function enabled (that is, an NVMe shared disk). |
| 400 | InvalidParameter.ValueExceeded | ecs instance type or vcpu quota exceeded. | Specifications exceed the specified quota range |
| 403 | OperationDenied.VswZoneMisMatch | The specified VSwitchId is not in the specified Zone. | |
| 403 | QuotaExceeded | %s quota exceeded. | |
| 403 | Zone.NotOnSale | The specified zone is not available for purchase. | The zone in which you want to create the instance is no longer available for purchase. Use a different zone, or the vSwitch of the specified VPC cannot be used in this zone. |
| 403 | Forbidden.RiskControl | This operation has been identified as an abnormal operation and cannot be processed. | This operation has been identified as abnormal and cannot be processed. |
| 403 | Forbidden.SubUser | The specified action is not available for you. | |
| 403 | Forbidden.OnlyForInvitedTest | Eci create action is only open to invited users during public beta. | |
| 403 | OperationDenied.SecurityGroupMisMatch | The specified VSwitchId and SecurityGroupId are not in the same VPC. | |
| 403 | InvalidVSwitchId.IpNotEnough | The specified VSwitch does not have enough IP addresses. | |
| 403 | Forbidden.UserBussinessStatus | This operation is not allowed, because you have overdue bills. Pay the overdue bill and try again. | The operation is forbidden because the account has an overdue payment. Top up your account and try again. |
| 403 | Forbidden.UserNotRealNameAuthentication | This operation is not allowed, because you have not passed the real-name verification. | The operation is forbidden because the user has not completed real-name verification. |
| 403 | InvalidUser.PassRoleForbidden | The RAM user is not authorized to assume a RAM role. | The RAM user is not authorized to assume a RAM role. |
| 403 | NoPermission | The RAM role does not belong to ECS. | |
| 403 | OperationDenied.NoStock | Sales of this resource are temporarily suspended in the specified zone. We recommend that you use the multi-zone creation function to avoid the risk of insufficient resource. For more information, see https://www.alibabacloud.com/help/document_detail/157290.html | |
| 403 | InvalidParameter.KMS.KeyId.Forbidden | You are not authorized to access the specified KMSKeyId. | You are not authorized to access the specified KMSKeyId. |
| 403 | Forbidden.AccountClosed | The operation is forbidden. Your account has been closed. | The operation is forbidden because the user account has been deregistered. |
| 403 | InvalidOperation.ResourceManagedByCloudProduct | The operation is forbidden. The security group has been managed by another cloud product. | The security group is managed by another cloud service and cannot be modified. |
| 403 | Spot.NotMatched | %s. We recommend that you use the create multi-zone function to avoid insufficient inventory. For more information, see https://www.alibabacloud.com/help/document_detail/157290.html | |
| 403 | SecurityRisk.3DVerification | We have detected a security risk with your default credit or debit card. Please proceed with verification via the link in your email. | A security risk has been detected on your default credit or debit card. Verify your card by using the link in the email. |
| 403 | CreateServiceLinkedRole.Denied | Please make sure the account has ram:CreateServiceLinkedRole permission. | Please make sure the account has ram:CreateServiceLinkedRole permission. |
| 403 | Throttling.Vcpu.PerDay | The maximum number of request for the day has been exceeded. | The maximum number of request for the day has been exceeded. |
| 403 | FeatureAccessRestricted | Access to this feature:[%s] is restricted. Please contact Alibaba Cloud ECI support to request access. | Access to this feature is restricted. Please contact Alibaba Cloud ECI support to request access. |
| 404 | ImageSnapshot.NotFound | The specified snapshot does not exist. | The snapshot for the image cache does not exist. |
| 404 | InvalidDiskId.NotFound | The specified disk does not exist. | The specified cloud disk does not exist. |
| 404 | InvalidParameter.KMS.KeyId.NotFound | The specified KMSKeyId does not exist. | The specified KMSKeyId does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.