image
Advanced VM Options
Start course
Difficulty
Beginner
Duration
35m
Students
840
Ratings
4.9/5
Description

This course will introduce you to the Google Compute Engine. 

Learning Objectives

  • What Google Compute Engine is
  • How it differs from the other Google compute offerings
  • How to create virtual machine instances from scratch, from a template, and from a machine image

Intended Audience

  • Cloud Architects
  • System Administrators
  • GCP Developers
  • Anyone preparing for a Google Cloud certification

Prerequisites

  • Basic understanding of Virtual Machines
  • Access to a GCP account

 

Transcript

Now that you understand how to create a basic VM, I want to take you through some of the more advanced options. To start, I need to create a new instance and then I'll scroll down and expand the Advanced Options section. Here in the networking section, you can customize your networking interfaces. Now, this lets you pick the VPC or VPCs that your VM will live in. By default, it's going to create everything in the default network. But you can have other networks and create your instances inside those. Network lets you pick a VPC for your instance and subnet lets you pick the subnetwork inside the VPC. So, as we saw before, an instance can have both an internal IP and an external IP. This option allows you to set your internal IP address to be either dynamic or static. Ephemeral (Automatic) allows Google to pick a random IP from the allowed range. Ephemeral (Custom) allows you to pick an available IP. In this case, Ephemeral basically means dynamic.

Ephemeral IPs can change whenever an instance is stopped or deleted. So, if you want to have the VM to always have the same IP address no matter what, then you need to reserve a static IP with this option. Now you get similar options available for the external IP address. You can set it to be Ephemeral, which basically means the same thing as dynamic, it can be static, or you can also select none. Now selecting no external IP address means that your VM instance is going to be cut off from the Internet. Now this makes it much more secure but also a little bit more difficult to work with. That's about as deep in the networking as I want to go. Next, let's talk about the disk section. Now, this is what allows you to add and attach additional disk drives. So, if your VM needs to have multiple drives, you can set that up here. The security section has a bunch of options for making your VM instances more secure. Now I'm going to skip most of this stuff but I do want to show you how to add your own SSH keys.

So, by default, Google manages your SSH keys for you. But if you want to connect using your own SSH client, you're going to have to generate your own set of keys. So, the exact steps for generating the keys is going to depend upon your operating system. However, once you've created both a private and public key, then you'll use this option to paste in your public key. Now, remember you just want to upload your public key, not the private one. Your private key, you want to keep private on whatever machine you plan to connect from, and you will notice that you can add multiple keys if you wish to connect from multiple machines. Now under the management section, there are two main things that I want to highlight. First, this setting allows you to manage any committed-use discounts. Now, if you've purchased a commitment to use a certain amount of machine types, you can get a discount. And by default, Google is going to automatically attempt to subtract your new VM instance from that commitment. Now, if you've purchased multiple sets of commitments, you can also manually select the one to subtract from. Or you have this third option, which means your new instance will not count towards one of your commitments. Now if you have not purchased any commitments, then this option does not apply.

The second part has to do with spot instances. Now by default, your VM will use a standard instance. However, you can use this to switch to using a spot instance. Now, spot instances are cheaper, but they're much less reliable. You don't get to keep a spot instance for as long as you want. They can be taken away at any time. So, they're only appropriate for certain types of workloads, but they can save you a huge amount of money if used correctly. So, that covers all the advanced options I wanted to show you. Now, there is one last thing you might need to know. So, if you want to create a VM using the command line instead of the web console, you can get the exact command by clicking here. Now this means if you have the Cloud SDK installed locally on your machine, you can just paste in this command to your terminal and it's going to create a VM with all the same settings that you picked on the form. If you don't have the SDK installed locally, you can use Cloud Shell to run the command for you. This can be incredibly useful in case you need to create many copies of the same VM.

 

About the Author
Students
37260
Courses
44
Learning Paths
16

Daniel began his career as a Software Engineer, focusing mostly on web and mobile development. After twenty years of dealing with insufficient training and fragmented documentation, he decided to use his extensive experience to help the next generation of engineers.

Daniel has spent his most recent years designing and running technical classes for both Amazon and Microsoft. Today at Cloud Academy, he is working on building out an extensive Google Cloud training library.

When he isn’t working or tinkering in his home lab, Daniel enjoys BBQing, target shooting, and watching classic movies.