Create Machine in google cloud using command line

Published: 23 March 2017
on channel: SecOps
4,025
38

This tutorials is about how to create virtual machine (instance) in google cloud platform using command line tool gcloud.
#gcloud is come by default with #googlecloudsdk.
How to install google cloud sdk visit here.
   • Setup the Google Cloud Platform SDK  

Steps

1.Find out the what you want
2.Region
3.Type
4.customize
5.Etc etc
Step 2
1.list out the regions available for you
2.#gcloud compute regions list
3.set regions
4.#gcloud config set compute/region REGION
5.unset the regions
6.#gcloud config unset compute/region
Step 3:
1.select image from list
2.#gcloud compute images list
3.Find out the values of to parameter
--image-family
Step 4:
1.Select type of instance from predefined list
2.#gcloud compute machine-types list
3.Find out what computation power and customize it according to your need
4.--custom-memory 4GiB --custom-cpu 2vCPU
--image-project
Step5:
1.#gcloud compute instances -h
2.--description= "testing for the command line "
Step 6:
Final from build command
#gcloud compute instances create secops --zone us-central1-c --image-family centos-6 --image-project centos-cloud --machine-type f1-micro --description 'testing for the command line'
Step 7:
1.To stop the instance
#gcloud compute instances stop secops --zone us-central1-c
2.Need to provide instance name and zone , because there could be multiple instance with the same name in different regions
To start the instance
3.#gcloud compute instances start secops --zone us-central1-c

Need to provide instance name and zone , because there could be multiple instance with the same name in different regions
4.#gcloud compute instances delete secops --zone us-central1-c


On this page of the site you can watch the video online Create Machine in google cloud using command line with a duration of hours minute second in good quality, which was uploaded by the user SecOps 23 March 2017, share the link with friends and acquaintances, this video has already been watched 4,025 times on youtube and it was liked by 38 viewers. Enjoy your viewing!