Understanding Command Structure in Gcloud to play with Services | Scribe

    Understanding Command Structure in Gcloud to play with Services

    • Hafeez Baig |
    • 10 steps |
    • 36 seconds
    information ordinal icon
    Refer to this guide to learn How to connect to Cloud Shell in GCP<https://scribehow.com/shared/Getting_Started_with_Gcloud__gdvVZwUfQVqAAI18BB1bSw>
    1
    On the **Cloud Shell Editor** and type the command [[gcloud compute instances create my-gcloud-vm]]
    information ordinal icon
    **What is command [[gcloud compute instances create my-gcloud-vm ]]?**\ \ The command `gcloud compute instances create my-gcloud-vm` is used in Google Cloud Platform (GCP) to create a new virtual machine (VM) instance named `my-gcloud-vm` using the Google Cloud CLI (gcloud). This command initiates the creation of a VM with default settings, which can be customized with additional flags to specify options like machine type, zone, image, and other configurations.
    2
    The CLI displays details about the new **VM instance** being created, including its Name, Zone, Machine type, status, Internal and External IP address
    3
    To view the instances list, type the command [[gcloud compute instances list]]
    information ordinal icon
    **What is command [[cloud compute instances list]]?**\ \ The command `gcloud compute instances list` is used in Google Cloud Platform (GCP) to list all the virtual machine (VM) instances in a project. This command provides details such as the name, zone, status, and other information about each VM instance, helping users manage and monitor their VM instances.
    4
    The CLI shows a list of all **VM instances** in the project with their details like Name, Zone, Machine type, IP addresses, and status.
    5
    Type the command [[gcloud compute instances describe my-gcloud -vm]]
    information ordinal icon
    **What is command [[gcloud compute instances describe my-gcloud -vm ]]?**\ \ The command `gcloud compute instances describe my-gcloud-vm` is used in Google Cloud Platform (GCP) to display detailed information about a specific virtual machine (VM) instance named `my-gcloud-vm`. This command provides comprehensive details about the VM, including its configuration, status, metadata, network settings, and more.
    6
    It displays the detailed information about the **VM instance** named `my-gcloud-vm`, including its configuration, status, network settings, and metadata.
    7
    To delete the instance type the command [[gcloud compute instances delete my-gcloud-vm]]
    information ordinal icon
    **What is command [[gcloud compute instances delete my-gcloud-vm ]]?**\ \ The command `gcloud compute instances delete my-gcloud-vm` deletes the VM instance named `my-gcloud-vm`.
    8
    Type "**Y**" to continue the deletion process
    9
    Successfully deleted the gcloud VM instance `my-gcloud-vm` **Note:** You can run the below-listed commands and practice using Cloud Shell CLI
    10
    1. **Command**: `gcloud compute instances list`\ Lists all VM instances in the project, showing details like name, zone, and status. 2. **Command**: `gcloud compute zones list`\ Lists all available zones in GCP where resources can be created, along with their statuses. 3. **Command**: `gcloud compute regions list`\ Lists all available regions in GCP, providing information on geographic locations for resource deployment. 4. **Command**: `gcloud compute machine-types list`\ Lists all available machine types in all zones, showing the various VM configurations available. 5. **Command**: `gcloud compute machine-types list --filter="zone:us-central1-b"`\ Lists all available machine types specifically in the `us-central1-b` zone, filtering out others. 6. **Command**: `gcloud compute machine-types list --filter="zone:(us-central1-b europe-west1-d)"`\ Lists all available machine types in both the `us-central1-b` and `europe-west1-d` zones, filtering to show only those zones.
    information ordinal icon
    Congratulations! on completing this lab and Understanding Command Structure in Gcloud to play with Services