You need to enable JavaScript to run this app.
Volcengine Kubernetes Engine

Volcengine Kubernetes Engine

Copy page
Download PDF
Creating an instance
Instance specification adjustment description
Copy page
Download PDF
Instance specification adjustment description
This topic describes the specification adjustment logic for VCI instances when conflicts arise between the specified instance type, instance family, and the resource configurations (such as CPU, memory, and GPU) during instance creation.​
General-purpose instance​
Create an instance by specifying an instance family​
When creating an instance, if you only specify the instance family and configure the vCPU and memory of containers but do not specify a specific instance type, VCI calculates the specific VCI instance type required by your Pod as follows:​
  1. Calculate the total upper limits for the CPU and memory of pods separately:​
  • The total CPU value is the higher of the two values: the maximum CPU limit among all Init containers in the pod and the sum of the CPU limits of all application containers.​
tip​
If no CPU limit is configured for an Init container or an application container, the CPU request value of the container is used.​
  • The total memory value is the higher of the two values: the maximum memory limit among all Init containers in the pod and the sum of the memory limits of all application containers.​
tip​
If no memory limit is configured for an Init or application container, the memory request value of the container is used.​
  • If neither the limit nor the request for memory or CPU is configured for a container in the pod, the value of that item is counted as 0.​
  1. The system automatically adjusts the pod specifications based on the total values and charges fees based on the instance specifications after the automatic adjustment. The adjustment method is as follows:​
  • ​
    Total value​
    Calculation method​
    Total CPU value = 0​
    AND​
    Total memory value = 0​
    The instance specification of 2 cores and 4 GiB is used by default.​
    Total CPU value = 0; Total memory value != 0​
    OR​
    Total CPU value != 0; Total memory value = 0​
    Match the lowest specification based on the total value of the non-zero item:​
    1. First, match the non-zero item, and select an instance specification that is consistent or close to but larger than the specification of the matched item.​
    1. Then, match the zero item and select an instance specification that is close to but greater than the specification of the matched item.​
    If the total memory value is 0.8 GiB and the total CPU value is 0, the vci.u1 instance family is matched in the following order. First, match 1 GiB based on the total memory value of 0.8 GiB. Then, match the CPU of 0.25 cores based on the lowest specification matching principle. As a result, the specification of the created VCI pod is vci.u1.0.25c-1gi.​
    Total CPU value != 0​
    AND​
    Total memory value != 0​
    1. First, match the total CPU value and select an instance specification that is equal to or slightly larger than the matched specification (such as Specification A).​
    1. Then, match the total memory value and select an instance specification that is equal to or slightly larger than the matched specification:​
    • If the total memory value is less than the minimum memory value of Specification A, select the minimum memory value of Specification A.​
    • If the total memory value is within the memory range of Specification A, select an instance specification that is consistent or close to but larger than the total memory value.​
    • If the total memory value is greater than the maximum memory value of Specification A, select an instance specification that is close to but larger than the memory value (Specification B), and adjust the total CPU value to the CPU value of Specification B.​
    For example, when the total CPU value matches the specifications of 1.25 cores in the vci.u1 instance family, two specifications in the vci.u1 instance family are available: vci.u1.1.25c-2.5gi and vci.u1.1.25c-5gi:​
    • If the total memory value is 2 GiB, the vci.u1.1.25c-2.5gi specification is matched.​
    • If the total memory value is 3 GiB, the vci.u1.1.25c-5gi specification is matched.​
    • If the total memory value is 6 GiB, neither the vci.u1.1.25c-2.5gi nor the vci.u1.1.25c-5gi specification meets the requirements. Therefore, the vci.u1.1.5c-6gi specification is selected, which is close to 6 GiB. In this case, the CPU is no longer matched at 1.25 cores but at 1.5 cores.​
    Either the total CPU or memory value exceeds the highest specification provided by VCI​
    If no item is matched, the VCI pod fails to be created.​
    ​
