Lets first select the Region and zones:
Assume that we want to select us-central1 region:
Set this in your GCP terminal
MY_REGION=us-central1
To check the zones we have
gcloud compute zones list | grep $MY_REGION
Now select anyone of the zones and copy paste it for the value
MY_ZONE=<Your desired zone>
Set this zone to be your default zone by executing the following command
gcloud config set compute/zone $MY_ZONE
Execute the following command to store a name in an environment variable you will use to create a VM. You will call your VM second-vm
MY_VMNAME=second-vm
Create a VM in the default zone that you set earlier in this task using the new environment variable to assign the VM name
gcloud compute instances create $MY_VMNAME \
--machine-type "e2-standard-2" \
--image-project "debian-cloud" \
--image-family "debian-11" \
--subnet "default"
Go to Navigation bar and then Compute Engine and then VM instances.
So, you can see your vm created.
Although you can check out using this command line:
List the virtual machine instances in your project
Done!
Top comments (1)
Very Informative. 👏
I created an article a while back regarding VMs on Azure using SSH as well as RDP for GUI based VMs and hosting websites cost free on them. Do check that out as well.
huzzaifaasim.medium.com/a-beginner...