[Yandex Cloud documentation](../../index.md) > [Yandex Compute Cloud](../index.md) > [Concepts](index.md) > Virtual machines > Overview

# VMs in Compute Cloud

A _virtual machine_ is similar to a server in cloud infrastructures.

## VMs as a Yandex Cloud resource {#project}

A VM is created in one of the [folders](../../resource-manager/concepts/resources-hierarchy.md#folder) within your [cloud](../../resource-manager/concepts/resources-hierarchy.md#cloud) and inherits its access permissions. You can read more about the Yandex Cloud resource hierarchy [here](../../resource-manager/concepts/resources-hierarchy.md).

Each VM has a unique ID and name. The name is unique within the folder. The naming requirements are as follows:

* 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 info %}

The VM name is used to generate an [internal FQDN](network.md#hostname), 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.

{% endnote %}

The ID is generated automatically when the VM is being created and is unique within Yandex Cloud.

You can move a VM to another folder within a single cloud.

## Availability zone {#az}


When creating a VM, you can select a Yandex Cloud [availability zone](../../overview/concepts/geo-scope.md) to place it in.

To move a VM to a different availability zone, use a special [CLI](../../cli/cli-ref/compute/cli-ref/instance/relocate.md) command or create a VM copy in the destination availability zone and then delete the source VM.

## Service account {#sa}

To make it easier to [authenticate in Yandex Cloud from within a VM](../operations/vm-connect/auth-inside-vm.md), associate a [service account](../../iam/concepts/users/service-accounts.md) with that VM.

All cloud resource operations performed from within the VM, whether via the [CLI](../../cli/quickstart.md), [Terraform](../../terraform/quickstart.md), or [API](../../api-design-guide/concepts/general.md), will use the service account.

Authentication uses a secure, short-lived [IAM token](../../iam/concepts/authorization/iam-token.md). You do not need to keep sensitive authentication data on the VM.

The service account can access cloud resources only within the scope of its [roles](../../iam/concepts/access-control/roles.md). [Assign](../../iam/operations/sa/assign-role-for-sa.md) your service account a specific role for the resource you want to access. You can [revoke](../../iam/operations/roles/revoke.md) the role at any time.

The VM also uses the service account to send custom metrics to [Yandex Monitoring](../../monitoring/quickstart.md), deliver logs to [Yandex Cloud Logging](../../logging/quickstart.md), and connect to [Yandex Cloud Backup](../../backup/quickstart/existing-vm.md).

You can only associate a single service account with the VM. To remove or replace the associated service account, [update](../operations/vm-control/vm-update.md) the VM settings accordingly.

## Computing resources {#types}

When creating a VM, you need to specify the amount of computing resources to allocate to it, including the number and performance of vCPUs and the amount of RAM. You can choose the computing resources that are appropriate for the expected load. For more information, see [vCPU performance levels](performance-levels.md).

You can create a [reserved instance pool](reserved-pools.md) to reserve computing resources for as many VMs as you need in a particular availability zone.

## Hardware generations {#hardware-generations}

The virtualized hardware a Compute Cloud VM is deployed on and its OS has access to can belong to different [generations](hardware-generations.md).

The VM will run on virtualized hardware of the generation assigned to the [disk](disk.md), [snapshot](snapshot.md), or [image](image.md) the VM was created based on.

Once a VM has been created, its hardware generation cannot be changed. Instead, you can create a [snapshot](../operations/disk-control/create-snapshot.md#create) or [image](../operations/image-create/create-from-disk.md) from the boot disk of your existing VM with preferred hardware generation assigned and then proceed to create a new VM from the resulting snapshot or image.

## Disks {#disks}

A VM must have at least one disk attached, which is a boot disk. Currently, you can only attach a boot disk when creating a VM.

You can also attach additional disks to your VM. You can either attach a previously created disk or create one with a new VM. You can create an empty disk or restore it from a [snapshot](snapshot.md) or an [image](image.md).

{% note info %}

Empty disks do not have a file system. If you are attaching an empty disk, [partition and mount](../operations/vm-control/vm-attach-disk.md#mount) it manually. Alternatively, rather than attaching an empty disk, you can [create a snapshot](../operations/disk-control/create-snapshot.md) of the boot disk and use it to [create a VM](../operations/vm-create/create-from-snapshots.md).

{% endnote %}

You can attach and detach additional disks even after you created the VM.

Read more about disks in [Disks](disk.md).

## Statuses {#status}

The status of a VM determines which operations you can currently perform on it.

> For example, the `STOPPED` status means the VM is stopped and you cannot connect to it. To connect to such a VM, you must [start](../operations/vm-control/vm-stop-and-start.md#start) it first. After the status changes to `RUNNING` and the OS boots, you will be able to connect to the VM.

For more information about statuses, see [VM statuses](vm-statuses.md).

## Metadata {#metadata}

You can specify your own metadata when creating or updating VMs. For example, to connect to a Linux VM, you need to provide an SSH key to it. which can be done using the metadata service. For more information, see [VM metadata](vm-metadata.md).

## Network {#network}

When creating a VM, you need to specify its network interface settings by selecting the [subnet](../../vpc/concepts/network.md#subnet) to connect the VM to, configuring an [internal and public IP address](../../vpc/concepts/address.md), and adding the required [security groups](../../vpc/concepts/security-groups.md). This will allow the VM to work with other services on the intranet and internet.

For more information, see [VM network interfaces](network.md).

## Use cases {#examples}

* [Scheduled instance group scaling](../tutorials/vm-scale-scheduled/index.md)
* [Configuring a secure GRE tunnel over IPsec](../tutorials/gre-over-ipsec.md)
* [Configuring time synchronization using NTP](../tutorials/ntp.md)
* [Transferring logs from a VM to Yandex Cloud Logging](../tutorials/vm-fluent-bit-logging.md)
* [Assigning a domain name to a web server VM](../tutorials/bind-domain-vm/index.md)

#### Useful links {#see-also}

* [How to select the right VM type in Yandex Cloud](https://yandex.cloud/ru/blog/posts/2025/03/vm-type-selection)