Behaviour of compute engine startup scripts

394 views
Skip to first unread message

Lance Armah-Abraham (vdc.cloud)

unread,
Apr 22, 2022, 5:33:55 PM4/22/22
to gce-discussion
When using startup scripts, if I were to stop the virtual machine manually  from the console and start it once more, will the startup script re-run? or it only runs when I create the machine?

Anyone with knowledge on this?

Luke Bayler

unread,
Apr 22, 2022, 5:51:13 PM4/22/22
to Lance Armah-Abraham (vdc.cloud), gce-discussion

On Fri, Apr 22, 2022 at 2:33 PM Lance Armah-Abraham (vdc.cloud) <la...@vdc.cloud> wrote:
When using startup scripts, if I were to stop the virtual machine manually  from the console and start it once more, will the startup script re-run? or it only runs when I create the machine?

Anyone with knowledge on this?

--
© 2018 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
 
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-dis...@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to the Google Groups "gce-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gce-discussio...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/96f7a721-5fe8-4ed4-887b-afd5dfe3d13an%40googlegroups.com.


--

Lance Armah-Abraham (vdc.cloud)

unread,
Apr 25, 2022, 10:09:04 AM4/25/22
to gce-discussion
Hi, thanks for the document link you shared. It does talk about the sequence of executing scripts (ones with startup-script for inline and startup-script-url from gcs).

But this does not answer whether after I stop the compute engine instance and then I start it later, the script (either the startup-script or the startup-script-url) will re-run. Tha'ts what I want to confirm whether it runs each time the instance is started or it only runs the first time the instance is created and not when it's restarted for instance.

ashok...@google.com

unread,
Apr 25, 2022, 4:15:36 PM4/25/22
to gce-discussion
Startup-script is executed everytime boot is done.
Reply all
Reply to author
Forward
0 new messages