VM instance lifecycle  |  Compute Engine Documentation  |  Google Cloud (2024)

This document describes the lifecycle of a single virtual machine (VM)instance, starting from its creation through its potential deletion.

A VM instance can transition through many states as part of its lifecycle. Whenyou create a VM, Compute Engine provisions resources to start the VM.Next, the VM moves into staging, where it prepares for first boot. During andafter start-up, a VM is considered running. During its lifetime, a running VMcan be repeatedly stopped and restarted or suspended and resumed.

A VM can be in one of the following states:

  • PROVISIONING: resources are allocated for the VM. The VMis not running yet.
  • STAGING: resources are acquired, and the VM is preparing for first boot.
  • RUNNING: the VM is booting up or running.
  • STOPPING: the VM is being stopped. You requested a stop, or a failureoccurred. This is a temporary status after which the VM enters theTERMINATED status.
  • REPAIRING: the VM is being repaired. Repairing occurs when the VMencounters an internal error or the underlying machine is unavailable due tomaintenance. During this time, the VM is unusable. You are not billed whena VM is in repair. VMs are not covered by theService level agreement(SLA) while they are in repair.If repair succeeds, the VM returns to one of the above states.
  • TERMINATED: the VM is stopped. You stopped the VM, or the VMencountered a failure. You canrestartordelete the VM.
  • SUSPENDING: The VM is in the process of being suspended. Yoususpended the VM.
  • SUSPENDED: The VM is in a suspended state. You canresume the VM ordelete it.

The following diagram shows the transition between each VM state:

VM instance lifecycle | Compute Engine Documentation | Google Cloud (1)

Stopping, suspending, or resetting a VM

You can stop or suspend a VM if you no longer need it but want to keep the VMfor future use. Your decision to stop or suspend a VM depends on whether youneed to preserve its guest OS memory and application state.

When you suspend or stop a VM, consider the following:

  • You pay for resources that are still attached to a suspended or stopped VM,such as static IPs and persistent disk data. For more information, see the pricing guide.
  • Ephemeral external IP addresses are released from the VM. When you restartor resume the VM, Google assigns new ephemeral external IP addresses. Ifyou depend on an ephemeral external IP address remaining the same throughrestarts,promote the ephemeral external IP addressto a static IP address.
  • Static external IP addresses are retained.

Stopping a VM

Stopping a VM causesCompute Engine to send the ACPI shutdown signal to the VM.Modern guest operating systems are configured to perform a clean shutdown beforepowering off in response to the power off signal. Compute Engine waitsa short time for the guest to finish shutting down and then transitions theVM to the TERMINATED state.

You might want to stop a VM for several reasons:

  • You no longer need the VM but want the resources that are attached to theVM—such as its internal IPs, MAC address, and persistent disk.
  • You don't need to preserve the guest OS memory, device state, or applicationstate.
  • You want to change certain properties of the VM that require you to firststop the VM.

You can restart a terminated VMwhen you need to use it again.

Suspending a VM

Suspending a VM sends anACPI S3 suspend signal to the VM's operating system. Suspending a VM isanalogous to closing the lid of your laptop or putting the VM into a suspendedstate. When you suspend a VM, it transitions to the SUSPENDED state.

You might want to suspend a VM for the following reasons:

  • You want to stop paying for the core and memory costs of running a VM andpay the comparatively cheaper cost of storage to preserve the state of yourVM instead.
  • You don't need the VM at this time but want to be able to bring itback up quickly with its OS and application state where you left it.

You can resume a suspended VMwhen you need to use it again.

Resetting a VM

Alternatively, you canreset a VMto wipe the memory contents of the VM and reset the VM to its initial state.Resetting a VM causes an immediate hard reset of the VM; the VM doesn't do agraceful shutdown of the guest OS. However, the VM retains all persistentdisk data, and none of the VM properties change. The VM remains in the RUNNINGstate through the reset.

Comparison table

The following table shows how stopping, suspending, and resetting a VM affectsthe VM and its resources:

StoppingSuspendingResetting
Billing Google does not charge for VM resources while they are in the TERMINATED state.Google charges for storing the preserve state of suspended VMs. Because the VM remains in the RUNNING state when it is resetting, Google charges for VMs according to standard VM prices.
VM state TERMINATED SUSPENDED RUNNING
Persistent disksPersistent disks are maintained, even when persistent disks are marked for auto-delete.

You are charged for a persistent disk that is associated with a stopped VM, just like you are charged for a persistent disk that is not associated with a VM.

Persistent disks are maintained, even when persistent disks are marked for auto-delete.

You are charged for a persistent disk that is associated with a stopped VM, just like you are charged for a persistent disk that is not associated with a VM.

Persistent disks are maintained, even when persistent disks are marked for auto-delete.

You are charged for persistent disks as long as the VM remains in a RUNNING state.

RAM and VM stateReset to power-on state, no data is saved.Guest OS and application state is preserved and restored when the VM is resumed.
You are charged a specific rate for storing preserved data. For more information, see Billing for suspended instances.
Reset to power-on state, no data is saved.
GPUsGPUs are not charged when a VM is stopped.

A GPU that is attached to a TERMINATED VM doesn't count against your project quota.

Not supported.

If a GPU is attached to a VM, you cannot suspend the VM.

You are charged standard GPU prices.
Local SSDsNot supported.

You cannot stop a VM that has a local SSD attached to it.

Not supported.

You can suspend a VM that has a local SSD, but you must explicitly discard the local SSD data in the process.

