Google compute Engine using gcloud CLI -2

B V AKASHB V AKASH
2 min read

In this lab we will play with gcloud cli with more commands and launch compute Engine with it.

  • If you want to see the details of your compute instance.
    gcloud compute instances describe [your instance name]
    

image.png

  • To reset your VM instances.
gcloud compute instances reset [your instance name]

image.png

  • To stop your VM instances.
gcloud compute instances stop [your instance name]

image.png

  • To start your instance.
gcloud compute instances start [your instance name]

image.png

  • To delete your instance.
gcloud compute instances delete [your instance name]

image.png

  • To view the zones in a particular region.

image.png

  • To view your default zone.
gcloud config get-value compute/zone

If it shows unset you can set.

SKQZebts0U.png

  • To set the zone . you can choose your desired region's zone.
gcloud config set compute/zone us-central1-f

image.png

again if you type gcloud config get-value compute/zone your zone have been set.

image.png

you can use unset command to unset zone and after that you can set with another zone.

  • Again write the command to create instance you should see your instance with your default zone.

    gcloud compute instances create my-instance-cli-2
    

    image.png

image.png

Finally we launched our VM instance in our desired zone using CLI.

That's it, for now, we will continue further more in next blog.

Hope you liked it. Will see you on the next topic ๐Ÿ˜ƒ

Next topic

https://bvakash.hashnode.dev/gcloud-command-with-supporting-resource

0
Subscribe to my newsletter

Read articles from B V AKASH directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

B V AKASH
B V AKASH

I design, architect, and maintain hybrid cloud environments.