Few additional commands in Google Cloud.
Below are few compute instance commands in gcloud.
gcloud compute instances start <instance 1> <instance 2 > //The instance 1 & 2 are created
gcloud compute instances stop <instance 1> < instance 2 > //The instances 1 & are stopped
gcloud compute instances delete <instance 1> // The instance 1 is deleted
gcloud compute instances delete <instance 1 > --delete-disks=<value> //deletes the boot disk along with instance
gcloud compute instances delete <instance 1> --keep-disks=<value> // keeps the boot disk even if the vm is deleted
gcloud compute instances move <instance 1> --zone us-central1-b --destination-zone us-central-f // moves the instance from central-1b zone to central-f zonet out a
gcloud compute instance
lets see some commands now related to instance templates. Instance templates support almost all the commands that instances support. we can specify things like tags, boot disk size etc… for instance templates as well.
gcloud compute instance-templates list //gives output of the instance templates created in the project.
gcloud compute instance-templates create <instance-temp1> // instance template will be created with default configuration.
gcloud compute instance-templates delete <instance-temp1> // instance template will be deleted
gcloud compute instance-templates describe <instance-temp1> // gives you more information about the instance template.
gcloud compute instance-templates create<instance-temp1> --source-instance=<source-instance-name> --source-instance-zone <name of the zone for source instance> // creates a instance template from the source instances create <instance name> --source-instance-template=<instance-template-name> // Creates an instance based on the instance template properties.