Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Un'istanza VM può passare attraverso molti stati durante il suo ciclo di vita. Quando
crei una VM, Google Distributed Cloud (GDC) con air gap esegue il provisioning
delle risorse per avviare la VM. Successivamente, la VM passa allo stato di avvio, in cui
si prepara per il primo avvio. Durante e dopo l'avvio, una VM viene considerata
in esecuzione. Durante il suo ciclo di vita, una VM in esecuzione può essere arrestata e
riavviata o sospesa e ripristinata ripetutamente.
Definizioni degli stati della VM
Stato
Definizione
Pending
La VM è accettata dal sistema ed è in attesa di allocazione.
Provisioning
Le risorse associate alla VM, ad esempio
VirtualMachineDisk, sono in fase di provisioning e preparazione.
Starting
La VM è in fase di preparazione per l'esecuzione.
Running
La VM è in esecuzione.
Stopping
La VM è in fase di arresto.
Stopped
La VM è arrestata e non è previsto che venga avviata.
Paused
La VM è in pausa e in uno stato bloccato, che viene
preservato. Non è possibile accedere alla VM.
Terminating
La VM e le risorse associate sono in fase di eliminazione.
ErrorConfiguration
La VM presenta un errore di configurazione. Gli stati di configurazione
non validi possono essere causati da quanto segue:
MachineTypeNotFound - Il tipo di VM a cui fa riferimento la VM non è stato trovato o è in fase di eliminazione.
MachineDiskMisconfig - Il disco VM non è configurato correttamente.
InterfaceCreationFailed - La creazione dell'interfaccia di rete non è riuscita.
CrashLoopBackOff
La VM si trova in un ciclo di arresto anomalo ed è in attesa di essere ritentata.
PendingIPAllocation
La VM è in attesa che il sistema le assegni un indirizzo IP.
Unknown
Non è stato possibile ottenere lo stato della VM, in genere a causa di un errore di
comunicazione con l'host su cui è in esecuzione.
ErrorUnschedulable
Si è verificato un errore durante la pianificazione della VM, ad esempio
a causa di richieste di risorse o vincoli di pianificazione che non possono essere soddisfatti
o supportati.
DiskError
Si è verificato un errore nella VM con uno o più dischi collegati.
WaitingForDisk
La VM è in attesa che uno o più VirtualMachineDisk collegati siano pronti.
CrashLoopBackoff
La VM ha subito arresti anomali costanti per qualche motivo.
Prima di iniziare
Per utilizzare i comandi dell'interfaccia a riga di comando (CLI) gdcloud, assicurati di aver scaricato, installato e configurato la CLI gdcloud.
Tutti i comandi per Distributed Cloud utilizzano la CLI gdcloud o
kubectl e richiedono un ambiente del sistema operativo.
Recupera il percorso del file kubeconfig
Per eseguire comandi sul server API Management, assicurati di disporre delle seguenti risorse:
Accedi e genera il file kubeconfig per il server API Management se non ne hai uno.
Utilizza il percorso del file kubeconfig del server API Management per sostituire
MANAGEMENT_API_SERVER in queste istruzioni.
Richiedere autorizzazioni e accesso
Per eseguire le attività elencate in questa pagina, devi disporre del ruolo Amministratore
macchina virtuale progetto. Segui i passaggi per
verificare
di disporre del ruolo Amministratore VirtualMachine progetto (project-vm-admin) nello spazio dei nomi
del progetto in cui si trova la VM.
Per le operazioni sulle VM che utilizzano la console GDC o gcloud CLI,
chiedi all'amministratore IAM del progetto di assegnarti sia il ruolo
Project VirtualMachine Admin sia il ruolo Project Viewer (project-viewer).
Controllare lo stato della VM
Ogni VM segnala il proprio stato come parte delle proprietà della VM. Controlla lo stato di una VM
per uno dei seguenti motivi:
Se ci sono problemi con la VM.
Per verificare che la VM sia in esecuzione dopo l'avvio.
Per verificare che la VM si trovi nello stato Paused o Stopped.
Elenca le VM per controllare lo stato
La procedura seguente mostra come elencare le VM, visualizzarne lo stato e ottenere
informazioni aggiuntive sullo stato.
Elenca tutte le VM e visualizza lo stato di ciascuna:
MANAGEMENT_API_SERVER con il file kubeconfig per
il server API Management che hai ottenuto dal comando gdcloud auth login.
VM_NAME con il nome della nuova VM.
PROJECT con il progetto GDC
in cui si trova la VM.
Esempio di output che mostra i valori di Reason e Message:
State: ErrorConfiguration
Reason: MachineDiskNotFound
Message: VirtualMachineDisk disk-1 in namespace project-1 does not exist.
Potresti anche trovare campi vuoti per Reason e Message. Ciò indica
che il sistema non ha nulla da segnalare in merito.
Output di esempio con Reason e Message vuoti:
State: Running
Reason:
Message:
Arresta o riavvia una VM
Durante il ciclo di vita della VM, potresti dover arrestare e riavviare una VM
o eliminarla per rispondere a una modifica dello stato o per gestirla in generale. Consulta
queste pagine per arrestare, reimpostare o eliminare una VM:
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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)"]]