Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Preemptible VM instance name

Hi,

Is the VM instance name preserved incase of Preemptable VMs? i.e, Is the VM name going to be the same for the entire VM lifecycle (even when it was preempted in between)?

Thank You

1 1 264
1 REPLY 1

Hi @starry91 ,

If your question is about "Preemptible VMs" [1], then yes, the name shouldn't change. You can test this by simulating the preemption action -- i.e., stop the VM, and after the status changes to TERMINATED, restart it.

For "Spot VMs" [2], the behavior depends on the termination action [3] that you specified while creating the VM. If you set the termination action to DELETE, then the VM is removed when it's preempted -- i.e., the lifecycle ends. So the name-retention question is moot. But if you set the termination action to STOP, then the VM isn't removed -- i.e., you can restart it, and the name doesn't change.

I hope this helps.

[1] https://cloud.google.com/compute/docs/instances/preemptible

[2] https://cloud.google.com/compute/docs/instances/spot 

[3] https://cloud.google.com/sdk/gcloud/reference/compute/instances/create#--instance-termination-action