Version 1.13. This version is no longer supported. For information about how to upgrade to version 1.14, see Upgrading Anthos on bare metal in the 1.14 documentation. For more information about supported and unsupported versions, see the Version history 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 Google Distributed Cloud.
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.\u003c/p\u003e\n"],["\u003cp\u003eYou can stop a VM to free up compute resources like CPU and memory, and then check its status with \u003ccode\u003ekubectl get gvm <VM_NAME>\u003c/code\u003e, confirming it is in a \u003ccode\u003eStopped\u003c/code\u003e state.\u003c/p\u003e\n"],["\u003cp\u003eTo start a stopped VM, you can utilize \u003ccode\u003ekubectl virt start <VM_NAME>\u003c/code\u003e and use \u003ccode\u003ekubectl get gvm <VM_NAME>\u003c/code\u003e to confirm that it's in the \u003ccode\u003eRunning\u003c/code\u003e state.\u003c/p\u003e\n"],["\u003cp\u003eTo restart a running VM, you can use \u003ccode\u003ekubectl virt restart <VM_NAME>\u003c/code\u003e, and confirm the restart using \u003ccode\u003ekubectl get gvm <VM_NAME>\u003c/code\u003e and seeing the \u003ccode\u003eRunning\u003c/code\u003e status.\u003c/p\u003e\n"],["\u003cp\u003ePower cycling VMs is necessary after editing their configuration, such as changing the number of vCPUs or the amount of memory.\u003c/p\u003e\n"]]],[],null,["# Manage the power state of VMs that use VM Runtime on Google Distributed Cloud\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 Google Distributed Cloud.\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 Google Distributed Cloud](/anthos/clusters/docs/bare-metal/1.13/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.13/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 Google Distributed Cloud](/anthos/clusters/docs/bare-metal/1.13/vm-runtime/edit-vm).\n- When you no longer need VMs, [Delete a VM in Google Distributed Cloud](/anthos/clusters/docs/bare-metal/1.13/vm-runtime/delete)."]]