We will continue with our more useful commands
- We will create a image for our disk.
--source-disk
is your disk name and --source-disk-zone
is your disk zone in my case its us-central1-a
gcloud compute images create my-image-1 --source-disk=my-disk-1 --source-disk-zone=us-central1-a
- We will launch instance template.
In this command I'm creating a instance template in a region by using --region
flag
also I'm saying create boot disk with using our image with the help of --image
flag
and finally I'm saying use --machine-type
e2-micro you can give your desired machine type.
gcloud compute instance-templates create my-template --region=us-central1 --image=my-image-1 --machine-type=e2-micro
- Let's launch a machine image using gcloud.
gcloud compute machine-images create my-machine-instance-image --source-instance=my-gcloud-instance --source-instance-zone=us-central1-a
Let's delete our services one by one.
gcloud compute disks delete my-disk-1 --zone=us-central1-a
gcloud compute images delete my-image-1
gcloud compute instance-templates delete my-template
gcloud compute machine-images delete my-machine-instance-image
Note:- Make sure to delete the resources if you don't need it anymore or else stop else to save money.
That's it, for now, we will continue further more in next blog.
Hope you liked it. Will see you on the next topic ๐
ย