Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Uma instância de VM pode passar por vários estados durante o ciclo de vida. Quando
você cria uma VM, o Google Distributed Cloud (GDC) provisiona recursos
para iniciar a VM. Em seguida, a VM passa para o estado de inicialização, em que é
preparada para a primeira inicialização. Durante e após a inicialização, uma VM é considerada em execução. Durante todo o ciclo de vida, uma VM em execução pode ser interrompida e reiniciada
ou suspensa e retomada repetidamente.
Definições de status da VM
Estado
Definição
Pending
A VM foi aceita pelo sistema e está aguardando alocação.
Provisioning
Os recursos associados à VM, como
VirtualMachineDisk, estão sendo provisionados e preparados.
Starting
A VM está sendo preparada para execução.
Running
A VM está em execução.
Stopping
A VM está em processo de interrupção.
Stopped
A VM está parada e não deve ser iniciada.
Paused
A VM é pausada e fica em um estado congelado, que é preservado. Não é possível acessar a VM.
Terminating
A VM e os recursos associados estão passando pelo processo de exclusão.
ErrorConfiguration
A VM tem um erro de configuração. Os estados de configuração inválidos podem ser causados pelo seguinte:
MachineTypeNotFound: o tipo de VM a que a VM se refere não foi encontrado ou está sendo excluído.
MachineDiskMisconfig - O disco da VM está configurado incorretamente.
InterfaceCreationFailed: falha na criação da interface de rede.
CrashLoopBackOff
A VM está em um loop de falha e aguardando uma nova tentativa.
PendingIPAllocation
A VM está aguardando o sistema atribuir um endereço IP a ela.
Unknown
Não foi possível receber o estado da VM, geralmente devido a um erro na
comunicação com o host em que ela está sendo executada.
ErrorUnschedulable
Ocorreu um erro ao programar a VM, por exemplo, devido a solicitações de recursos ou restrições de programação que não podem ser atendidas ou aceitas.
DiskError
A VM tem um erro em um ou mais dos discos anexados.
WaitingForDisk
A VM está aguardando que um ou mais dos VirtualMachineDisk anexados fiquem prontos.
CrashLoopBackoff
A VM está falhando constantemente por algum motivo.
Antes de começar
Para usar os comandos da interface de linha de comando (CLI) gdcloud, verifique se você baixou, instalou
e configurou a CLI gdcloud.
Todos os comandos do Distributed Cloud usam a CLI gdcloud ou kubectl e exigem um ambiente de sistema operacional (SO).
Extrair o caminho do arquivo kubeconfig
Para executar comandos no servidor da API Management, verifique se você tem os seguintes
recursos:
Faça login e gere o arquivo
kubeconfig para o servidor da API Management se você não tiver um.
Use o caminho para o arquivo kubeconfig do servidor da API Management para substituir
MANAGEMENT_API_SERVER nestas instruções.
Solicitar permissões e acesso
Para executar as tarefas listadas nesta página, você precisa ter o papel de administrador de máquina virtual do projeto. Siga as etapas para
verificar
se você tem o papel de administrador de máquina virtual do projeto (project-vm-admin) no namespace
do projeto em que a VM reside.
Para operações de VM usando o console do GDC ou a CLI gdcloud,
peça ao administrador do IAM do projeto para atribuir a você os papéis de
administrador de máquina virtual do projeto e leitor do projeto (project-viewer).
Verificar o status da VM
Cada VM informa seu status como parte das propriedades da VM. Verifique o status de uma VM por qualquer um dos seguintes motivos:
Se houver problemas com a VM.
Para confirmar se a VM está em execução depois de iniciada.
Para verificar se a VM está no estado Paused ou Stopped.
Listar VMs para verificar o status
O procedimento a seguir mostra como listar VMs, conferir o status delas e receber
informações adicionais sobre o status.
Liste todas as VMs e confira o status de cada uma:
MANAGEMENT_API_SERVER com o arquivo kubeconfig do
servidor da API Management que você recebeu do comando gdcloud auth login.
VM_NAME pelo nome da nova VM.
PROJECT com o projeto do GDC
em que a VM reside.
Exemplo de saída mostrando valores Reason e Message:
State: ErrorConfiguration
Reason: MachineDiskNotFound
Message: VirtualMachineDisk disk-1 in namespace project-1 does not exist.
Você também pode receber campos vazios para Reason e Message. Isso indica que não havia nada para o sistema informar sobre elas.
Exemplo de saída com Reason e Message vazios:
State: Running
Reason:
Message:
Interromper ou reiniciar uma VM
Durante o ciclo de vida da VM, talvez seja necessário interromper e reiniciar uma VM
ou excluir uma VM para responder a uma mudança de status ou gerenciar a VM de maneira geral. Consulte
estas páginas para interromper, redefinir ou excluir uma VM:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 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)"]]