Google compute Engine using gcloud CLI -2

Google compute Engine using gcloud CLI -2

ยท

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

bvakash.hashnode.dev/gcloud-command-with-su..

ย