VM Provision In Google Cloud Platform

Following is the way to create an Google Cloud account.

Load the Google cloud platform URL and signup with the appropriate details. While creating account you will be asked to enter your credit card details, don’t worry about it because they are offering $300 free 60 days for our experimentations. Just enter your credit card details, they won’t change you until you give the proper permission.

– Once your account is successfully created, you will be given the dashboard as follows. Then you can select start with Compute Engine.

  1.  let’s follow the below steps to create a Linux machine step by step.
    Open the Google Cloud Dashboard and click on Try Compute Engine, then you will be placed in to some tutorials at the first time. In tutorials click on the “select a different project” and then click on drop down and create a new project.
    screen-shot-2017-01-07-at-12-22-16-pm
  2. Then continue with next buttons and finally you will be placed in the Compute Engine portal.
    screen-shot-2017-01-05-at-4-20-40-pm
  3.  Click on create instance button and try to make a new instance with specifying the machine spec. Screen Shot 2017-01-05 at 4.22.53 PM.png
  4. As you can see the image above, you can set name for Instance, the region that you want to start the instance, number of CPU cores, the Boot image disk with OS and also you can configure firewall rules.Screen Shot 2017-01-05 at 4.54.12 PM.png
  5. Now you are done with provision instance, it’ll be available on project dashboard. Screen Shot 2017-01-07 at 2.44.02 PM.png
  6. There are several ways to SSH in to Linux machine. Following are the ways to SSH in Linux machines.
    1. SSH to an Instance from browser: Click on the SSH option under the Connect column in above image. And click on the “Open in Browser Window”.
      Screen Shot 2017-01-08 at 9.17.14 AM.png
      Once you click you will be placed in to the new window, you will be connected in to the ssh server by generating SSH keys.
      Screen Shot 2017-01-08 at 9.24.30 AM.png
    2. View gcloud command: Once you open this option, you can see the command for gcloud. In my example following is my gcloud command,
      Screen Shot 2017-01-08 at 10.00.25 AM.png
      Click on “RUN IN CLOUD SHELL” then automatically generate SSH keys and you will be able to logging to the instance easily.
      Screen Shot 2017-01-08 at 10.20.05 AM.png
    3. Use Another SSH Client:
      I’ll show you how to connect to an instance via MacOS by generating SSH key pairs.
      Screen Shot 2017-01-08 at 12.55.04 PM.png
      If you already have a SSH key pair in your ~/.ssh/ location, copy the id_ras.pub key file and add it to the metadata in Cloud dashboard as shown in above.
      Once you are done with SSH key adding, use the following command to log in to the server.

      ssh -i ~/.ssh/id_rsa <Username>@<IP_address>
      
  7. Now you are done with provisioning new VM servers and how to log in to it. Enjoy the tutorial 🙂