Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Una instancia de VM puede pasar por muchos estados a lo largo de su ciclo de vida. Cuando creas una VM, Google Distributed Cloud (GDC) air-gapped aprovisiona recursos para iniciar la VM. Luego, la VM pasa al estado de inicio, en el que se la prepara para el primer inicio. Durante y después del inicio, una VM se considera en ejecución. Durante su vida útil, una VM en ejecución se puede detener y reiniciar o suspender y reanudar varias veces.
Definiciones de los estados de VM
Estado
Definición
Pending
El sistema acepta la VM y espera la asignación.
Provisioning
Se están aprovisionando y preparando los recursos asociados a la VM, como VirtualMachineDisk.
Starting
Se está preparando la VM para que se ejecute.
Running
La VM se está ejecutando.
Stopping
La VM está en proceso de detención.
Stopped
La VM está detenida y no se espera que se inicie.
Paused
La VM se pausa y se encuentra en un estado inactivo, que se conserva. No se puede acceder a la VM.
Terminating
La VM y sus recursos asociados están en proceso de eliminación.
ErrorConfiguration
La VM tiene un error de configuración. Los estados de configuración no válidos pueden deberse a los siguientes motivos:
MachineTypeNotFound: No se encontró el tipo de VM al que se refiere la VM o se está borrando.
MachineDiskMisconfig: El disco de la VM está configurado de forma incorrecta.
InterfaceCreationFailed: No se pudo crear la interfaz de red.
CrashLoopBackOff
La VM está en un bucle de fallas y espera que se vuelva a intentar.
PendingIPAllocation
La VM está esperando que el sistema le asigne una dirección IP.
Unknown
No se pudo obtener el estado de la VM, generalmente debido a un error en la comunicación con el host en el que se ejecuta.
ErrorUnschedulable
Se produjo un error durante la programación de la VM, por ejemplo, debido a solicitudes de recursos o restricciones de programación que no se pueden satisfacer o admitir.
DiskError
La VM tiene un error con uno o más de los discos conectados.
WaitingForDisk
La VM está esperando a que uno o más de los VirtualMachineDisk adjuntos estén listos.
CrashLoopBackoff
La VM falla constantemente por algún motivo.
Antes de comenzar
Para usar los comandos de la interfaz de línea de comandos (CLI) de gdcloud, asegúrate de haber descargado, instalado y configurado la CLI de gdcloud.
Todos los comandos de Distributed Cloud usan la CLI de gdcloud o kubectl y requieren un entorno de sistema operativo (SO).
Obtén la ruta de acceso del archivo kubeconfig
Para ejecutar comandos en el servidor de la API de Management, asegúrate de tener los siguientes recursos:
Accede y genera el archivo kubeconfig para el servidor de la API de Management si no tienes uno.
Usa la ruta de acceso al archivo kubeconfig del servidor de la API de administración para reemplazar MANAGEMENT_API_SERVER en estas instrucciones.
Solicita permisos y acceso
Para realizar las tareas que se indican en esta página, debes tener el rol de administrador de la VM del proyecto. Sigue los pasos para verificar que tienes el rol de administrador de máquinas virtuales del proyecto (project-vm-admin) en el espacio de nombres del proyecto en el que reside la VM.
Para las operaciones de VM con la consola de GDC o la CLI de gdcloud, solicita a tu administrador de IAM del proyecto que te asigne el rol de administrador de máquinas virtuales del proyecto y el rol de visualizador del proyecto (project-viewer).
Verifica el estado de la VM
El estado de cada VM se puede ver en sus propiedades. Verifica el estado de una VM por cualquiera de los siguientes motivos:
Si hay problemas con la VM
Confirmar que la VM se está ejecutando después de que se inició
Verificar que la VM esté en el estado Paused o Stopped
Enumera las VMs para verificar el estado
En el siguiente procedimiento, se muestra cómo enumerar las VMs, ver su estado y obtener información adicional sobre el estado.
Enumera todas las VMs y consulta el estado de cada una:
MANAGEMENT_API_SERVER con el archivo kubeconfig del servidor de la API de Management que obtuviste del comando gdcloud auth login
Reemplaza VM_NAME por el nombre de la VM nueva.
PROJECT con el proyecto de GDC en el que reside la VM.
Ejemplo de resultado que muestra los valores de Reason y Message:
State: ErrorConfiguration
Reason: MachineDiskNotFound
Message: VirtualMachineDisk disk-1 in namespace project-1 does not exist.
También es posible que obtengas campos vacíos para Reason y Message. Esto indica que el sistema no tenía nada que informar sobre ellos.
Ejemplo de resultado con Reason y Message vacíos:
State: Running
Reason:
Message:
Detén o reinicia una VM
Durante el ciclo de vida de la VM, es posible que debas detenerla y reiniciarla, o bien borrarla para responder a un cambio de estado o administrarla de forma general. Consulta estas páginas para detener, restablecer o borrar una VM:
[[["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)"],[[["\u003cp\u003eVM instances in Google Distributed Cloud (GDC) air-gapped environments transition through various states, including \u003ccode\u003ePending\u003c/code\u003e, \u003ccode\u003eProvisioning\u003c/code\u003e, \u003ccode\u003eStarting\u003c/code\u003e, \u003ccode\u003eRunning\u003c/code\u003e, \u003ccode\u003eStopping\u003c/code\u003e, \u003ccode\u003eStopped\u003c/code\u003e, and more, reflecting their current operational status.\u003c/p\u003e\n"],["\u003cp\u003eThe status of a VM can be checked using \u003ccode\u003ekubectl\u003c/code\u003e commands, providing details on the VM's current state, as well as the \u003ccode\u003eReason\u003c/code\u003e and \u003ccode\u003eMessage\u003c/code\u003e fields for troubleshooting configuration errors or other issues.\u003c/p\u003e\n"],["\u003cp\u003eDuring their lifecycle, VMs can be stopped, restarted, or deleted to manage their operational status or to respond to changes, allowing for proper management of resources.\u003c/p\u003e\n"],["\u003cp\u003eTo perform VM operations, users need to have both the Project VirtualMachine Admin and Project Viewer roles assigned to them by the Project IAM Admin.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egdcloud\u003c/code\u003e CLI and \u003ccode\u003ekubectl\u003c/code\u003e are the primary command-line tools used for interacting with and managing VMs, and requires a valid kubeconfig file from the Management API server.\u003c/p\u003e\n"]]],[],null,["# Manage the VM instance lifecycle\n\nA VM instance can transition through many states throughout its lifecycle. When\nyou create a VM, Google Distributed Cloud (GDC) air-gapped provisions\nresources to start the VM. Next, the VM moves into the start state, where it\nprepares for a first boot. During and after start-up, a VM is considered\nto be running. During its lifetime, a running VM can be repeatedly stopped and\nrestarted, or suspended and resumed.\n\nVM status definitions\n---------------------\n\nBefore you begin\n----------------\n\nTo use `gdcloud` command-line interface (CLI) commands, ensure that you have downloaded, installed,\nand configured the [`gdcloud` CLI](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-overview).\nAll commands for Distributed Cloud use the `gdcloud` or\n`kubectl` CLI, and require an operating system (OS) environment.\n\n### Get the kubeconfig file path\n\nTo run commands against the Management API server, ensure you have the following\nresources:\n\n1. [Sign in and generate](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/iam/sign-in#cli) the\n kubeconfig file for the Management API server if you don't have one.\n\n2. Use the path to the kubeconfig file of the Management API server to replace\n \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e in these instructions.\n\n### Request permissions and access\n\nTo perform the tasks listed in this page, you must have the Project\nVirtualMachine Admin role. Follow the steps to\n[verify](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vms/preparation#verify-user-access)\nthat you have the Project VirtualMachine Admin (`project-vm-admin`) role in the namespace\nof the project where the VM resides.\n\nFor VM operations using the GDC console or the gdcloud CLI,\nrequest your Project IAM Admin to assign you both the\nProject VirtualMachine Admin role and the Project Viewer (`project-viewer`)\nrole.\n\nCheck VM status\n---------------\n\nEvery VM reports its status as part of the VM's properties. Check a VM's status\nfor any of the following reasons:\n\n- If there are issues with the VM.\n- To confirm the VM is running after it has started.\n- To verify the VM is in the `Paused` or `Stopped` state.\n\n### List VMs to check status\n\nThe following procedure shows how to list VMs, view their status, and get\nadditional status information.\n\n1. List all VMs and view the status of each:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e \\\n get virtualmachines.virtualmachine.gdc.goog -n \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e\n\n Replace the variables in the code examples with your own values\n according to the following table.\n\n Example output: \n\n NAME STATUS AGE\n vm-1 Running 1d\n vm-2 Stopped 8d\n vm-3 ErrorConfiguration 1d\n\n2. Get additional details about a particular VM's status:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e \\\n get virtualmachines.virtualmachine.gdc.goog \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e -n \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e -o \\\n jsonpath='{\"State:\"}{.status.state}{\"\\n\"}{\"Reason:\"}{.status.reason}{\"\\n\"}{\"Message:\"}{.status.message}{\"\\n\"}'\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e with the kubeconfig file for the Management API server you obtained from the `gdcloud auth login` command.\n - \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the new VM.\n - \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e with the GDC project in which the VM resides.\n\n Example output showing `Reason` and `Message` values: \n\n State: ErrorConfiguration\n Reason: MachineDiskNotFound\n Message: VirtualMachineDisk disk-1 in namespace project-1 does not exist.\n\n You might also get empty fields for `Reason` and `Message`. This indicates\n there was nothing for the system to report regarding them.\n\n Example output with `Reason` and `Message` empty: \n\n State: Running\n Reason:\n Message:\n\nStop, or restart a VM\n---------------------\n\nDuring the VM lifecycle you might need to stop and restart a VM,\nor delete a VM to respond to a status change or generally manage the VM. See\nthese pages to stop, reset, or delete a VM:\n\n- [Stop a VM](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vms/manage-vms/operations-and-lifecycle/start-and-stop-vm#stop-a-vm)\n- [Restart a VM](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vms/manage-vms/operations-and-lifecycle/start-and-stop-vm#restart-a-vm)\n- [Delete a VM](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vms/manage-vms/operations-and-lifecycle/delete-vms)"]]