Changes

Jump to: navigation, search

OPS705 Lab 1

13,313 bytes added, 00:33, 9 September 2021
Created page with "= LAB PREPARATION = === Purpose / Objectives of Lab 1 === In this lab, you will login to Microsoft Azure for the first time, navigate your way to DevTest Labs, and spin up tw..."
= LAB PREPARATION =

=== Purpose / Objectives of Lab 1 ===
In this lab, you will login to Microsoft Azure for the first time, navigate your way to DevTest Labs, and spin up two VM images. The main purpose of this lab is to 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.

While you are working through this lab, it is highly recommended that you write down general notes and commands to help you remember how to do this lab. You may use your notes during tests, 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:
# Attended the Week 1 lectures (or watched the posted recording)
# Your Seneca Azure login credentials
# A mobile device (phone/tablet) to setup 2FA (two-factor authentication)

= INVESTIGATION 1: Connecting to Your Azure Account =
In this investigation, you'll log in to your Seneca-provided Azure account and ensure you have access to our DevTest Labs classroom.

== Part 1: Logging In For The First Time ==
# Follow the link to our DevTest Lab in Azure: [https://portal.azure.com/#@mystudentlab.ca/resource/subscriptions/92ac8b8a-d24f-4a8b-a288-874b50947e15/resourceGroups/OPS705/providers/Microsoft.DevTestLab/labs/OPS705-2211-NAA OPS705 DevTest Lab]
# Enter your Seneca credentials. (Same username and password you use for your e-mail)
# You'll next be asked to set up two-factor authentication. Do not bypass this step!
# Once you've set that up, verify it by logging out and logging back in again.
# Conduct a small celebration (pat on the back, a quick jig, perhaps a fist pump) and move on to Investigation 2.

== Part 2: Logging In Afterwards ==
Logging in after initial setup is quite easy.
# Nagivate to the Azure portal: https://portal.azure.com
# Use your Seneca credentials.
# Complete 2FA authentication.
# Our classroom DevTest Lab will be in your recent list. (You can always use the search bar to bring up DevTest Labs)

= INVESTIGATION 2: Managing a Windows Server 2019 VM in Azure =
In this investigation, you'll create, configure, and manage a Windows Server 2019 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 ==
[[Image:Ops705_lab2_fig5.png|thumb|right|300px|Figure 1. A partial view of the ''Basics'' tab on the VM creation page.]]
To create your Windows Server 2019 Virtual machine, perform the following steps:
# Navigate to ''DevTest Labs > OPS705-2211-NAA > My virtual machines''
# Click the '''+ Add''' button.
# Wait for the ''Choose a base'' listing to populate. This may take a few moments.
# Select the item titled '''Windows Server 2019 Datacenter (Gen2)'''. 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_B2s'''
# ''OS disk type'': '''Standard HDD'''
# 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 ==
[[Image:Ops705_lab2_fig6.png|thumb|right|275px|Figure 2. The ''Remote Desktop Connection'' application on Windows.]]
In this section, we'll discover how to remotely connect to the Windows Server's desktop environment over the Internet from your computer. It's a very simple process.
# In the ''Overview'' tab for the Virtual Machine created in Part 1, click the '''Connect''' button. This will download an RDP profile file (usually ''vmname.rdp'').
# Open the RDP file. It should launch the Remote Desktop application and automatically try to connect to your VM.
# Upon opening, the VM's URL, port number, and username are automatically provided.
# 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 <code>My name is ''insertFullName'', and I've completed the Lab 5 Windows Server VM investigation!</code> 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: Fully Stopping Your Windows Virtual Machine ==
[[Image:Ops705_lab2_fig7.png|thumb|right|375px|Figure 3. Overview blade for the winserv VM. Notice its status.]]
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.

= INVESTIGATION 3: 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 6.

== Part 1: Creating A CentOS VM From An Image ==
[[Image:Ops705_lab2_fig8.png|thumb|right|500px|Figure 4. Searching for a CentOS 7.8 Minimal image.]]
To create your CentOS VM, follow the steps from ''Investigation 2, Part 1'', but with the following settings:

# '''Choose a base:''' CentOS-based 7.9
# '''Virtual machine name:''' yourSenecaUsername-lnx
# '''User name:''' yourSenecaUsername
# '''Authentication type:''' Password
# '''Use a saved secret:''' Unchecked
# '''Password:''' Same as your Windows Server VM
# '''Save as default password:''' Checked
# '''Virtual machine size:''' Standard_B1s
# 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 ==
[[Image:Ops705_lab2_fig9.png|thumb|right|450px|Figure 5. The initial PuTTY screen on Windows.]]
We will be accessing our new Linux VM remotely using SSH.

