Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Compute Cloud
    • All guides
      • Creating a fixed-size instance group
      • Creating a fixed-size instance group with a network load balancer
      • Creating a fixed-size instance group with an L7 load balancer
      • Creating an instance group with autoscaling
      • Creating an instance group with Container Optimized Image
      • Creating an instance group based on a YAML specification
      • Creating an instance group attached to a reserved instance pool
      • Creating an instance group in a placement group
      • Creating a group of instances with fixed IP addresses
      • Creating an instance group connected to a file storage
      • Creating an instance group connected to Object Storage
    • Viewing service resource operations
    • Viewing metrics in Monitoring
    • NVIDIA driver update guide
  • Yandex Container Solution
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes

In this article:

  • Creating a group in a single availability zone with instances from a reserved instance pool in that zone
  • Creating a group in three availability zones with VMs from the reserve pools of each zone
  • See also
  1. Step-by-step guides
  2. Creating an instance group
  3. Creating an instance group attached to a reserved instance pool

Creating an instance group from a Yandex Compute Cloud reserved instance pool.

Written by
Yandex Cloud
Updated at May 5, 2026
  • Creating a group in a single availability zone with instances from a reserved instance pool in that zone
  • Creating a group in three availability zones with VMs from the reserve pools of each zone
    • See also

Warning

Reserved instance pools are billable: you pay for the whole unused volume of reserved computing resources of VMs, GPU clusters, and software accelerated networks according to the Yandex Compute Cloud pricing policy. For more information, see Using reserved instance pools.

The reserved instance pool feature is at the Preview stage.

A reserved instance pool is the total of computing resources reserved by the user in a given availability zone to secure their guaranteed availability to the user for the purpose of creating VMs of a particular configuration in this availability zone.

You can use reserved pools for instance groups. This guarantees the availability of resources for the instance group.

Reserved instance pools are incompatible with dedicated hosts, preemptible VMs, and VMs with vCPU performance levels below 100%. At present, reserved instance pools do not support placement groups.

Reserved instance pools are created in specific availability zones. To automate the distribution of multi-zone group instances across reserved instance pools of a specific availability zone, use the instance template variables.

For more information, see Reserved instance pools in Compute Cloud.

