Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Ce document explique le cycle de vie d'une instance Compute Engine, en abordant les différents états qu'elle peut traverser, de sa création à sa suppression. Pour savoir comment vérifier l'état d'une ou de plusieurs instances, consultez les ressources suivantes :
En comprenant le cycle de vie d'une instance, vous pouvez effectuer les opérations suivantes plus efficacement :
Résolvez les problèmes liés aux instances.
Gérez les ressources d'instance.
Planifiez les migrations d'instances.
États des instances
Une instance de calcul peut passer par différents états au cours de son cycle de vie. Lorsque vous créez une instance, Compute Engine provisionne des ressources pour la démarrer. L'instance passe ensuite en phase de préproduction et se prépare pour son premier démarrage. Une fois l'instance démarrée, elle est considérée comme en cours d'exécution. Une instance en cours d'exécution peut être arrêtée et redémarrée, ou suspendue et reprise, plusieurs fois jusqu'à sa suppression.
Le schéma suivant présente les différents états dans lesquels Compute Engine peut définir une instance :
Les états illustrés dans le schéma précédent sont les suivants :
PROVISIONING : lors de la première phase d'une instance, Compute Engine alloue des ressources à l'instance.
STAGING : Compute Engine prépare l'instance pour le premier démarrage pour l'une des raisons suivantes :
Compute Engine est toujours en train de créer et de configurer l'instance.
Vous ou une opération planifiée avez demandé à redémarrer ou à réactiver l'instance.
Dans cet état, l'instance n'est pas encore en cours d'exécution.
RUNNING : Compute Engine est en train de démarrer l'instance ou celle-ci est en cours d'exécution. Dans cet état, vous pouvez arrêter, suspendre ou supprimer l'instance. De plus, Compute Engine peut arrêter ou supprimer l'instance pour des actions planifiées, ou la réparer si elle fait partie d'un groupe d'instances géré (MIG) et qu'une erreur matérielle se produit.
PENDING_STOP : l'instance est en cours d'arrêt progressif. Ce processus d'arrêt ne se produit que si vous avez activé l'arrêt progressif et que vous avez demandé à arrêter ou supprimer l'instance, ou si Compute Engine le fait automatiquement pour un arrêt ou une suppression planifiés. L'état de l'instance passe à STOPPING lorsque l'un des événements suivants se produit :
Vous mettez fin manuellement à l'arrêt progressif.
Le délai d'arrêt progressif expire. Si des tâches sont toujours en cours d'exécution, Compute Engine les arrête de force.
STOPPING : l'instance arrête son système d'exploitation invité, ce qui se produit dans les scénarios suivants :
Vous ou une opération planifiée avez demandé à arrêter ou supprimer l'instance.
Une erreur matérielle s'est produite.
Le temps d'arrêt dépend du type d'instance. Toutefois, si l'instance s'arrête en raison d'une erreur matérielle, le temps d'arrêt peut varier. Une fois que Compute Engine a arrêté l'OS invité, il définit l'état de l'instance sur TERMINATED, puis termine l'opération d'arrêt ou supprime l'instance et toutes les ressources associées.
TERMINATED : Compute Engine a terminé l'opération d'arrêt.
Les ressources associées le restent, sauf si vous les dissociez. Dans cet état, l'instance reste arrêtée jusqu'à ce que vous la redémarriez ou la supprimiez.
REPAIRING : Compute Engine répare l'instance.
Compute Engine répare une instance si elle rencontre une erreur interne ou si le serveur hôte de l'instance est indisponible pour cause de maintenance. Lorsqu'une instance est en cours de réparation, les opérations suivantes sont effectuées :
Si Compute Engine parvient à réparer l'instance, il rétablit son état d'origine avant le début de l'opération de réparation.
Cet état peut être STAGING, RUNNING, SUSPENDING ou STOPPING.
SUSPENDING : Compute Engine a commencé l'opération de suspension de l'instance après que vous avez demandé à la suspendre. Dans cet état, vous ne pouvez qu'attendre la fin de l'opération de suspension.
SUSPENDED : Compute Engine a terminé l'opération de suspension.
Dans cet état, vous pouvez réactiver ou supprimer l'instance. Si une instance reste à l'état SUSPENDED pendant plus de 60 jours, Compute Engine l'arrête et la fait passer à l'état TERMINATED.
Défaillance matérielle
Rarement, une instance de calcul peut échouer en raison d'une panne inattendue, d'une erreur matérielle ou d'un autre problème système. Google vous recommande d'atténuer les défaillances matérielles en utilisant des volumes de stockage persistant, en sauvegardant régulièrement vos données et en concevant votre système pour qu'une défaillance d'instance unique ne soit pas catastrophique. Pour en savoir plus, consultez Concevoir des systèmes robustes.
Si une instance échoue, Compute Engine la redémarre automatiquement en utilisant le même disque de démarrage, les mêmes métadonnées et les mêmes paramètres d'instance. Pour modifier le comportement de redémarrage automatique d'une instance, consultez Définir la stratégie de maintenance de l'hôte d'une VM.
Tarifs
Voici comment les instances de calcul vous sont facturées :
Pour l'utilisation du processeur, vous êtes facturé lorsque l'instance se trouve dans les états suivants :
RUNNING
PENDING_STOP
Pour l'utilisation de la mémoire, vous êtes facturé lorsque l'instance se trouve dans les états suivants :
RUNNING
PENDING_STOP
SUSPENDING
SUSPENDED
Pour les ressources associées, comme les disques ou les adresses IP externes, vous êtes facturé tant qu'elles existent, quel que soit l'état de l'instance.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/08/19 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/08/19 (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,["# Compute Engine instance lifecycle\n\n*** ** * ** ***\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---------------\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----------------\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-------\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\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)."]]