Transcript for:
Understanding Virtualization and Cloud Labs

Hello there, my name is Chong Oh and I'm a professor of information systems and I welcome you to the Google Cloud Lab. In week 4, we learned about the concept of virtualization, a process by which one physical computer hosts many many different virtual computers within it. The host operating system may host many virtual machines. Just like in this picture, this one physical machine can actually host many many different virtual machines with their respective operating systems on it. This is called virtualization. It's like renting a part of a physical server but that physical server is cut up to host many many different virtual machines. And this is what the cloud is all about, which is the topic that we are learning this week. The concept of cloud computing is basically virtualization. In this lab, you will learn to use Google Cloud to learn how to provision two virtual machines as well as to set up a web server. So you will be really doing cloud computing, the duties of a typical cloud engineer. The high-level learning objectives for this lab is, number one, you will learn to understand cloud infrastructure. how things are set up on the cloud and you will gain command line proficiency because one of the tasks in this lab is to provision a virtual machine using command line interface and you will learn about deploying and managing applications and lastly you learn about networking and connectivity how web servers and virtual machines and servers are connected at a high level Okay to start off the lab, first you want to open up an incognito browser, meaning that the browser does not have any memory of your history. To open up an incognito browser is Ctrl Shift N or Command Shift N if you're using the Mac. Then type in the url cloudscalesboost.google then you will see this page just click on the join button on the upper right then you have a choice to sign up as a new user or use your google account i'm going to use my google account Subsequently, you will go through a few different pages. I think it's a little bit different for different people. But eventually you will arrive at a page like this. They will ask if you want to start joining the Innovatives Program. You say join, click on the join button and then you have to fill a few other forms and you will tell you you get something like 35 free credits for being an innovator and then you arrive at the dashboard page for the cloud skill boost platform Now, at this point, I'd like you to search for Create Virtual Machine. And you will see the Create Virtual Machine Lab that's available down here. Click on it and you will arrive at the introduction page for the lab. Now, let's just do a quick... Check on how many credits we got for free account. You should see it says 35 credits Let's go back to create virtual machine and we are ready to start the lab So this lab has the following objectives number one is to create a new virtual machine instance from the cloud console Number two is to install a ng-inx web server onto that virtual machine that we just created. Number three is to create another virtual machine but using the GCloud console. And last one is to test your knowledge about what you have done. So those are the four steps or the four tasks involved in this lab. Let's start the lab by clicking on the green start lab button. There's a timer and we are limited to only 40 minutes to get this lab done. I encourage you to read through the details of the lab so you're more prepared. Otherwise, let's get started. Notice that you are given a username and a password here and these are the username and password that you need to use for this lab. You cannot use any other username and password for this lab. So start the lab by clicking on open Google Cloud console. and you need to sign in using the username and password that was given earlier Here we are at the Google Cloud Console or the Google Cloud Dashboard. Setup and Requirements. The first thing we need to do is to activate the Cloud Shell and to do that we first need to search for where it is. I wasn't able to find it through these instructions here so I just search for it. So here is the Cloud Shell editor. It takes a few minutes for Google Cloud to provision a Cloud Shell for us. Okay, it's done. Google Cloud will ask you for some configurations. I'll just go with the default settings. Let's go back to the instructions. We see that we already activate the shell. To know that this is done, we can open the terminal and look at the messages that's been published there. you can see the message that says your cloud platform project in this session is set to some number string you know that your you have successfully activated the cloud shell back to the instructions the next thing we need to do is to authorize the cloud shell We do it by just typing in or copying this command gcloud auth list and paste it into the terminal. Then click on authorize. Authorization is successful. Then next step is to show the project id according to this command gcloud config list project. Project id is listed successfully. Back to instructions. So there's some reading here about regions and zones. Cloud data centers are all over the country and they're divided by regions and zones. So we need to sometimes specify. what region or zones that is appropriate for our virtual machine. Preferably something that is close to us so that the latency is minimized. Let's follow the following instructions and copy and paste the code here to set the region and zones for our virtual machine. Since there's no error, I assume it's successfully done. Now back to instructions. We are now on to task number one which is to create a new virtual machine using the cloud console. To do this we need to go to navigation menu and then click on compute engine and then go to VM instances. As you can see there is nothing here right now. Click on create an instance. And in the machine configuration we have to update a few details such as region, zone and so forth. Let's do that right now. Let's update the name of the machine to GCE Lab. region is US-East number 4 zone is US-East 4-A series is E2 Machine type is E2-Medium. This is setting the CPU and memory for our virtual machine. Next is setting up the operating system and storage. The operating system that we're going to use is the Linux Operating System dbn version. Please just follow the instructions and update the details of the operating system accordingly. so if notice on the right hand side it shows the monthly estimate of how much this is going to cost us if we were to use this virtual machine on a long-term basis and this is typical of all cloud providers to provide these estimates to help us as a customer to be able to plan out our financial when we use the cloud the next step is to update networking we want to allow http traffic so that we can put a web server on top of our virtual machine okay we are ready let's let's click on the create button to create this virtual machine Success! Our virtual machine is now created. The next thing is to authorize SSH so that we can have secure connection between the client and server. Do this by clicking on this SSH button. And then in that little window, just click on authorize. SSH is set. Don't close this terminal we'll still be using it now. Now we are on task number two which is to install an NGII NX web server. All these setups are pretty straightforward pretty easy because the initial work has already been done by setting up the virtual machine. So just follow along the instructions and copy the command and pop them into the SSH terminal as needed. First thing is to update the OS by running this command sudo apt-get update. Copy this line of code and put it into that SSH terminal. The second thing is to run this line of code to install the NGINX web server. So let's do it. Wow, that's a lot of code. Success! You can check by going up to the very top to see that the NGIX server is already installed. Next is to confirm that their server is running by copying this code into the terminal. To test that the web server is running, we are going to open up a web page to see that it is running. To do this, we have to go back to the cloud console and then run the IP address associated with this web server. Go back to the cloud console and you see this external IP next to our virtual machine. Click on it. And the welcome page for that web server will appear. Take a screenshot of this welcome page including the URL on top to submit for this assignment. Back to instructions and click on that check my progress button. You should get a green check and you're good to go to the next task. Fast number three is to create a new instance with Gcloud instead of the console. Instead of the console. So here we go. The step one here is to create a new virtual machine instance in the command line or basically it's in the cloud shell by running this line of code. So let's copy the line of code. and go to the cloud shell and paste it there and run it I will search for the cloud shell because I do not know where it is hidden click on open terminal and paste that code into the cloud shell There's an error with this line of code that comes from the dollar zone because that dollar zone is a variable It needs to be replaced by an actual value So when I run it first time you got an error then I replace it with an actual value and it works just fine that value is US dash East number four dash a Okay successful the VM is created. Doing the VM create task in the terminal is super fast because all the details is in one line of code as opposed to using it via the user interface or UI. Let's check our progress and we should get a green check and good to go It will be good practice to double check these details against what we have created to make sure that it is all correct. To see all the defaults for our VM, we can run this command. Let's take a look at our VM instances to make sure that now we have two of them because we have created two of them instead of one. To do this, just go back to the navigation, compute engine and then VM instances. there you go two VMs one created by the cloud console the other one created using the cloud shell next we are going to set up the ssh encrypted connection to the instance the second instance that we operated using cloud shell here is the command copy it and go to the cloud shell and paste it there It asks do you want to continue, say yes. Just hit enter for the passphrase. Then disconnect the SSH by just typing in the exit command. Success! Good job! This last task here is to test your knowledge. just go ahead and answer the question and you'll be you're done to wrap up here is the summary of what you need to deliver for this lab you need to provide three screenshots the first one is the screenshot of the cloud console showing your project id looks like this The second one is screenshot of your VM dashboard showing your two virtual machines that you have created. Looks like this. The third one is the screenshot of the webpage showing the NGINX welcome page. including the URL and then you need to write a one paragraph just one paragraph summary of your understanding of what you did in this lab and zip out all the files and submit it on canvas Congratulations! In this lab, we explored how to create and manage virtual machines or VMs in Google Cloud using both the Cloud Console as well as the command line GCloud. You learned how to set up a virtual machine. deploy a NGINX web server and connect it to your instance. That's awesome work because I don't think any of your peers have done this before. The key takeaway is that cloud computing allows businesses to quickly set up and run a applications without needing physical servers. It's like renting a server at a very low cost. Google Compute Engine makes it easy to scale resources, improve efficiency, and ensure reliability. By practicing both the visual interface as well as command line methods, you gain hands-on experience in managing cloud infrastructure. These skills are valuable for understanding how modern businesses use cloud technology to support their operations and to be competitive in their space. Good job! on completing this lab. I'll see you in the next class.