Administra el estado de energía de las VMs que usan el entorno de ejecución de VM en GDC
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Este documento está dirigido a los propietarios de aplicaciones que ejecutan Google Distributed Cloud.
En este documento, se muestra cómo administrar el estado de energía de las máquinas virtuales (VM) que usan el entorno de ejecución de VMs en GDC.
Puedes detener, iniciar y reiniciar las VM según sea necesario para admitir el ciclo de vida de tus aplicaciones. Por ejemplo, es posible que desees cambiar la cantidad de CPU virtuales o de memoria asignadas. Después de editar la configuración de tu VM, debes alternar el estado de energía para aplicar los cambios.
Antes de comenzar
Para completar este documento, necesitas acceso a los siguientes recursos:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[],[],null,["This 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\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](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/quickstart).\n- The `virtctl` client tool installed as a plugin for `kubectl`. If needed, [install the virtctl client tool](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/quickstart#install_the_virtctl_client_tool).\n\nStop a VM\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\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\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- [Edit a VM in Google Distributed Cloud](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/edit-vm).\n- When you no longer need VMs, [Delete a VM in Google Distributed Cloud](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/delete)."]]