Creating a group in a single availability zone with instances from a reserved instance pool in that zoneCreating a group in a single availability zone with instances from a reserved instance pool in that zone

  1. Create a service account with the compute.admin role which the group will use to manage instances.

  2. Create a reserved instance pool with a configuration you want to use for the instance group.

    Note

    The configuration of the instance reserve pool must match the configuration of the instance group you want to create in terms of:

    • Platform
    • Number of vCPUs
    • Amount of RAM
    • Availability zone

    The number of VMs in each availability zone must not exceed the size of the reserved instance pools in those zones.

  3. Create an instance group:

    CLI
    Terraform
    API

    If you do not have the Yandex Cloud CLI yet, install and initialize it.

    The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

    1. Create the specification.yaml file containing the instance group specification, for example:

      name: first-fixed-group
      service_account_id: <service_account_ID>
      instance_template:
        platform_id: standard-v4a
        resources_spec:
          memory: 2g
          cores: 2
        boot_disk_spec:
          mode: READ_WRITE
          disk_spec:
            image_id: fd83esfomhq25p2ono90
            type_id: network-hdd
            size: 20g
        network_interface_specs:
          - network_id: <network_ID>
            primary_v4_address_spec: {}
            subnet_ids:
              - <subnet_ID>
            security_group_ids:
              - <security_group_ID>
        reserved_instance_pool_id: <reserved_instance_pool_ID>
      deploy_policy:
        max_unavailable: 1
        max_expansion: 0
      scale_policy:
        fixed_scale:
          size: 3
      allocation_policy:
        zones:
          - zone_id: ru-central1-a
      

      Where:

      • service_account_id: ID of the service account you created earlier.
      • network_id: Network ID.
      • subnet_ids: Subnet ID.
      • security_group_ids: Security group ID.
      • reserved_instance_pool_id: Reserved instance pool ID you created earlier.
      • zone_id: Availability zone.

      For more information about the instance group parameters, see Specification of an instance group in YAML format.

    2. Apply the specification by running this command in the terminal:

      yc compute instance-group create \
        --file specification.yaml
      

      For more information about this command, see the CLI reference.

    If you do not have Terraform yet, install it and configure the Yandex Cloud provider.

    1. In the configuration file, describe the instance group parameters:

      resource "yandex_compute_instance_group" "first-fixed-group" {
        name                = "first-fixed-group"
        service_account_id  = "<service_account_ID>"
      
        instance_template {
          platform_id = "standard-v4a"
          resources {
            memory = 2
            cores  = 2
          }
      
          boot_disk {
            mode = "READ_WRITE"
            initialize_params {
              image_id = "fd83esfomhq25p2ono90"
            }
          }
      
          network_interface {
            network_id         = "<network_ID>"
            subnet_ids         = ["<subnet_ID>"]
            security_group_ids = ["<security_group_ID>"]
          }
      
          reserved_instance_pool_id = "<reserved_instance_pool_ID>"
        }
      
        scale_policy {
          fixed_scale {
            size = 3
          }
        }
      
        allocation_policy {
          zones = ["ru-central1-a"]
        }
      
        deploy_policy {
          max_unavailable = 1
          max_expansion   = 0
        }
      }
      

      Where:

      • service_account_id: ID of the service account you created earlier.
      • network_id: Network ID.
      • subnet_ids: Subnet ID.
      • security_group_ids: Security group ID.
      • reserved_instance_pool_id: Reserved instance pool ID you created earlier.
      • zones: Availability zone.

      For more information about the instance group parameters, see Specification of an instance group in YAML format.

    2. Create an instance group:

      1. In the terminal, navigate to the configuration file directory.

      2. Make sure the configuration is correct using this command:

        terraform validate
        

        If the configuration is valid, you will get this message:

        Success! The configuration is valid.
        
      3. Run this command:

        terraform plan
        

        You will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.

      4. Apply the configuration changes:

        terraform apply
        
      5. Type yes and press Enter to confirm the changes.

    For more information about yandex_compute_instance_group, see this Terraform reference.

    Use the create REST API method for the InstanceGroup resource or the InstanceGroupService/Create gRPC API call.

    To specify the reserved pool, use the instanceTemplate.reservedInstancePoolId (instance_template.reserved_instance_pool_id) parameter.