Requirements: An SSH Client
# Windows: Use the built-in Command Prompt, or download the PuTTY client [https://the.earth.li/~sgtatham/putty/latest/w64/putty-64bit-0.74-installer.msi here].
# macOS/Linux: Use the built-in ''Terminal'' application.

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 in this section. Write it down (Hover over the URL, and you'll see a ''Copy to clipboard'' icon).

'''On Windows Using Command Prompt, or macOS/Linux Using Terminal''':
# From the command line, type <code>ssh ''yourSenecaUsername''@''address''</code>, press Enter. (Use the address from the ''Overview'' tab'').
# 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: <code>[cjohnson30@cjohnson30-lnx ~]$</code>
# To prove you've completed this section, run the following: <code>echo "My name is ''insertFullName'', and I've completed the Lab5 CentOS VM investigation." > ~/lab5.txt</code>
# To quit, type <code>exit</code>.

On Windows Using PuTTY (alternative):
# Open ''PuTTY''
# In the '''Host Name (or IP address)''' field: Insert your address from ''Part 1''. (Refer to ''Figure 5'')
# 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: <code>[cjohnson30@cjohnson30-lnx ~]$</code>
# To prove you've completed this section, run the following: <code>echo "My name is ''insertFullName'', and I've completed the CentOS investigation." > ~/lab2.txt</code>
# To quit, type <code>exit</code>.

== Part 3: Fully Stopping your CentOS VM ==
As with the Windows Server VM, fully deallocating your VM is essential to responsible usage.

# Click on the '''Stop''' button at the top of the VM's Overview blade.

That's it!

= INVESTIGATION 4: 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 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 to move to its ''Overview'' blade.
# 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 to move to its ''Overview'' blade.
# Click the '''Stop''' menu button near the top.

Remember the difference between the status ''Stopped'' and ''Stopped (deallocated)''!

== Part 3: Restarting A Virtual Machine ==
There are two methods to restarting a VM. Either within the OS, or through the Azure Dashboard.

Inside the OS:
* Windows: Click on Start, and select Power Off.
* Linux: From the command line (SSH), type <code>sudo reboot</code>
In either OS, you will be disconnected from your remote session. Wait a few minutes while the VM restarts, and reconnect.

From Azure Dashboard:
# Click on the '''Restart''' button from the VM's ''Overview'' blade.
# Wait until the VM's status has changed to '''Running''' before logging back in.

== Part 4: Deleting A Virtual Machine ==
Deleting a Virtual Machine is useful when you no longer need it long-term, or if there's a catastrophic issue with the OS inside. Be careful! Any saved data inside the VM will be deleted as well!
# Navigate to the VM's ''Overview'' blade.
# If the VM status isn't '''Stopped (Deallocated)''', stop the VM. Wait until its status updates.
# Click on the '''Delete''' button at the top of the blade.

== Part 5: A Note About Resource Usage ==
As mentioned during our lecture and throughout this lab, using resources responsibly is incredibly important. We pay for what we use. While we have a failsafe in place to stop all VMs at 5:00am EST daily, don't rely on it! Fully stop your VMs when you're not using them.

Your total allowed resource allocation has been restricted for this course. This means you can only have two VMs (or services) at a time. If you have two already, you won't be able to add another until you delete one.

= Lab Submission =
Submit to Blackboard's ''Lab Submission'' section full-desktop screenshots (PNG/JPG) of the following:
# Your view of the OPS705 DevTest Labs Overview blade.
# The Azure ''Overview'' blade for your '''Windows Server''' VM.
# The Azure ''Overview'' blade for your '''CentOS''' VM.
# A full desktop screenshot of the text file created for your Windows VM, open in Notepad.
# A screenshot of your CentOS remote SSH session after running the command: <code>cat ~/lab5.txt</code>

Your professor will review your VMs directly; the screenshots are a backup in case of catastrophic issues.

'''Your professor will not check your lab until the screenshots have been submitted.'''

Make sure to fully stop your VMs when you're done!

[[Category:OPS705]]
[[Category:OPS705 Labs]]
[[Category:Digital Classroom]]
[[Category:Fall 2021]]

Navigation menu