The course is part of this learning path
In this course, you will get an overview of the GCP services available in various categories, such as compute, storage, and networking, and you will also see hands-on examples showing you how to create virtual machines and web apps using the Google Cloud Console and gcloud command-line interface.
Learning Objectives
- Describe some of the GCP services available in various categories
- Use the Google Cloud Console
- Use the gcloud command-line interface
Intended Audience
- Anyone who would like to learn more about Google Cloud Platform
Prerequisites
- General technical knowledge
- A Google Cloud Platform account is recommended (sign up for a free trial at https://cloud.google.com/free/ if you don’t have an account)
Resources
The GitHub repository for this course is at https://github.com/cloudacademy/gcp-overview.
Now we’re going to dive into using GCP. Suppose you have a server application that you want to migrate to the cloud. As I mentioned earlier, the most straightforward way to do this is to move the application to a virtual machine on GCP.
There are many ways to interact with GCP. The Google Cloud Console runs in a browser, so you don’t need to install anything to use it. Alternatively, you can install the SDK, which stands for Software Development Kit. The SDK includes two types of tools. The first is what you’d expect in an SDK: a collection of client libraries that your applications can use to interact with GCP services.
The second is a set of command-line tools, including gcloud, gsutil, bq, and kubectl. The one you’ll use the most is gcloud, which is for managing all services other than Cloud Storage, BigQuery, and Kubernetes.
It’s actually possible to use the command-line tools from inside the browser, too, without having to install anything on your desktop. I’ll show you how to do that in the next lesson.
The easiest way to get started, though, is to use the console, so if you’re following along on your own account, go to console.cloud.google.com. To get to the place where you can create a VM, go into the menu on the left and select “Compute Engine”. Then click “Create”.
First, you need to give the VM a name. Google generally refers to VMs as instances, so the default name is “instance-1”. For the purposes of this demo, we can leave it at that, but note that you can’t change the name later, so if you were creating a production instance, you’d probably want to name it something else.
Next, you need to set the region and the zone. Google has an extensive network of data centers around the world, and it’s adding more all the time. Each of the circles on this map represents a region, which is basically a data center. Each region contains at least three zones. A zone is essentially an independent part of a data center and has its own power, cooling, network, and security infrastructure. Google divides its data centers into at least three independent zones so that if one of them goes down, it won’t affect the other zones. So, if you distribute your resources across the zones, your applications will keep running even if one of the zones fails.
When you create a virtual machine, you need to say which region and zone to put it in. You can’t change this later, so make sure to choose the right location. Generally, you want to choose a location that’s closest to the people who will be using the VM. I’m going to leave it with the default of us-central1, which is in Iowa. You’ll notice that this region has more than three zones. If you’re only creating a single VM, then it doesn’t really matter which zone you pick, so I’ll just leave it with the default, which is us-central1-a.
Now we need to select the type of machine to create. You can choose from general-purpose, memory-optimized, and compute-optimized. For example, if you choose memory-optimized, then the VM will have way more memory per processor core than it normally would. We’ll leave it as a general-purpose machine, so it’ll have a balanced amount of compute power and memory.
Next, we select the processor series. If it matters to you whether your VM runs an Intel or an AMD CPU, then you can select the one you want here. Otherwise, you can just leave it as E2, which means it will pick whichever type of CPU is available.
Now we finally get to choose the size of the VM. Each option has a certain number of virtual CPUs and a certain amount of memory, although you can create a custom mix of CPUs and memory if you want. The options are divided into sections. If you choose a shared core option, then your VM will be sharing its compute resources with other GCP customers, which is why this is the cheapest option. The other sections are Standard, High memory, and High CPU.
You might be wondering why there are high memory and high CPU options considering that we chose the general-purpose family. You can choose these options if you want a moderately higher amount of memory or CPU in your VM. If you want an extremely high amount of memory or CPU, then you’ll need to choose one of the other machine families first.
The estimated cost per month is shown up here based on which option you choose. Right now, it says $24.86 per month, which is how much it costs for e2-medium. I’m going to set it to e2-micro, which is the smallest option. It only costs $6.52 per month.
Next, we need to configure the boot disk. For the operating systems, we can choose from a variety of Linux distributions or Windows Server. I’ll leave it as Debian. Then we can set the size. I’ll leave it at 10 gig.
If we wanted to run a web server on this instance, then we could select these checkboxes here to open the HTTP and HTTPS ports in the firewall.
There are lots of other options for management, security, disks, networking, etc. We can leave those with the defaults, but there’s one interesting option I want to show you. It’s called “Preemptibility”. If you make this VM a preemptible instance, then it will only run for 24 hours, and there’s even a chance that it could be removed at any time without warning. So why on earth would you want to use a preemptible instance? Well, because it would cost you about 70% less than a normal instance. For example, if you were creating a cluster of VMs to run a batch job, then it might make sense to make them preemptible instances and save a lot of money.
Okay, now we can click Create. One of the great things about GCP is how quickly it spins up new instances. On other platforms, I would fast-forward the video at this point, but it’s so quick on GCP that I don’t need to do that. Another thing I love about GCP is how easy it is to connect to VMs. All you have to do is click on this SSH button here. And we’re in. That’s way easier than on other platforms.
If you check the box beside the VM’s name on this page, you can do a few things, like stop or delete the VM, but if you want to do more, then click on the VM’s name. You can make certain changes to the VM, such as adding new disks. If you stop the VM, you can even move it to a bigger size with more memory and CPUs. If you go to the Monitoring tab, you can see lots of graphs showing things like CPU usage.
That’s it for this demo. If you’re following along on your own GCP account, you might want to look around and see what you can do with your new VM instance. Just remember to delete it when you’re done, so you don’t incur any ongoing charges.
Now if you’re ready to see how to work with GCP using the command-line interface, then please go to the next video.
Guy launched his first training website in 1995 and he's been helping people learn IT technologies ever since. He has been a sysadmin, instructor, sales engineer, IT manager, and entrepreneur. In his most recent venture, he founded and led a cloud-based training infrastructure company that provided virtual labs for some of the largest software vendors in the world. Guy’s passion is making complex technology easy to understand. His activities outside of work have included riding an elephant and skydiving (although not at the same time).