Creating an instance group
Create an instance group using Instance Groups in the Yandex Cloud management console.
Getting started
- Log in to the management console
or sign up. If you have not signed up yet, navigate to the management console and follow the on-screen instructions. - On the Yandex Cloud Billing
page, make sure you have a billing account linked and its status isACTIVEorTRIAL_ACTIVE. If you do not have a billing account yet, create one. - If you do not have a folder yet, create one.
Creating an instance group
You can create an autoscaling instance group or group with a fixed number of VM instances. For more information, see Scaling types.
Alert
When creating instance groups, keep the limits in mind. Not to disrupt the component Instance Groups, do not update or delete manually created resources: target group Network Load Balancer, VMs, and disks. Instead of this, change or delete the entire group.
To create an instance group:
-
In the management console
, select the folder you want to create your instance group in. -
Navigate
to Compute Cloud. -
In the left-hand panel, select
Instance groups. -
Click Create group of virtual machines.
-
Under Basic parameters:
-
Enter a name and description for your instance group. Follow these naming requirements:
- Length: between 3 and 63 characters.
- It can only contain lowercase Latin letters, numbers, and hyphens.
- It must start with a letter and cannot end with a hyphen.
Note
The VM name is used to generate an internal FQDN, which is set only once, when you create the VM. If the internal FQDN is important to you, make sure to choose an appropriate name for your VM.
-
Select the service account from the list or create a new one. To be able to create, update, and delete VM instances in the instance group, assign the
editorrole to the service account. By default, all operations in Instance Groups are performed on behalf of a service account.You cannot delete a service account while it is linked to an instance group.
-
-
Under Allocation, select the availability zones. Instances of a group may reside in different availability zones.
-
Under Instance template, click Define to configure a basic instance:
-
Under Boot disk image, select the public image the group's instances will operate based on.
-
Under Disks and file storages:
- Select the disk type.
- Specify the disk size.
- Optionally, click Add to add more disks or file storages.
-
Under Computing resources, select one of the preset instance configurations or navigate to the Custom tab to create a custom configuration.
-
Under Network settings:
-
Select a cloud network and subnet. If your network has no subnets, create one:
- Expand the dropdown list and click
Create subnet. - Enter a name and a description for the new subnet. Specify availability zone and CIDR.
- Click Create subnet.
- Expand the dropdown list and click
-
In the Public address field, select the IP address assignment method:
Auto: To assign a random IP address from the Yandex Cloud IP address pool.No address: Do not assign a public IP address.
-
Optionally, select a security group. If there is no security group, create one:
- Expand the dropdown list and click Create group.
- Enter a name and description for the security group.
- Click
Add rule to create the required rules in the security group. - Click Create.
-
-
Under Access:
-
Select Access by OS Login to connect and manage access to your instances using OS Login in Yandex Identity Hub.
With OS Login, you can connect to VMs using SSH keys and SSH certificates via a standard SSH client or the Yandex Cloud CLI. OS Login enables rotating the SSH keys used to access VMs, providing the most secure access option.
-
If you prefer not to use OS Login, select SSH key and specify the following VM access data:
-
In the Login field, enter the username.
Alert
Do not use
rootor other OS-reserved usernames . For operations requiring root privileges, use thesudocommand. -
In the SSH key field, select the SSH key saved in your organization user profile.
If there are no SSH keys in your profile or you want to add a new key:
-
Click Add key.
-
Enter a name for the SSH key.
-
Select one of the following:
-
Enter manually: Paste the contents of the public SSH key. You need to create an SSH key pair on your own. -
Load from file: Upload the public part of the SSH key. You need to create an SSH key pair on your own. -
Generate key: Automatically create an SSH key pair.When adding a new SSH key, an archive containing the key pair will be created and downloaded. In Linux or macOS-based operating systems, unpack the archive to the
/home/<user_name>/.sshdirectory. In Windows, unpack the archive to theC:\Users\<user_name>/.sshdirectory. You do not need additionally enter the public key in the management console.
-
-
Click Add.
The system will add the SSH key to your organization user profile. If the organization has disabled the ability for users to add SSH keys to their profiles, the added public SSH key will only be saved in the user profile inside the newly created resource.
-
-
In public Linux images provided by Yandex Cloud, the functionality of connecting over SSH using login and password is disabled by default.
-
-
Optionally, expand the Additional section and do the following in the fields that appear:
- Select the service account from the list or create a new one.
- Optionally, enable access to the serial console.
-
Click Save.
-
-
Under Changes during creation and updates, specify the following:
-
Add above target value: Maximum number of instances the group size can be scaled up by.
When bringing the number of VMs in the group to the target value, VMs created in excess of the target under the
max_expansionquota can remain in the group, while those that existed in the group before may be deleted. -
Reduce below target value: Maximum number of instances the group size can be scaled down by.
-
Create simultaneously: Maximum number of instances that can be created at the same time.
-
Startup duration: Period after which the instance will start receiving traffic.
-
Stop simultaneously: Maximum number of instances that can be stopped at the same time.
-
Stop VMs by strategy: Instance shut-down strategy,
ProactiveorOpportunistic.For more information, see Deployment policy.
-
-
Under Scaling:
-
Select the scaling type.
-
If you selected
Fixed, specify the group size. -
If you selected
Automatic, specify:- Minimum number of VM instances per availability zone.
- Maximum group size.
- Utilization measurement period: Period used to average utilization measurements for each VM instance in a group.
- Instance warmup period: Period during which a new VM instance is ignored when measuring the group's average load.
- Stabilization period: Period during which the target number of VM instances in the group cannot be reduced.
- Initial group size: Number of VM instances created along with the group.
-
If you selected
Fixed with automatic dry-run, specify the group size and autoscaling parameters. For this type, autoscaling works in test mode.
-
-
If you previously selected
Automaticas your scaling type, under Metrics, specify the target CPU utilization as a percentage. -
Optionally, under Integration with Network Load Balancer, enable Create target group and enter the target group name and description.
Target groups enable the network load balancer to distribute traffic effectively.
-
Under Health checks:
-
Optionally, enable Activate.
- Select either
HTTPorTCPfor the check type. - Specify the path for the checks.
- Specify a port from the range from 1 to 32767.
- Specify the response timeout in seconds.
- Specify the interval, in seconds, for sending health check requests.
- Specify the healthy threshold, which is the number of successful checks required to consider the VM instance ready to receive traffic.
- Specify the unhealthy threshold, which is the number of failed checks after which no traffic will be routed to the VM.
- Select either
-
-
Click Create.
The instance group will appear in the list.
What's next
- Check out tutorials for creating web services in Yandex Cloud.
- Learn how to use instance groups.
- Read answers to FAQs.