Stopping, starting, or restarting a VM
Stopping
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 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:
- In the management console
, select the folder the VM belongs to. - Select Compute Cloud.
- To stop a single VM, select the VM, click
, and select Stop. - 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.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder through the --folder-name
or --folder-id
parameter.
-
See the description of the CLI command for stopping a VM:
yc compute instance stop --help
-
Get a list of all VMs in the default folder:
yc compute instance list
Result:
+----------------------+-----------------+---------------+---------+----------------------+ | 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 | +----------------------+-----------------+---------------+---------+----------------------+
-
Select
ID
orNAME
of the VM, e.g.,first-instance
. -
Stop the VM:
yc compute instance stop first-instance
Use the stop REST API method for the Instance resource or the InstanceService/Stop gRPC API call.
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
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 will be charged for using the VM.
To start a VM:
- In the management console
, select the folder the VM belongs to. - Select Compute Cloud.
- To start a single VM, select the VM, click
, and select Start. - 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.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder through the --folder-name
or --folder-id
parameter.
-
See the description of the CLI command for starting a VM:
yc compute instance start --help
-
Get a list of all VMs in the default folder:
yc compute instance list
Result:
+----------------------+-----------------+---------------+---------+----------------------+ | 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 | +----------------------+-----------------+---------------+---------+----------------------+
-
Select
ID
orNAME
of the VM, e.g.,first-instance
. -
Run the VM:
yc compute instance start first-instance
Use the start REST API method for the Instance resource or the InstanceService/Start gRPC API call.
Restarting
The Restart command restarts a VM.
To restart a VM:
- In the management console
, select the folder the VM belongs to. - Select Compute Cloud.
- To restart a single VM, select the VM, click
, and select Restart. - 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.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder through the --folder-name
or --folder-id
parameter.
-
See the description of the CLI command for restarting a VM:
yc compute instance restart --help
-
Get a list of all VMs in the default folder:
yc compute instance list
Result:
+----------------------+-----------------+---------------+---------+----------------------+ | 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 | +----------------------+-----------------+---------------+---------+----------------------+
-
Select
ID
orNAME
of the VM, e.g.,first-instance
. -
Restart the VM:
yc compute instance restart first-instance
Use the restart REST API method for the Instance resource or the InstanceService/Restart gRPC API call.