Creating a group in three availability zones with VMs from the reserve pools of each zoneCreating a group in three availability zones with VMs from the reserve pools of each zone

  1. Create a service account with the compute.admin role which the group will use to manage instances.

  2. Create reserved instance pools in three availability zones using a configuration you want to use for the instance group.

    Note

    The configuration of the instance reserve pool must match the configuration of the instance group you want to create in terms of:

    • Platform
    • Number of vCPUs
    • Amount of RAM
    • Availability zone

    The number of VMs in each availability zone must not exceed the size of the reserved instance pools in those zones.

  3. Create an instance group:

    CLI
    Terraform
    API

    If you do not have the Yandex Cloud CLI yet, install and initialize it.

    The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

    1. Create the specification.yaml file containing the instance group specification, for example:

      name: first-fixed-group
      service_account_id: <service_account_ID>
      variables:
        - key: pool_ru-central1-a
          value: <reserved_instance_pool_ID_in_zone_a>
        - key: pool_ru-central1-b
          value: <reserved_instance_pool_ID_in_zone_b>
        - key: pool_ru-central1-d
          value: <reserved_instance_pool_ID_in_zone_d>
      instance_template:
        platform_id: standard-v4a
        resources_spec:
          memory: 2g
          cores: 2
        boot_disk_spec:
          mode: READ_WRITE
          disk_spec:
            image_id: fd83esfomhq25p2ono90
            type_id: network-hdd
            size: 20g
        network_interface_specs:
          - network_id: <network_ID>
            primary_v4_address_spec: {}
            subnet_ids:
              - <subnet_ID_in_zone_a>
              - <subnet_ID_in_zone_b>
              - <subnet_ID_in_zone_d>
            security_group_ids:
              - <security_group_ID>
        reserved_instance_pool_id: "{pool_{instance.zone_id}}"
      deploy_policy:
        max_unavailable: 1
        max_expansion: 0
      scale_policy:
        fixed_scale:
          size: 3
      allocation_policy:
        zones:
          - zone_id: ru-central1-a
          - zone_id: ru-central1-b
          - zone_id: ru-central1-d
      

      Where:

      • service_account_id: ID of the service account you created earlier.
      • network_id: Network ID.
      • subnet_ids: Subnet IDs.
      • security_group_ids: Security group ID.
      • variables: User-defined variables with IDs of reserved instance pools in different availability zones.
      • reserved_instance_pool_id: Reserved instance pool IDs you will get as a result of substituting the instance.zone_id system variable (availability zone of a specific instance) and the user-defined variables specified in the variables parameter.
      • zone_id: Availability zone.

      For more information about the instance group parameters, see Specification of an instance group in YAML format.

    2. Apply the specification by running this command in the terminal:

      yc compute instance-group create \
        --file specification.yaml
      

      For more information about this command, see the CLI reference.

    If you do not have Terraform yet, install it and configure the Yandex Cloud provider.

    1. In the configuration file, describe the instance group parameters:

      resource "yandex_compute_instance_group" "ig-1" {
        name                = "fixed-group"
        service_account_id  = "<service_account_ID>"
      
        # Variables for reserved instance pools
        variables = {
          pool_ru-central1-a = "<reserved_instance_pool_ID_in_zone_a>"
          pool_ru-central1-b = "<reserved_instance_pool_ID_in_zone_b>"
          pool_ru-central1-d = "<reserved_instance_pool_ID_in_zone_d>"
        }
      
        instance_template {
          platform_id = "standard-v4a"
          resources {
            memory = 2
            cores  = 2
          }
      
          boot_disk {
            mode = "READ_WRITE"
            initialize_params {
              image_id = "fd83esfomhq25p2ono90"
            }
          }
      
          network_interface {
            network_id         = "<network_ID>"
            subnet_ids         = ["<subnet_ID_in_zone_a>", "<subnet_ID_in_zone_b", "<subnet_ID_in_zone_d>"]
            security_group_ids = ["<security_group_ID>"]
          }
      
          # instance.zone_id: System variable with the zone ID
          reserved_instance_pool_id = "{pool_{instance.zone_id}}"
        }
      
        scale_policy {
          fixed_scale {
            size = 3
          }
        }
      
        allocation_policy {
          zones = ["ru-central1-a", "ru-central1-b", "ru-central1-d"]
        }
      
        deploy_policy {
          max_unavailable = 1
          max_expansion   = 0
        }
      }
      

      Where:

      • service_account_id: ID of the service account you created earlier.
      • network_id: Network ID.
      • subnet_ids: Subnet IDs.
      • security_group_ids: Security group ID.
      • variables: User-defined variables with IDs of reserved instance pools in different availability zones.
      • reserved_instance_pool_id: Reserved instance pool IDs you will get as a result of substituting the instance.zone_id system variable (availability zone of a specific instance) and the user-defined variables specified in the variables parameter.
      • zones: Availability zones.

      For more information about the instance group parameters, see Specification of an instance group in YAML format.

    2. Create an instance group:

      1. In the terminal, navigate to the configuration file directory.

      2. Make sure the configuration is correct using this command:

        terraform validate
        

        If the configuration is valid, you will get this message:

        Success! The configuration is valid.
        
      3. Run this command:

        terraform plan
        

        You will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.

      4. Apply the configuration changes:

        terraform apply
        
      5. Type yes and press Enter to confirm the changes.

    For more information about yandex_compute_instance_group, see this Terraform reference.

    Use the create REST API method for the InstanceGroup resource or the InstanceGroupService/Create gRPC API call.

    To specify the reserved pool, use the instanceTemplate.reservedInstancePoolId (instance_template.reserved_instance_pool_id) parameter.

    Variables are set in the variables parameter.

See alsoSee also

  • Instance Groups concepts
  • Reserved instance pools in Compute Cloud
  • Variables in an instance template

Was the article helpful?

Previous
Creating an instance group based on a YAML specification
Next
Creating an instance group in a placement group
© 2026 Direct Cursus Technology L.L.C.