[Yandex Cloud documentation](../../../index.md) > [Yandex Compute Cloud](../../index.md) > [Step-by-step guides](../index.md) > Managing a VM > Changing VM computing resources

# Changing VM computing resources


After you create a VM, you can change its computing resources. For more information on how to change a VM name, description, and labels, see [Updating a VM](vm-update.md).

{% note warning %}

When you change a VM's computing resources, they can be redistributed evenly across two [NUMA](https://en.wikipedia.org/wiki/Non-uniform_memory_access) nodes on the physical server. This alters the PCI topology and can change the network adapter address on the PCI bus.

Keep this in mind if using an OS sensitive to such changes. For example, in Windows, network adapter settings may be reset to their defaults, i.e., to obtaining network settings via [DHCP](https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol). As a result, you may lose access to your VM.

{% endnote %}

## Changing the vCPU and RAM configuration {#update-vcpu-ram}

This section explains you how to change the number and performance of vCPUs and the amount of RAM.

{% note warning %}


* VMs with over 256 vCPUs will run correctly only on operating systems with Linux kernel version 5.15 or higher. 

* For Windows-based VMs, the maximum number of vCPUs is 224.

{% endnote %}

{% list tabs group=instructions %}

- Management console {#console}

  To change the vCPU and RAM of a VM:

  1. In the [management console](https://console.yandex.cloud), select the [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) the VM belongs to.
  1. Navigate to **Compute Cloud**.
  1. Click the VM name.
  1. Click **Stop** in the top-right corner of the page.
  1. In the window that opens, click **Stop**.
  1. Wait until the VM status changes to `Stopped`, then click ![image](../../../_assets/console-icons/pencil.svg) **Edit VM** in the top-right corner of the page.
  1. Change the VM [configuration](../../concepts/performance-levels.md) under **Computing resources**. To do this:

      * Go to the **Custom** tab.
      * Select a [platform](../../concepts/vm-platforms.md).
      * Specify the [guaranteed share](../../concepts/performance-levels.md) and required number of vCPUs, as well as RAM size.
      * Make your VM [preemptible](../../concepts/preemptible-vm.md), if required.

  1. Click **Save changes**.
  1. Click **Start** in the top-right corner.
  1. In the window that opens, click **Start**.

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) 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. See the description of the CLI command for updating VM parameters:

      ```bash
      yc compute instance update --help
      ```

  1. Get a list of VMs in the default folder:

      ```bash
      yc compute instance list
      ```
      
      Result:
      ```text
      +----------------------+-----------------+---------------+---------+----------------------+
      |          ID          |       NAME      |    ZONE ID    | STATUS  |     DESCRIPTION      |
      +----------------------+-----------------+---------------+---------+----------------------+
      | fhm0b28lgfp4******** | first-instance  | ru-central1-a | RUNNING | my first vm via CLI  |
      | fhm9gk85nj7g******** | second-instance | ru-central1-a | RUNNING | my second vm via CLI |
      +----------------------+-----------------+---------------+---------+----------------------+
      ```

  1. Select `ID` or `NAME` of the VM, e.g., `first-instance`.
  1. Stop the VM:

      ```bash
      yc compute instance stop first-instance
      ```

  1. Get the current VM [configuration](../../concepts/performance-levels.md) with [metadata](../../concepts/vm-metadata.md):

      ```bash
      yc compute instance get --full first-instance
      ```

  1. Change the VM configuration:

      ```bash
      yc compute instance update first-instance \
        --memory 32 \
        --cores 4 \
        --core-fraction 100
      ```

      This command will change the VM configuration as follows:
      * **Guaranteed vCPU allocation** to 100%.
      * **Number of vCPUs** to 4.
      * **RAM** to 32 GB.

  1. Run the VM:

      ```bash
      yc compute instance start first-instance
      ```

- API {#api}

  To change the vCPU and RAM of a VM, use the [update](../../api-ref/Instance/update.md) REST API method for the [Instance](../../api-ref/Instance/index.md) resource or the [InstanceService/Update](../../api-ref/grpc/Instance/update.md) gRPC API call.

{% endlist %}

## Adding a GPU to an existing VM {#add-gpu}

{% note warning %}

The VM’s operating system must have the appropriate GPU drivers installed when adding a GPU. For such VMs, we recommend using one of the [GPU-specific images](../../concepts/gpus.md#os).

You can also [install the drivers](../vm-operate/install-nvidia-drivers.md) on another standard image manually.

Compute Cloud performs health checks and recommends installing only [LTS versions of drivers](https://docs.nvidia.com/datacenter/tesla/drivers/releases.json).

{% endnote %}

To add a [GPU](../../concepts/gpus.md) to an existing VM, change the platform and specify the number of GPUs.

{% list tabs group=instructions %}

- Management console {#console}

  To change the number of GPUs on a VM:

  1. In the [management console](https://console.yandex.cloud), select the [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) the VM belongs to.
  1. Navigate to **Compute Cloud**.
  1. Click the VM name.
  1. Click **Stop** in the top-right corner of the page.
  1. In the window that opens, click **Stop**.
  1. Wait until the VM status changes to `Stopped`, then click ![image](../../../_assets/console-icons/pencil.svg) **Edit VM** in the top-right corner of the page.
  1. Under **Computing resources**:

      * Navigate to the **GPU** tab.
      * Select one of these [platforms](../../concepts/vm-platforms.md#gpu-platforms):

          * Intel Broadwell with NVIDIA® Tesla® V100
          * Intel Cascade Lake with NVIDIA® Tesla® V100
          * AMD EPYC™ with NVIDIA® Ampere® A100
          * Intel Ice Lake with NVIDIA® Tesla® T4
          * Intel Ice Lake with T4i

      * Select one of the available configurations with the required number of GPUs, vCPUs, and amount of RAM.

  1. Click **Save changes**.
  1. Click **Start** in the top-right corner of the page.
  1. In the window that opens, click **Start**.

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) 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. See the description of the CLI command for updating VM parameters:

      ```bash
      yc compute instance update --help
      ```

  1. Get a list of VMs in the default folder:

      ```bash
      yc compute instance list
      ```
      
      Result:
      ```text
      +----------------------+-----------------+---------------+---------+----------------------+
      |          ID          |       NAME      |    ZONE ID    | STATUS  |     DESCRIPTION      |
      +----------------------+-----------------+---------------+---------+----------------------+
      | fhm0b28lgfp4******** | first-instance  | ru-central1-a | RUNNING | my first vm via CLI  |
      | fhm9gk85nj7g******** | second-instance | ru-central1-a | RUNNING | my second vm via CLI |
      +----------------------+-----------------+---------------+---------+----------------------+
      ```

  1. Select `ID` or `NAME` of the VM, e.g., `first-instance`.
  1. Stop the VM:

      ```bash
      yc compute instance stop first-instance
      ```

  1. Get the current VM [configuration](../../concepts/performance-levels.md) with [metadata](../../concepts/vm-metadata.md):

      ```bash
      yc compute instance get --full first-instance
      ```

  1. Change the VM configuration:

      ```bash
      yc compute instance update first-instance \
        --platform=standard-v3-t4 \
        --cores=8 \
        --memory=32 \
        --gpus=1
      ```

      This command will change the VM configuration as follows:

      * **Platform** to Intel Ice Lake with NVIDIA® Tesla® T4.
      * **Number of vCPUs** to 8.
      * **RAM** to 32 GB.
      * **Number of GPUs** to 1.

  1. Start the VM:

      ```bash
      yc compute instance start first-instance
      ```

- API {#api}

  To change the platform and configuration of a VM, use the [update](../../api-ref/Instance/update.md) REST API method for the [Instance](../../api-ref/Instance/index.md) resource or the [InstanceService/Update](../../api-ref/grpc/Instance/update.md) gRPC API call.

{% endlist %}

## Changing the number of GPUs {#update-gpu}

{% note warning %}

The VM’s operating system must have the appropriate GPU drivers installed when adding a GPU. For such VMs, we recommend using one of the [GPU-specific images](../../concepts/gpus.md#os).

You can also [install the drivers](../vm-operate/install-nvidia-drivers.md) on another standard image manually.

Compute Cloud performs health checks and recommends installing only [LTS versions of drivers](https://docs.nvidia.com/datacenter/tesla/drivers/releases.json).

{% endnote %}

{% list tabs group=instructions %}

- Management console {#console}

  To change the number of [GPUs](../../concepts/gpus.md) on an existing VM:

  1. In the [management console](https://console.yandex.cloud), select the [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) the VM belongs to.
  1. Navigate to **Compute Cloud**.
  1. Click the VM name.
  1. Click **Stop** in the top-right corner of the page.
  1. In the window that opens, click **Stop**.
  1. Wait until the VM status changes to `Stopped`, then click ![image](../../../_assets/console-icons/pencil.svg) **Edit VM** in the top-right corner of the page.
  1. Under **Computing resources**:

      * Navigate to the **GPU** tab.
      * Select one of these [platforms](../../concepts/vm-platforms.md#gpu-platforms):

          * Intel Broadwell with NVIDIA® Tesla® V100
          * Intel Cascade Lake with NVIDIA® Tesla® V100
          * AMD EPYC™ with NVIDIA® Ampere® A100
          * Intel Ice Lake with NVIDIA® Tesla® T4
          * Intel Ice Lake with T4i

      * Select one of the available configurations with the required number of GPUs, vCPUs, and amount of RAM.

  1. Click **Save changes**.
  1. Click **Start** in the top-right corner of the page.
  1. In the window that opens, click **Start**.

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) 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. See the description of the CLI command for updating VM parameters:

      ```bash
      yc compute instance update --help
      ```

  1. Get a list of VMs in the default folder:

      ```bash
      yc compute instance list
      ```
      
      Result:
      ```text
      +----------------------+-----------------+---------------+---------+----------------------+
      |          ID          |       NAME      |    ZONE ID    | STATUS  |     DESCRIPTION      |
      +----------------------+-----------------+---------------+---------+----------------------+
      | fhm0b28lgfp4******** | first-instance  | ru-central1-a | RUNNING | my first vm via CLI  |
      | fhm9gk85nj7g******** | second-instance | ru-central1-a | RUNNING | my second vm via CLI |
      +----------------------+-----------------+---------------+---------+----------------------+
      ```

  1. Select `ID` or `NAME` of the VM, e.g., `first-instance`.
  1. Stop the VM:

      ```bash
      yc compute instance stop first-instance
      ```

  1. Get the current VM [configuration](../../concepts/performance-levels.md) with [metadata](../../concepts/vm-metadata.md):

      ```bash
      yc compute instance get --full first-instancegit
      ```

  1. Change the VM configuration:

      ```bash
      yc compute instance update first-instance \
        --gpus=2 \
        --cores=56 \
        --memory=238
      ```

      This command will change the number of GPUs to 2.

      The values of the `--cores` (number of vCPUs) and `--memory` (RAM size in GB) parameters depend on the platform and the number of GPUs. For more information, see the [list of available configurations](../../concepts/gpus.md#config).

  1. Start the VM:

      ```bash
      yc compute instance start first-instance
      ```

- API {#api}

  To change the number of GPUs, use the [update](../../api-ref/Instance/update.md) REST API method for the [Instance](../../api-ref/Instance/index.md) resource or the [InstanceService/Update](../../api-ref/grpc/Instance/update.md) gRPC API call.

{% endlist %}

## Enabling a software-accelerated network {#enable-software-accelerated-network}

{% note warning %}

This feature is only available upon agreement with your account manager.

{% endnote %}

{% list tabs group=instructions %}

- Management console {#console}

  To enable a [software-accelerated network](../../concepts/software-accelerated-network.md) on an existing VM:

  1. In the [management console](https://console.yandex.cloud), select the [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) the VM belongs to.
  1. Navigate to **Compute Cloud**.
  1. Click the VM name.
  1. Click **Stop** in the top-right corner of the page.
  1. In the window that opens, click **Stop**.
  1. Wait until the VM status changes to `Stopped`, then click ![image](../../../_assets/console-icons/pencil.svg) **Edit VM** in the top-right corner of the page.
  1. Under **Computing resources**, open the **Custom** tab and enable **Software network acceleration**.
  1. Click **Save changes**.
  1. Click **Start** in the top-right corner of the page.
  1. In the window that opens, click **Start**.

{% endlist %}