Creating an Instance using cloud shell
Creating an instance using Cloud Shell in Google Cloud Platform (GCP) provides a convenient and efficient way to deploy virtual machines (VMs) directly from the command line interface within the GCP environment. Cloud Shell offers a browser-based shell experience with access to various tools and resources, eliminating the need for local installations or configurations.
To create an instance using Cloud Shell, users can use the gcloud command-line tool, which is pre-installed and authenticated within the Cloud Shell environment. By running the appropriate gcloud commands, users can specify the instance configuration parameters, such as machine type, boot disk, network settings, and metadata.
Prerequisites
Hardware : GCP
Google Account
Another method to create Instance is by using the GCP cloud shell.
Open Cloud Console.
Click on Activate Cloud Shell.
Click on Continue.
Copy the below code into the cloud shell.
$ gcloud compute instances create <machine_name> --boot-disk-size=<disk_size_in_GB> --machine-type=<machine_type>
Specify the “Machine name”, ”size”, “type” . Zone will be selected automatically. Press “y” if you are okay with the selected zone. If not press “n” and choose the zone accordingly.
NB: Machine name should not contain any capital letters or any symbols except hyphen.
After creation press refresh button. It will show the Instance that we created.
Creating an Instance using cloud shell