Create an instance by specifying a specific instance type​
When creating a general‑purpose instance, if you specify a specific VCI instance type but it conflicts with the vCPU and memory settings of your containers, VCI handles it as follows:​
  1. Calculate the total upper limits for the CPU and memory of pods separately. The calculation method for the total value is the same as that described in the Create an instance by specifying only the instance family section.​
  1. The system automatically adjusts the pod specifications based on the total values and charges fees based on the instance specifications after the automatic adjustment. The adjustment method is as follows:​
  • ​
    Total value​
    Calculation method​
    Total CPU value = 0​
    AND​
    Total memory value = 0​
    Use the VCI specifications specified in the annotation.​
    Total CPU value = 0; Total memory value != 0​
    OR​
    Total CPU value != 0; Total memory value = 0​
    Match the non-zero items:​
    • If the specifications of the item are greater than those specified by the annotation, the system reports an error, and the instance fails to be created.​
    • If the specifications of the item are less than or equal to the specifications specified by the annotation, the specifications specified by the annotation are used.​
    Total CPU value != 0​
    AND​
    Total memory value != 0​
    1. Match the total CPU value first:​
    • If the value is greater than the specifications specified by the annotation, the system reports an error, and the instance fails to be created.​
    • If this value is less than or equal to the specifications specified by the annotation, continue to match the total memory value.​
    1. Match the total memory value:​
    • If the value is greater than the specifications specified by the annotation, the system reports an error, and the instance fails to be created.​
    • If the value is less than or equal to the specifications specified by the annotation, the specifications specified by the annotation are used.​
    ​
GPU-accelerated instances​
Specification matching logic​
  • The specifications are matched in the following priority order: first GPU requirements, then CPU and memory resource claims.​
  • If you do not specify the limits of CPU and memory for containers, the number of GPUs is used to match the corresponding instance specifications of the GPU-accelerated instance family. In most cases, the number of GPUs can determine the pod instance specification.​
  • For some GPU-accelerated instance families, multiple instance specifications may be available with a single GPU. In this case, the minimum available instance specification is matched by default.​
  • If you specify the limits of CPU and memory for some or all containers, the number of GPUs is used to match the target instance specifications and perform related validation and confirmation.​
  • Scenario 1: Both CPU and memory limits are specified​
  • Make sure that the specified resource limit values are less than or equal to the relevant configurations of the target instance specification matched by the GPU. Otherwise, the matching will fail. The specific rules are as follows:​
  1. First, filter out and match the target instance specifications based on the number of GPUs. In this scenario, one or more instance specifications may be matched based on the GPU type.​
  1. Then, among the filtered instance specifications, select instance specifications that are consistent with or close to but larger than the total value of CPU resources. If the total value of CPU resources exceeds the highest specification among the filtered specifications, the instance fails to be created.​
  1. Finally, among the filtered instance specifications, select an instance specification that is consistent with or close to but larger than the total value of memory resources. If the total value of memory resources exceeds the highest specification among the filtered specifications, the instance fails to be created.​
  • Scenario 2: When CPU or memory limits are specified​
  • Make sure that the specified resource limit values are less than or equal to the relevant configurations of the target instance specification matched by the GPU. Otherwise, the matching will fail. The specific rules are as follows:​
  1. First, filter out and match the target instance specifications based on the number of GPUs. In this scenario, one or more instance specifications may be matched based on the GPU type.​
  1. Finally, among the filtered instance specifications, select an instance specification that is consistent with or close to but larger than the number of resources for which the limit is not zero. If the number of resources for which the limit is not zero exceeds the highest specification among the filtered specifications, the instance fails to be created.​
Specification normalization logic​
When you create a GPU-accelerated instance, the adjustment method for instance specifications is as follows:​
  1. Calculate the total upper limits for the CPU, memory, and GPU of pods separately:​
  • The total CPU value is the higher of the two values: the maximum CPU limit among all Init containers in the pod and the sum of the CPU limits of all application containers.​
  • The total memory value is the higher of the two values: the maximum memory limit among all Init containers in the pod and the sum of the memory limits of all application containers.​
  • The total GPU value is the higher of the two values: the maximum GPU limit among all Init containers in the pod and the sum of the GPU limits of all application containers.​
  • If the CPU, memory, or GPU limit is not configured for the containers in the pod, the limit on that resource is 0.​
  1. Obtain the corresponding vCPU, memory, GPU, and other values from the GPU-accelerated instance (specification values) based on the value specified in the annotation.​
  1. The total value and specification value must meet all of the following conditions:​
  • The <vendor> of the Pod.spec.container[].resources.limit.'<vendor>.com/gpu' field must be consistent with the vendor of the instance family GPU.​
tip​
The current GPU is an NVIDIA GPU. Therefore, <vendor> is nvidia.​
  • The GPU value in the total values must be greater than 0.​
  • The CPU, memory, and GPU values in the total values must all be less than or equal to the corresponding values in the specification values.​
warning​
If the total values are less than the specification values, the instance is created and billed based on the specification values. If the GPU value specified in the container is less than the specification value, resource waste may occur. Plan the instance specifications based on your business requirements.​
Last updated: 2026.09.03 15:56:09