OPS705 Lab 2 (2207)
LAB PREPARATION
Purpose / Objectives of Lab 2
In this lab, you will learn how to create Windows and Linux virtual machines using a pre-built image, how to remotely connect to each, and basic management of these VMs from the Azure web interface. These two VMs will be used extensively in your later labs. This lab assumes you have completed Lab 1 successfully. Refer back to that lab for reminders on the basics of the Azure Dashboard interface.
While you are working through this lab, it is highly recommended that you write notes down in your OPS705 Lab Logbook. These are general notes and commands to help you remember how to do this lab. Each lab has its own page in the logbook. You may use this logbook during all quizzes, so fill it out accordingly!
If you encounter technical issues, please contact your professor via e-mail or in your section's Microsoft Teams group.
Minimum Requirements
Before beginning, you must have:
- Successfully completed Lab 1
- Watched the Week 2 video lecture
- Read through the Week 2 slides, and have them handy as a reference for concepts
- Your Seneca Azure login credentials
- Your linked mobile device for 2FA
- Your OPS705 Lab Logbook
INVESTIGATION 1: Managing a Windows Server 2016 VM in Azure
In this investigation, you'll create, configure, and manage a Windows Server 2016 Virtual Machine using Microsoft Azure and a pre-built image. This means no tedious and time-consuming Windows installation! You'll also login to the VM remotely, using Microsoft's Remote Desktop Protocol to share its desktop.
Part 1: Creating A Windows VM From An Image
To create your Windows Server 2016 Virtual machine, perform the following steps:
- Navigate to DevTest Labs > OPS705 > My virtual machines
- Click the + Add button.
- Wait for the Choose a base listing to populate. This may take a few moments.
- In the search field, type: Windows Server 2016 Datacenter
- Select the item titled Windows Server 2016 Datacenter exactly. Be careful here! There are many other options.
- A new blade, Create lab resource appears.
- In the Virtual machine name field, type: yourSenecaUsername-win (you only have 15 characters, you may need to abbreviate)
- Username: yourSenecaUsername
- Use a saved secret: Unchecked
- Password: Your choice, but use the same for all VMs and resources in this course.
- Save as default password: Checked.
- Virtual machine size: Standard_B2ms
- Leave the remaining options as they are.
- Click on the Create button at the bottom of the screen.
- You are now back in the My virtual machines blade while Azure creates your personal virtual machine. This may take a few minutes.
- When it finishes, you should see a Your deployment is complete. message near the top of the page. Congratulations!
- Click on the Go to resource button at the bottom left of the page and move on to the next section of the lab.
Part 2: Accessing Your Windows VM Remotely Using RDP
In this section, we'll discover how to remotely connect to the Windows Server's desktop environment over the Internet from your computer.
- In the Overview tab for the Virtual Machine created in Part 1, look for the IP address or FQDN entry. This is the address you will use to connect later in this section. Write it down (Hover over the URL, and you'll see a Copy to clipboard icon).
- Look for the NAT protocol entry. This is the port number you'll use to connect. Write this down as well.
- If you're on a Windows PC: Open the Remote Desktop Connection application. It comes pre-installed with the OS.
- If you're on a Mac: Download the Microsoft Remote Desktop app from the Mac App Store here.
- Open the Remote Desktop application.
- In the Computer field, enter the IP address and port you wrote down from step 1 and 2. Use the following format: URL:portnumber (Example: ops705108.canadacentral.cloudapp.azure.com:62245)
- In the User name field, enter your Seneca username.
- Click the Connect button.
- Type the password you used when creating the VM in Part 1.
- Accept the certificate warning. (Click yes.)
- You should see a login progress screen, and a Windows Server desktop after a few moments.
- Congratulations! You've set up a Windows Server VM and logged in remotely.
- Open Notepad, and write
My name is insertFullName, and I've completed the Windows Server VM investigation!
Save the file to your VM's desktop, with the filename yourSenecaUsername.txt. - Do not skip Part 3 at this stage! Otherwise, you'll be bleeding funds by leaving the VM running.
Part 3: Shutting Down Windows Safely
This section is fairly simple. The one thing to never forget: Ensure your VM's status is set to Stopped (Deallocated).
- In the Overview blade of your Windows Server VM, click on the Stop button.
- A notification will appear in the top right of your browser window, confirming your action.
- Don't worry about going into the Windows OS and shutting down first. Azure sends a signal to the VM to shut down safely.
- If your VM status says stopped, but does not include the (Deallocated) text, then resources are still being held by the VM and we're still being charged. The stop button will still be available, so click it.
- When you want to start the VM up again, click the Start button at the top of the blade.
- If you want to reboot the VM, do so from inside the OS.
INVESTIGATION 2: Managing a CentOS Linux VM in Azure
In this investigation, we'll create, configure, and manage a CentOS Minimal Virtual Machine using Microsoft Azure. This is a command line only OS, so you'll be using SSH to remotely connect to the VM and issue basic commands. This VM will be used extensively in Lab 3.
Part 1: Creating A CentOS VM From An Image
To create your CentOS VM, follow the steps from Investigation 1, Part 1, but with the following settings:
- Choose a base: CentOS-based 7.8
- Virtual machine name: yourSenecaUsername
- User name: yourSenecaUsername-lnx
- Authentication type: Password
- Use a saved secret: Unchecked
- Password: Same as your Windows Server VM
- Save as default password: Checked
- Virtual machine size: Standard_B1ms
- Click on the Advanced Settings tab.
- Under IP address, select Public.
- Click back to Basic Settings.
- Leave all other options as they are.
- Click Create!
When deployment is complete, click on the new VM in My virtual machines to verify its status and find the VM's address and SSH port. Write both down.
Part 2: Accessing Your CentOS VM Remotely Using SSH
We will be accessing our new Linux VM remotely using SSH, which is a command-line (CLI) only protocol. We'll be diving into CLI in more detail during our next lab.
Requirements: An SSH Client
- Windows: Download the PuTTY client here.
- macOS/Linux: Use the built-in Terminal application.
On Windows Using PuTTY:
- Open PuTTY
- In the Host Name (or IP address) field: Insert your address from Part 1. (Refer to Figure 7)
- In the Port field: 22
- Leave all other fields as their defaults.
- Click on the Open button.
- Click Yes on the security alert.
- In the login as: prompt, type your SenecaUsername, the press Enter.
- In the password field, type the password you gave when creating the VM. (You won't see anything as you type here; that's normal.)
- If login is successful, you should see a prompt like this:
[cjohnson30@cjohnson30-lnx ~]$
- To prove you've completed this section, run the following:
echo "My name is insertFullName, and I've completed the CentOS investigation!" > ~/lab2.txt
- To quit, type
exit
. Don't do this, yet! Move to Part 3.
On macOS/Linux Using Terminal:
- From the command line, type
ssh yourSenecaUsername@address
, press Enter. - When prompted for a password, use the one you gave when you created the VM. (You won't see anything as you type here; that's normal.)
- If login is successful, you should see a prompt like this:
[cjohnson30@cjohnson30-lnx ~]$
- To prove you've completed this section, run the following:
echo "My name is insertFullName, and I've completed the CentOS VM investigation!" > ~/lab2.txt
- To quit, type
exit
. Don't do this, yet! Move to Part 3.
Part 3: Shutting Down CentOS Safely
As with the Windows Server VM, shutting down safely is paramount for keeping your data and OS safe.
From the Linux command line:
- Type:
sudo systemctl poweroff
- Enter your password if asked.
In Azure's Overview of your CentOS VM:
- Ensure its Status is set to Stopped
That's it!
INVESTIGATION 3: Managing Your VMs Directly Through Azure's UI
In this quick investigation, we'll walk through how to directly manage virtual machines from the Azure Dashboard interface on a basic level. This is useful for starting up VMs, shutting them down when unresponsive, and deleting them when you're finished. (Warning: Do not delete either VM created in this lab!)
Part 1: Powering On / Restarting A Virtual Machine
From the DevTest Labs blade:
- Click on the My virtual machines menu bar item.
- Click on the virtual machine you'd like to manage.
- Click the Start menu button near the top.
Part 2: Powering Off A Virtual Machine
From the DevTest Labs blade:
- Click on the My virtual machines menu bar item.
- Click on the virtual machine you'd like to manage.
- Click the Stop menu button near the top.
Notice the difference between the status Stopped and Stopped (deallocated).
Part 3: Deleting A Virtual Machine
Part 4: A Note About Resource Usage
Lab Submission
Similar to Lab 1, just finish the lab! Your professor will have access to the two VMs you created and will verify your work. Once you've finished working on your lab, shut down (not delete!) your VMs to not waste funds. Your professor will spin them up again when marking.