Version 1.16. This version is no longer supported. For information about how to upgrade to version 1.28, see Upgrade clusters in the latest documentation. For more information about supported and unsupported versions, see the Versioning page in the latest documentation.
This document is intended for application owners that run Google Distributed Cloud.
This document shows you how to manage the power state of virtual machines (VMs)
that use VM Runtime on GDC.
You can stop, start, and restart VMs as needed to support the lifecycle of your
applications. For example, you may want to change the number of assigned vCPUs
or amount of memory. After you edit the configuration of your VM, you must
cycle the power state to apply the changes.
Before you begin
To complete this document, you need access to the following resources:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis guide provides instructions for application owners on managing the power state of virtual machines (VMs) running on Google Distributed Cloud (GDC).\u003c/p\u003e\n"],["\u003cp\u003eVMs can be stopped to free up compute resources, such as CPU and memory, and are shut down when stopped.\u003c/p\u003e\n"],["\u003cp\u003eUse the \u003ccode\u003ekubectl virt stop VM_NAME\u003c/code\u003e command to stop a VM, \u003ccode\u003ekubectl virt start VM_NAME\u003c/code\u003e to start a VM, and \u003ccode\u003ekubectl virt restart VM_NAME\u003c/code\u003e to restart a VM.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ekubectl get gvm VM_NAME\u003c/code\u003e command is used to verify the current status of a VM, which can be \u003ccode\u003eStopped\u003c/code\u003e, \u003ccode\u003eRunning\u003c/code\u003e, or \u003ccode\u003eStopping\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eCycling the power state of VMs is necessary after editing their configuration, such as changing the number of assigned vCPUs or the amount of memory.\u003c/p\u003e\n"]]],[],null,["# Manage the power state of VMs that use VM Runtime on GDC\n\n\u003cbr /\u003e\n\nThis document is intended for application owners that run Google Distributed Cloud.\nThis document shows you how to manage the power state of virtual machines (VMs)\nthat use VM Runtime on GDC.\n\nYou can stop, start, and restart VMs as needed to support the lifecycle of your\napplications. For example, you may want to change the number of assigned vCPUs\nor amount of memory. After you edit the configuration of your VM, you must\ncycle the power state to apply the changes.\n\nBefore you begin\n----------------\n\nTo complete this document, you need access to the following resources:\n\n- A VM that runs in one of your clusters. If needed, [create a VM in Distributed Cloud](/anthos/clusters/docs/bare-metal/1.16/vm-runtime/quickstart).\n- The `virtctl` client tool installed as a plugin for `kubectl`. If needed, [install the virtctl client tool](/anthos/clusters/docs/bare-metal/1.16/vm-runtime/quickstart#install_the_virtctl_client_tool).\n\nStop a VM\n---------\n\nWhen you stop a VM, compute resources such as CPU and memory are freed from the\nunderlying host. The VM is shut down.\n\nTo stop a VM that's in a running state, use the following steps.\n\n1. Use `kubectl` to stop a VM:\n\n kubectl virt stop \u003cvar label=\"name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM that you want to\n stop.\n2. Check the `STATUS` of your VM:\n\n kubectl get gvm \u003cvar label=\"name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n The following example output shows the VM in a `Stopped` state: \n\n NAME STATUS AGE IP\n vm1 Stopped 1m 192.168.2.72\n\nStart a VM\n----------\n\nTo start a VM that's in a stopped state, use the following steps.\n\n1. Use `kubectl` to start a VM:\n\n kubectl virt start \u003cvar label=\"name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM that you want\n to start.\n2. Check the `STATUS` of your VM:\n\n kubectl get gvm \u003cvar label=\"name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n The following example output shows the VM in a `Running` state: \n\n NAME STATUS AGE IP\n vm1 Running 1m 192.168.2.72\n\nRestart a VM\n------------\n\nTo restart a VM that's in a running state, use the following steps.\n\n1. Use `kubectl` to restart a VM:\n\n kubectl virt restart \u003cvar label=\"name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM that you want to\n restart.\n2. Check the `STATUS` of your VM:\n\n kubectl get gvm \u003cvar label=\"name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n The following example output shows the VM in a `Stopping` state: \n\n NAME STATUS AGE IP\n vm1 Stopping 7s 192.168.2.72\n\n3. Check the `STATUS` of your VM again after a minute or two:\n\n kubectl get gvm \u003cvar label=\"name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n After the VM has successfully restarted, the following example output shows\n the VM in a `Running` state again: \n\n NAME STATUS AGE IP\n vm1 Running 1m 192.168.2.73\n\n This example VM uses an ephemeral pod IP address, so the address changes\n when the VM restarts.\n\nWhat's next\n-----------\n\n- [Edit a VM in Distributed Cloud](/anthos/clusters/docs/bare-metal/1.16/vm-runtime/edit-vm).\n- When you no longer need VMs, [Delete a VM in Google Distributed Cloud](/anthos/clusters/docs/bare-metal/1.16/vm-runtime/delete)."]]