Creating a VM

Let's now create our first VM instance using the web console.

Go to the GCE console, https://console.cloud.google.com/. Select the project we created in the previous chapter (or create one if you don't have one yet), and in the menu on the left, click on Compute Engine. Since you don't have a VM yet, you are greeted by the following message. Click on Create as shown in the following screenshot:

For this first VM, we will choose a small one and resize it as we go along.

There are several things you need to decide on at this point:

  • The name of your instance. I will call mine sparrow. This name does not have to be unique across GCP. Feel free to name yours as you like.

  • The region and the zone. It's often better to choose the zone closest to you to reduce latency. However, GCP services often open in the US first and become available only after a while in other parts of the world. Different zones may also have different rules and regulations. For instance, Europe offers stronger data related privacy laws than the US. Choose the zone as you see fit. It will always be possible to change the zone later.

  • Selecting the right machine type is important. At time of writing this book, different machines are grouped in categories as small, standard, high CPU and high RAM:

    • Small: Shared CPUs and limited RAM

    • Standard VMs: 3.75 GB of RAM

    • High-memory VMs: 13 GB RAM

    • High-CPU VMs: 1.8 GB

The small category is perfect to get started with and build some hands-on experience with the platform. For more intense projects, you may want more more computational power or more memory.

Note that free-trial accounts are limited to eight CPUs.

It is also possible to customize the machine you need by setting the number of CPUs or memory per CPU you want. This is also where you choose the number of GPUs to have on your machine, as shown in the following screenshot:

  • Finally, you need to choose the OS for your VM. The Debian Linux distribution is offered by default. You have a choice among several OSes: Windows, CentOS, Suse, CoreOS, and Ubuntu. Although Ubuntu is often the most popular choice, there is actually little difference between Debian and Ubuntu and we will go with the default Debian distribution. If you're more familiar with the Ubuntu distribution, go for it. It should not cause any problems in this chapter.
Ubuntu or Debian? Debian is one of the first Linux distributions with a first stable release in 1996. Ubuntu started as a fork, a branched out version of Debian in 2004. The two distributions are very similar, with Ubuntu being more user friendly and having a better desktop/UI experience. Debian is usually preferred for servers, a massive package library, with a strong focus on stability and open-licensed software. A stable version of Debian is released approximately every two years. The Ubuntu release cycle is six months. Ubuntu takes the unstable branch of Debian, makes customization especially in terms of the UI, and releases it. For our work, there should be close to no difference between either distribution and we will use Debian for our VMs.

Leave all the rest of parameters to their default choices. We will come back to HTTPs traffic, disks, networking, and ssh keys in a few pages.

One very useful feature in the web console that lowers the learning curve to mastering the GCP is the two links at the bottom of the VM creation page, Equivalent Rest or command line, as shown in the following image: 

 

The command line link exists on multiple pages of the web console. It is a very useful feature to quickly learn the right syntax and parameters of the GCP command line tools.

Our VM is now created, up and running!

Now that we have a brand new shiny VM, how do we access it? That nicely leads us to the Google Shell.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.135.67