Executing Shutdown Script on a GCE VM | Scribe

    Executing Shutdown Script on a GCE VM

    • Hafeez Baig |
    • 12 steps |
    • 50 seconds
    1
    Sign in into the **Google Cloud Console**
    2
    Type "**VM instances**" in the search bar and click on the **VM instances** option
    information ordinal icon
    **What are VM instances?**\ \ **VM instances** in Google Cloud Platform (GCP) refer to **virtual machines** that run on Google Compute Engine. These are customizable compute resources that provide users with the capability to run applications, deploy workloads, and manage services on Google's infrastructure. VM instances can be configured with different CPU, memory, and storage options, and can run various operating systems, including Linux and Windows. They are a key component of cloud infrastructure, offering scalable and flexible computing power.
    3
    **VM instances** wizard will open, click on the **CREATE INSTANCE** button
    4
    **Create an instance** wizard will open, Scroll to the **Name** text input field and enter "**instance-2**"
    5
    Scroll to the **Advanced options** section and click on the dropdown button
    6
    Scroll to the **Management section** and click on the dropdown button
    7
    Scroll to the **Startup script** section, here you can give the Automation script for your VM instance
    information ordinal icon
    **What is Startup script ?**\ \ A **startup script** in Google Cloud Platform (GCP) is a script that is automatically executed when a virtual machine (VM) instance is launched. It can be used to install software, configure the environment, or run commands necessary for the instance to function properly. Startup scripts can be written in languages like Bash or Python and are typically defined in the VM instance’s metadata. This automation helps streamline the setup process when provisioning new VMs.
    8
    Scroll the page and click on the **ADD ITEM** button
    information ordinal icon
    **What is Metadata?**\ \ **Metadata** in Google Cloud Platform (GCP) refers to key-value pairs that provide information about your resources, such as VM instances. It can include details like instance configuration, project-level settings, and custom user-defined data. Metadata is often used to store information like startup scripts, SSH keys, or application-specific configurations that the instance can access while running. GCP provides both **project-level** metadata (applied to all instances in a project) and **instance-level** metadata (specific to individual VMs).
    9
    Scroll to the **Key 1** text input field and enter "**shutdown-script**"
    10
    Scroll to the **Value 1**, here you can add the Value for the shutdown-script
    11
    Click on the **ADD ITEM** button, if you want to add more than one keys
    12
    Scroll the page and click on the **CREATE** button to apply the changes
    information ordinal icon
    Congratulations! on completing this lab and Understanding Execting Shutdown Script on GCE VM