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.
![](https://prwatech.in/blog/wp-content/uploads/2021/03/7-3.jpg)
Click on Continue.
![](https://prwatech.in/blog/wp-content/uploads/2021/03/8-1.jpg)
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.
![](https://prwatech.in/blog/wp-content/uploads/2021/03/21-1024x129.jpg)
After creation press refresh button. It will show the Instance that we created.
![](https://prwatech.in/blog/wp-content/uploads/2021/03/22-1024x320.jpg)
Creating an Instance using cloud shell