Lab Review: Creating Virtual Machines
1. Lab Review: Creating Virtual Machines
In this lab, you created several Virtual Machine instances of different types with different characteristics. Specifically, you created a small utility VM for administration purposes, a windows VM, and accustomed Linux VM. You also acts as both the Windows and Linux VM and deleted all your creative VMs. In general, start with a smaller VM when you're prototyping solutions to keep the cost down. When you're ready for production, trade up to larger VMs based on capacity. If you building and redundancy for availability, remember to allocate excess capacity to meet performance requirements. Finally, consider using custom VMs when your applications requirements fit between the features of the standard types. You can stay for a lab walk through but remember that GCP user interface can change, so your environment might look slightly different. So in the GCP console, I'm going to navigate to Compute engine and then VM instances, and in here we're going to click "Create". Now, we can define a name there's a small question mark here and if you hover over it can tell you a little bit more about some of the restrictions you have in regards to creating a name, choosing a name that is, and I'm just going to call this my utilityVM. We're going to go over some of the options that actually went over a little bit in the demo, but we obviously can choose region and zones. So let's change the zone to what the lab is instructing, which is 1-C, and then for the machine type we have a lot of different options to choose from. We can see that the cost changes if I scale up to a machine with four virtual CPUs versus a machine that's just maybe a micro, which is a shared core machine. So the cost can change quite drastically. So let's just leave all the remaining settings and click "Create", and once the machine is up and running, we're going to explore the different VM details that we have. So we're going to go into the VM Instances page, and look at things like the CPU platform, the availability policies and so on. So let me do that, let me click on "Utility VM" because it's now in a running state. I'm going to look for a CPU platform, you can see that right here and if I click "Edit", you'll see that I actually am unable to modify that. So that's because I can't do that while the instances is running. There are other things I could do, I could change the firewall rules, I can add network tags. So certain things are available to change while and instances is running. In some cases, you have to stop the instance to change some of the properties. In other cases, you cannot actually even change it unless you delete it. One of those is for example the network interfaces, if you had multiple network interfaces, you'd have to recreate your instance. The good thing is you could keep your boot disk and just reattach that boot disk later on. Now, I can also go and look at the availability policies, just scroll down to some what the enhanced maintenance is. By default, it's set to migrate the VM instance, and that's recommended but you could set this to terminate the instance. It's also going to automatically restart that instance so you could configure that as well. All right, so this is just a little bit exploring the different options, I'm going to go click "Cancel". What we're going to now is explore some of the VM logs. So I'm looking at the detail page here. We want to get a little bit more information about the monitoring options that are available. We can click "Monitoring" here, and we'll get more information about the CPU. This instances barely runs, we don't have much data yet. We get information about the network bytes and packets, disk I/O. We can also, if we go back to details, look at stackdriver logging. So this is now a different user interface and here we now have individual logs that we can explore. We can view options here, we could expand all of these and dig into all of these different logs that are in here and even within there, expand each of the logs to get more information. So this uses stackdriver logging, we'll cover this feature a little bit but more in a later course in the course series if you're interested to learn more about both the logging piece that we just looked at as well as the monitoring. So let's go to Test 2, we're now going to create a windows virtual machine. So I'm going to go back through the navigation menu Compute engine to VM instances, and I'm not going to create a another instance. So I'm going to define a name, and this is just going to call it Windows VM, and we're going to choose a different region and zone this time. Why don't we put this into Europe-West2, and specifically to zone 2A. Let's pick a larger machine. Let's pick one that has two virtual CPUs and 7.5 gigabytes of memory. We can even go ahead now and changed the boot disk because by default, this would be a Linux machine, so if we want to change this because we want to create a windows machine. Specifically, the lab is instructing me to look for the Windows Server 2016 Datacenter Core image. It's first scroll down, I can see that image right here, can change the boot disk. Maybe I want some higher IOPS, I can choose an SSD, and I can even make this larger and click "Select". All of that again is going to affect obviously the cost. I have the cost of the machine, I have the cost of the disc, but the new thing I have now also is the image, I've chosen zupimages which means there is a cost associated with using that image, but it's built all together for you. So you can see that cost broken up right here. Now, the other thing we're going to do is we're going to allow a specific traffic, HTTP and HTTPS traffic. This just creates a network tag for us and then creates filer roles on the network tag so that we can enable traffic on those ports for the TCP protocol. So let's hit "Create" and create this instance. One thing we'll notice when the instance comes up is that under the connect column [inaudible] now seeing an SSH button which is we would have for a Linux machine. We should now see a RDP, which is for the Remote Desktop Protocol. So that's how you would access a Windows machine. Now, the important thing is there you obviously want to configure your username and password so that only authorized users access that machine. So here you can see the RDP button now. What we're going to do now is we're going to click onto the machine and set the Windows password. You can actually also do this by clicking "Down here" set windows password there as well. So actually, let's just do it that way. So you have a username here. It's taking the username that I have for my lab account. So this is the username right now. So I can set that and then it's going to provide me with a password. So there we go. So I can now copy that password and if I use an RDP connection, I can then get into that. This is a little bit outside of the scope for this lab, but if you want to and have an RDP client, you can actually install one through Chrome, through an extension. You could access that instance that way and then configure it and do anything else you wanted to in this Windows Virtual Machine. So let me go ahead and close that, and I'm going to move on to a Task 3, now which is to create a custom Virtual Machine. So I'm going to go back to Create Instance, and to find a name, let's just call it my custom-VM. I'll follow the lab instructions here for setting the region and zone which is US-West1-B. Now, rather than choosing a specific machine type, I can go in here and just select Custom as the machine type and then define the exact numbers of cores memory. So let's say, my specification I want six virtual CPU, and you can see how the scales by the way, there are only certain options. You can choose it goes all the way to 96. So let me choose six here. It's going to scale that memory automatically for us. It gives us a range now depending on that CPU, there's an option to extend the memory so you could get more than 39 and see all the way to 624. This is a separate option, we'll talk more about this in the slides. So let me choose 32, and rather than scrolling here I could also just type the value in and that's also going to adjust the cost now. Sometimes, it's important to note that your custom machine may be between two machine types are actually already provided. A custom machine is generally going to be slightly more expensive. So if you have a standard machine that's very close to the custom machine, it's definitely something you would want to consider. Once the machine runs more than 24 hours, you'll get right sides recommendations. So It'll tell you if the machine is too small or too large and make recommendations based on that. So let's go ahead and create that. Once it's up and running, we're going to SSH to the machine. We're going to run some commands on that machine, and that's actually going to wrap up the Lab for us. Now, with any new project, you get this column here on the right-hand side to help you get started because we're using Qwiklabs generated projects, they're always going to be new products. So you'll see this throughout the training. You can certainly leveraged this if you want but I'm going to collapse that. So VM is up and running, let me SSH to it. Then we're going to run the free command to see information about any unused and used memory and swap space. So let me type free. So we can see that here and that lines up with the memory selections that we made in the machine. I can also see I get more information or details about the RAM installed. So here we get more information about that as well. I can verify the number of processors. So that should have been six, and yep, and prox is sixth, great. We can see details about the CPU itself. So here we get information about the architecture, the byte order, which model exactly, so you can get all this information about any VM that you create. You can also get more information about this in the documentation depending on which region and zone you choose. You'll have different architectures and different models available to choose from. So that's all we wanted to show you here with this lab. We went ahead and created that Virtual Machine, the Utility VM, we created a Windows VM, and then we created a custom Virtual Machine and verified that whatever custom settings we applied were actually used to create the machine by running commands within that machine.2. Let's practice!
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.