Local SSDs are maintained.
External ephemeral IPsEphemeral IPs are released when a VM is stopped, but a new ephemeral IP address is acquired when the VM restarts.Ephemeral IPs are released when a VM is suspended, but a new ephemeral IP address is acquired when the VM restarts.Ephemeral IPs are released when a VM is reset, but a new ephemeral IP address is acquired when the VM restarts.
External static IPsStatic external IPs are maintained.

Static IPs that are assigned to VMs in the TERMINATED state are charged as if they aren't attached to any VM. For more information, see pricing.

Static external IPs are maintained.

Static IPs that are assigned to VMs in the SUSPENDED state are charged as if they aren't attached to any VM. For more information, see pricing.

Static external IPs are maintained.
Internal IPs or MAC addressesInternal IPs and MAC addresses are maintained.Internal IPs and MAC addresses are maintained.Internal IPs are released when a VM is deleted.

MAC addresses are generated based on the internal IP. If you want to reuse the MAC address, set the same internal IP address or use a reserved internal IP.

VM metadataVM metadata is maintained.VM metadata is maintained.VM metadata is maintained.

Checking a VM's status

Every VM reports its status as part of the VM's properties. Check a VM's statusin the following circ*mstances:

  • You are experiencing issues with the VM.
  • You just started the VM and want to confirm that the VM is running.
  • You want to confirm that the VM has been suspended or stopped(that is, in the SUSPENDED or TERMINATED state).

To list all VMs and their statuses, use the following command:

gcloud compute instances list

To describe the status of a single instance, use this command:

gcloud compute instances describe example-instance

Hardware failure

Rarely, a VM might fail due to an unexpected outage, hardware error, or anothersystem issue. Mitigate hardware failure by using persistent disks, routinelybacking up your data, and designing your system so that a single VM failure isnot catastrophic. For more information, see Designing robustsystems.

If a VM fails, it is restarted automatically with the same rootpersistent disk, metadata, and VM settings. To modify the automatic restartbehavior, see Setting instance availabilitypolicies.

What's next

  • Learn more aboutlive migration during maintenance events.
  • Learn how tosuspend or resume a VM.
  • Learn how tostop or restart a VM.
  • Learn how toreset a VM.
  • Learn how to delete a VM.
VM instance lifecycle  |  Compute Engine Documentation  |  Google Cloud (2024)

References

Top Articles
Grounded Wolf Spider: How to beat it?
Canvas Schilderij Flower power bloemen vredesteken - 50x50 cm - Wanddecoratie | bol
Craigslist Pets Longview Tx
Brady Hughes Justified
Belle Meade Barbershop | Uncle Classic Barbershop | Nashville Barbers
80 For Brady Showtimes Near Marcus Point Cinema
Craigslist Portales
Notary Ups Hours
Doby's Funeral Home Obituaries
Magic Mike's Last Dance Showtimes Near Marcus Cedar Creek Cinema
Jesus Revolution Showtimes Near Chisholm Trail 8
Urinevlekken verwijderen: De meest effectieve methoden - Puurlv
Tight Tiny Teen Scouts 5
Walthampatch
7 Low-Carb Foods That Fill You Up - Keto Tips
Flights To Frankfort Kentucky
Dutchess Cleaners Boardman Ohio
Stihl Km 131 R Parts Diagram
The Superhuman Guide to Twitter Advanced Search: 23 Hidden Ways to Use Advanced Search for Marketing and Sales
24 Best Things To Do in Great Yarmouth Norfolk
Www Craigslist Com Phx
Fool’s Paradise movie review (2023) | Roger Ebert
Navy Female Prt Standards 30 34
Troy Bilt Mower Carburetor Diagram
Union Ironworkers Job Hotline
What Is Vioc On Credit Card Statement
Ein Blutbad wie kein anderes: Evil Dead Rise ist der Horrorfilm des Jahres
Forest Biome
Georgetown 10 Day Weather
Cvs El Salido
Www.publicsurplus.com Motor Pool
The EyeDoctors Optometrists, 1835 NW Topeka Blvd, Topeka, KS 66608, US - MapQuest
SN100C, An Australia Trademark of Nihon Superior Co., Ltd.. Application Number: 2480607 :: Trademark Elite Trademarks
fft - Fast Fourier transform
What Sells at Flea Markets: 20 Profitable Items
Pronóstico del tiempo de 10 días para San Josecito, Provincia de San José, Costa Rica - The Weather Channel | weather.com
Craigslist Free Puppy
MethStreams Live | BoxingStreams
Uhaul Park Merced
Truckers Report Forums
Helloid Worthington Login
Games R Us Dallas
Hannibal Mo Craigslist Pets
450 Miles Away From Me
Hingham Police Scanner Wicked Local
Hometown Pizza Sheridan Menu
VDJdb in 2019: database extension, new analysis infrastructure and a T-cell receptor motif compendium
Mynord
Best Haircut Shop Near Me
Vci Classified Paducah
How To Find Reliable Health Information Online
Primary Care in Nashville & Southern KY | Tristar Medical Group
Latest Posts
Article information

Author: Greg O'Connell

Last Updated:

Views: 5897

Rating: 4.1 / 5 (42 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Greg O'Connell

Birthday: 1992-01-10

Address: Suite 517 2436 Jefferey Pass, Shanitaside, UT 27519

Phone: +2614651609714

Job: Education Developer

Hobby: Cooking, Gambling, Pottery, Shooting, Baseball, Singing, Snowboarding

Introduction: My name is Greg O'Connell, I am a delightful, colorful, talented, kind, lively, modern, tender person who loves writing and wants to share my knowledge and understanding with you.