Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questo documento spiega il ciclo di vita di un'istanza Compute Engine, illustrando i vari stati che può attraversare dalla creazione all'eliminazione. Per scoprire come controllare lo stato di una o più istanze, consulta quanto segue:
Comprendendo il ciclo di vita di un'istanza, puoi eseguire più efficacemente le seguenti operazioni:
Risolvere i problemi relativi alle istanze.
Gestire le risorse delle istanze.
Pianificare le migrazioni delle istanze.
Stati delle istanze
Un'istanza di computing può passare da uno stato all'altro nel corso del suo ciclo di vita. Quando crei un'istanza, Compute Engine esegue il provisioning delle risorse per avviarla, dopodiché l'istanza passa alla gestione temporanea e si prepara al primo avvio. Una volta avviata, l'istanza è considerata in esecuzione. Un'istanza in esecuzione può essere interrotta e riavviata ripetutamente o sospesa e ripresa fino alla sua eliminazione.
Il seguente diagramma mostra i diversi stati in cui Compute Engine può impostare un'istanza:
Gli stati mostrati nel diagramma precedente sono i seguenti:
PROVISIONING: nella prima fase di un'istanza, Compute Engine alloca le risorse per l'istanza.
STAGING: Compute Engine sta preparando l'istanza per il primo avvio per uno dei seguenti motivi:
Compute Engine sta ancora creando e configurando l'istanza.
Tu o un'operazione pianificata avete richiesto di riavviare o riprendere l'istanza.
In questo stato, l'istanza non è ancora in esecuzione.
RUNNING: Compute Engine sta avviando l'istanza o l'istanza è in esecuzione. In questo stato, puoi arrestare, sospendere o eliminare l'istanza. Inoltre, Compute Engine può arrestare o eliminare l'istanza per le azioni pianificate oppure ripararla se l'istanza fa parte di un gruppo di istanze gestite (MIG) e si verifica un errore hardware.
PENDING_STOP: l'istanza è in fase di arresto normale. Questo processo avviene solo se hai attivato l'arresto normale e hai richiesto di arrestare o eliminare l'istanza, oppure se Compute Engine lo fa automaticamente per un arresto o un'eliminazione pianificati. Lo stato dell'istanza diventa STOPPING quando si verifica una delle seguenti condizioni:
Interrompi manualmente l'arresto normale.
Il periodo di arresto normale raggiunge il timeout. Se ci sono ancora attività in esecuzione, Compute Engine ne forza l'interruzione.
STOPPING: l'istanza sta arrestando il sistema operativo guest, il che si verifica nei seguenti scenari:
Tu o un'operazione pianificata avete richiesto di arrestare o eliminare l'istanza.
Si è verificato un errore hardware.
Il tempo di arresto dipende dal tipo di istanza; tuttavia, se l'istanza si arresta a causa di un errore hardware, il tempo di arresto potrebbe variare. Dopo che Compute Engine ha arrestato il sistema operativo guest, imposta lo stato dell'istanza su TERMINATED e completa l'operazione di arresto o elimina l'istanza e tutte le risorse collegate.
TERMINATED: Compute Engine ha completato l'operazione di arresto.
Le risorse collegate rimangono collegate, a meno che tu non le scolleghi. In questo stato, l'istanza rimane in stato di arresto finché non la riavvii o la elimini.
REPAIRING: Compute Engine sta riparando l'istanza.
Compute Engine ripara un'istanza se rileva un errore interno o se il server host dell'istanza non è disponibile a causa di operazioni di manutenzione. Mentre viene riparata un'istanza, si verifica quanto segue:
Se Compute Engine ripara l'istanza, la riporta allo stato che aveva prima dell'inizio dell'operazione di riparazione.
Questo stato può essere STAGING, RUNNING, SUSPENDING o STOPPING.
SUSPENDING: Compute Engine ha avviato l'operazione di sospensione dell'istanza dopo che hai richiesto di sospenderla. In questo stato, puoi solo attendere il completamento dell'operazione di sospensione.
SUSPENDED: Compute Engine ha completato l'operazione di sospensione.
In questo stato, puoi ripristinare o eliminare l'istanza. Se un'istanza rimane nello stato SUSPENDED per più di 60 giorni, Compute Engine la interrompe e ne modifica lo stato in TERMINATED.
Guasto hardware
In rari casi, un'istanza di computing potrebbe non riuscire a causa di un'interruzione imprevista, di un errore hardware o di un altro problema di sistema. Google consiglia di ridurre al minimo i guasti hardware utilizzando volumi di archiviazione permanente, eseguendo regolarmente il backup dei dati e progettando il sistema in modo che un singolo guasto dell'istanza non sia catastrofico. Per saperne di più, scopri come progettare sistemi solidi.
Se un'istanza non riesce, Compute Engine la riavvia automaticamente utilizzando gli stessi metadati, le stesse impostazioni dell'istanza e lo stesso disco di avvio. Per modificare il comportamento di riavvio automatico di un'istanza, consulta Imposta la policy di manutenzione dell'host VM.
Prezzi
Le istanze di computing ti vengono addebitate nel modo seguente:
L'utilizzo della CPU ti viene addebitato quando l'istanza è nei seguenti stati:
RUNNING
PENDING_STOP
La memoria utilizzata ti viene addebitata quando l'istanza è nei seguenti stati:
RUNNING
PENDING_STOP
SUSPENDING
SUSPENDED
Per le risorse collegate, come i dischi o gli indirizzi IP esterni, ti vengono addebitati costi fino a quando le risorse esistono, indipendentemente dallo stato dell'istanza.
[[["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-08-04 UTC."],[[["\u003cp\u003eCompute Engine instances transition through various states, including \u003ccode\u003ePROVISIONING\u003c/code\u003e, \u003ccode\u003eSTAGING\u003c/code\u003e, \u003ccode\u003eRUNNING\u003c/code\u003e, \u003ccode\u003ePENDING_STOP\u003c/code\u003e, \u003ccode\u003eSTOPPING\u003c/code\u003e, \u003ccode\u003eTERMINATED\u003c/code\u003e, \u003ccode\u003eREPAIRING\u003c/code\u003e, \u003ccode\u003eSUSPENDING\u003c/code\u003e, and \u003ccode\u003eSUSPENDED\u003c/code\u003e, each representing a different stage in the instance lifecycle.\u003c/p\u003e\n"],["\u003cp\u003eUnderstanding the lifecycle states of a Compute Engine instance is crucial for effective troubleshooting, managing resources, and planning instance migrations.\u003c/p\u003e\n"],["\u003cp\u003eInstances in \u003ccode\u003eRUNNING\u003c/code\u003e and \u003ccode\u003ePENDING_STOP\u003c/code\u003e states incur charges for CPU and memory usage, while memory charges also apply during \u003ccode\u003eSUSPENDING\u003c/code\u003e and \u003ccode\u003eSUSPENDED\u003c/code\u003e states, and resources like disks and IP addresses are charged regardless of the instance's current state.\u003c/p\u003e\n"],["\u003cp\u003eCompute Engine automatically restarts failed instances, but this behavior can be modified through the VM host maintenance policy settings.\u003c/p\u003e\n"],["\u003cp\u003eThe shutdown process of an instance may be graceful, provided that the user enabled graceful shutdown, otherwise the instance will be forced to shut down upon request.\u003c/p\u003e\n"]]],[],null,["*** ** * ** ***\n\nThis document explains the lifecycle of a Compute Engine instance, covering\nthe various states it can go through from creation to deletion. To learn how\nto check the state of one or more instances, see the following:\n\n- [View a list of instances](/compute/docs/instances/get-list)\n\n- [View the details of a single instance](/compute/docs/instances/view-vm-details)\n\nBy understanding the lifecycle of an instance, you can do the following more\neffectively:\n\n- Troubleshoot instance issues.\n\n- Manage instance resources.\n\n- Plan instance migrations.\n\nInstance states\n\nA compute instance can transition through different states as part of its\nlifecycle. When creating an instance, Compute Engine provisions\nresources to start it, after which the instance moves into staging and prepares\nfor first boot. After the instance starts, it's considered running. A running\ninstance can be repeatedly stopped and restarted, or suspended and resumed,\nuntil its deletion.\n\nThe following diagram shows the different states that Compute Engine can\nset an instance to:\n\nThe states shown in the preceding diagram are as follows:\n\n- **`PROVISIONING`**: in the first stage of an instance,\n Compute Engine allocates resources for the instance.\n\n- **`STAGING`**: Compute Engine is preparing the instance for first\n boot due to one of the following reasons:\n\n - Compute Engine is still creating and configuring the instance.\n\n - You, or a scheduled operation, have requested to restart or resume the\n instance.\n\n In this state, the instance isn't running yet.\n- **`RUNNING`**: Compute Engine is booting up the instance, or the\n instance is running. In this state, you can stop, suspend, or delete the\n instance. Additionally, Compute Engine can stop or delete the\n instance for scheduled actions, or repair it if the instance is part of\n a managed instance group (MIG) and a hardware error occurs.\n\n- **`PENDING_STOP`** : the instance is gracefully shutting down. This shutdown\n process happens only if you've enabled\n [graceful shutdown](/compute/docs/instances/graceful-shutdown-overview) and\n you've requested to stop or delete the instance, or Compute Engine\n is doing so automatically for a scheduled stop or deletion. The instance\n state changes to `STOPPING` when one of the following happens:\n\n - You manually end the graceful shutdown.\n\n - The graceful shutdown period times out. If any tasks are still running,\n then Compute Engine forcefully stops them.\n\n- **`STOPPING`**: the instance is shutting down its guest OS, which happens in\n the following scenarios:\n\n - You, or a scheduled operation, have requested to stop or delete the\n instance.\n\n - A hardware error occurred.\n\n The shutdown time depends on the\n [instance type](/compute/docs/instances/suspend-stop-reset-instances-overview#stopping-instance);\n however, if the instance is stopping due to a hardware error, the shutdown\n time might vary. After Compute Engine shuts down the guest OS, it\n sets the instance state to `TERMINATED`, and then either completes the stop\n operation or deletes the instance and all attached resources.\n- **`TERMINATED`**: Compute Engine has completed the stop operation.\n The attached resources remain attached unless you detach them. In this\n state, the instance remains stopped until you restart or delete it.\n\n- **`REPAIRING`**: Compute Engine is repairing the instance.\n Compute Engine repairs an instance if it encounters an internal\n error or the instance's host server is unavailable due to maintenance. While\n an instance is in repair, the following happens:\n\n - You can't use it.\n\n - The [service level agreement (SLA)](/compute/sla) doesn't cover it.\n\n If Compute Engine successfully repairs the instance, then it returns\n the instance state to its original state before the repair operation began.\n This state can be `STAGING`, `RUNNING`, `SUSPENDING`, or `STOPPING`.\n- **`SUSPENDING`**: Compute Engine has started the suspend operation\n of the instance after you've requested to suspend it. In this state, you can\n only wait for the suspend operation to complete.\n\n- **`SUSPENDED`** : Compute Engine has completed the suspend operation.\n In this state, you can resume or delete the instance. If an instance remains\n in the `SUSPENDED` state for more than 60 days, then Compute Engine\n stops the instance and transitions its state to `TERMINATED`.\n\nHardware failure\n\nRarely, a compute instance might fail due to an unexpected outage, hardware\nerror, or another system issue. Google recommends mitigating hardware failures\nby using persistent storage volumes, routinely backing up your data, and\ndesigning your system so that a single instance failure isn't catastrophic. For\nmore information, see how to\n[design robust systems](/compute/docs/robustsystems).\n\nIf an instance fails, then Compute Engine automatically restarts the\ninstance using the same boot disk, metadata, and instance settings. To modify\nthe automatic restart behavior of an instance, see\n[Set VM host maintenance policy](/compute/docs/instances/setting-instance-scheduling-options).\n\nPricing\n\nYou're charged for a compute instance as follows:\n\n- For CPU usage, you're charged when the instance is in the following states:\n\n - `RUNNING`\n\n - `PENDING_STOP`\n\n- For memory usage, you're charged when the instance is in the following\n states:\n\n - `RUNNING`\n\n - `PENDING_STOP`\n\n - `SUSPENDING`\n\n - `SUSPENDED`\n\n- For attached resources like disks or external IP addresses, you're charged\n until the resources exist, regardless of the instance state.\n\nFor more information, see [VM instance pricing](/compute/vm-instance-pricing).\n\nWhat's next\n\n- Learn how to view the state of one or more compute instances:\n\n - [Get a list of VMs](/compute/docs/instances/get-list)\n\n - [View the details of a VM](/compute/docs/instances/view-vm-details)\n\n- Learn more about\n [suspending, stopping, or resetting instances](/compute/docs/instances/suspend-stop-reset-instances-overview).\n\n- Learn more about\n [live migration during maintenance events](/compute/docs/instances/live-migration).\n\n- Learn how to\n [delete an instance](/compute/docs/instances/deleting-instance)."]]