[Yandex Cloud documentation](../../../index.md) > [Yandex Compute Cloud](../../index.md) > [Step-by-step guides](../index.md) > Managing a VM > Stopping and starting a VM

# Stopping, starting, or restarting a VM

## Stopping {#stop}

The **Stop** command shuts down a VM. Once a VM is shut down, its status changes to `Stopped`. While the VM is stopped, you will not be charged for it. Disk usage is [billed](../../pricing.md#disk) separately, regardless of the VM's state.

You can restart a VM at any time to continue using it. All your data and changes will be saved.

Certain VM parameters can only be modified when the VM is stopped.

To stop a VM:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder this VM belongs to.
  1. Navigate to **Compute Cloud**.
  1. To stop a single VM, select the VM, click ![image](../../../_assets/console-icons/ellipsis.svg), and select **Stop**.
  1. In the window that opens, click **Stop**.

  To stop multiple VMs, select the VMs from the list, click **Stop** at the bottom of the screen, and then, in the window that opens, click **Stop**.

- 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 stopping a VM:

     ```bash
     yc compute instance stop --help
     ```

  1. Get a list of all 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
     ```

- API {#api}

  Use the [stop](../../api-ref/Instance/stop.md) REST API method for the [Instance](../../api-ref/Instance/index.md) resource or the [InstanceService/Stop](../../api-ref/grpc/Instance/stop.md) gRPC API call.

{% endlist %}

When a VM stops, the hypervisor sends a shutdown signal to the VM operating system. The OS has 30 seconds to gracefully terminate all running processes to avoid data loss. After this time elapses, the VM will be forcibly terminated.

## Starting {#start}

The **Start** command starts a previously stopped VM. Once the VM is started, its status changes to `Running`, and the operating system starts loading. From this point on, you start paying for using the VM.

To start a VM:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder this VM belongs to.
  1. Navigate to **Compute Cloud**.
  1. To start a single VM, select the VM, click ![image](../../../_assets/console-icons/ellipsis.svg), and select **Start**.
  1. In the window that opens, click **Start**.

  To start multiple VMs, select the VMs from the list, click **Start** at the bottom of the screen, and then, 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 starting a VM:

     ```bash
     yc compute instance start --help
     ```

  1. Get a list of all 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. Run the VM:

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

- API {#api}

  Use the [start](../../api-ref/Instance/start.md) REST API method for the [Instance](../../api-ref/Instance/index.md) resource or the [InstanceService/Start](../../api-ref/grpc/Instance/start.md) gRPC API call.

{% endlist %}

## Restarting {#restart}

The **Restart** command restarts a VM.

To restart a VM:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder this VM belongs to.
  1. Navigate to **Compute Cloud**.
  1. To restart a single VM, select the VM, click ![image](../../../_assets/console-icons/ellipsis.svg), and select **Restart**.
  1. In the window that opens, click **Restart**.

  To restart multiple VMs, select the VMs from the list, click **Restart** at the bottom of the screen, and then, in the window that opens, click **Restart**.

- 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 restarting a VM:

     ```bash
     yc compute instance restart --help
     ```

  1. Get a list of all 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. Restart the VM:

     ```bash
     yc compute instance restart first-instance
     ```

- API {#api}

  Use the [restart](../../api-ref/Instance/restart.md) REST API method for the [Instance](../../api-ref/Instance/index.md) resource or the [InstanceService/Restart](../../api-ref/grpc/Instance/restart.md) gRPC API call.

{% endlist %}