Open main menu

CDOT Wiki β

Changes

OPS335 Installation Lab

1,565 bytes removed, 16:51, 10 January 2016
no edit summary
'''DRAFT COPIED FROM SOURCE 8 JAN2016 14:00'''
 
[[Category:OPS335]][[Category:OPS335 Labs]]
== Objectives ==
 
This lab is basically a repeat of portions of labs that you already performed in OPS235. You are expected to be able to complete all this using your existing skills and knowledge or refer back to your OPS235 lab-book or OPS235 WIKI notes.
 
<u>'''Main Topics'''</u>
 
*Install your host machine (Centos 7)
*Install 3 virtual machines (VMs) (Fedora 22 - ServerCentos 7)
*Prepare for Lab Exercises / Exploration Questions
== Required materials ==
*Centos 7 Full Installation DVD.*One SATA hard disk in a removable drive tray (minimum 250GB) - . It is strongly advised you dedicate a drive for this course only.*Recommended - USB drive (8 GB+) for creating and storing backups (Virtual Machines, configuration files).*OPS335 Lab Log-book (Previous OPS235 log lab-book as an additional resource).
 ==Part AINVESTIGATION 1: Host Installation HOST INSTALLATION==
=== Installation instructions for Centos 7 ===
# It may be advisable to obtain a <u>newer version</u> of the Centos 7 Full Installation DVD since there may be improvements since the last version from when you took OPS235.#Download and burn on a DVD a copy of the Centos 7 installation DVD (64 bit edition) from the Centos web site or belmontthe Belmont server. '''Note: ''' we'll be using the 64 bit version of Centos because all of our lab computers are equiped with Intel 64 bit mainboards and CPUs. We'll also be using a Fedora iso for installing the virtual machines, but and any computer you bought in the last few years for yourself will not need to burn that to a disc. It is faster to download the ISO and install directly from itbe 64bit as well.
#* '''Seneca's mirror of Centos:''' http://belmont.senecacollege.ca/pub/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso<br />(This is very fast, but is only accessible from within Seneca's network - you can't access this from home. You can burn this disc on the machines in the Open Lab.)<br />
#* '''Centos mirror list (available from any Internet connection):''' https://www.centos.org/download/mirrors/ (version: '''7 (1511)''')<br />
#Insert your HDD removable harddrive into the docking bay of a PC in the lab machine and boot from the computer using your installation DVD. If possible try {{Admon/tip |Boot order|Some of our machines' boot order is configured to use the same PC for this course for the rest of the semesterbe Harddrive first, DVD second. Some PCs may Which means you won't be configured with slight hardware variations able to boot from others which may cause problems when moving the DVD if you already have an operating system installed on your HDD from one system to anotherdrive. }}#Most modification is now perform through a single summary screen. Use it to customize <ol><li value=4>Customize your installation following these guidelines:#*Set Date &amp; Time<ul>#*<li>'''Turn on networking''' and use '''your Seneca IDc7host''' as the '''hostname'''.#*<li>Under software selection, choose '''Server with gui''', and ensure you enable the software package 'Gnome desktop''KDE''' (located on the right-hand-side).#*For installation destination, select your drive (not the one internal <li>The partition setup is similar to the PC), and select the option to manually configure partitioning.what you had in OPS235:<ul>#**<li>Delete any old partitions.#**<li>Click the link to '''create partitions automatically''' (this will give a typical layout with /, /boot, /boot/efi, /home, etc).#**<li>Free up at least 100GB of disk space by shrinking the '''/home''' partition. Since your machine will have far fewer users and more virtual machines than a typical installation, we will need that space elsewhere.#**<li>Create a new logical volume for '''/var/lib/libvirt/images''' and give it the space made available by shrinking /home (You will need enough space for 10 virtual machines at 8GB each plus room to compress/extract images). You may wish to keep some extra space left unassigned in case you need some space later, but the majority of the space you will need will be for ''/var/lib/libvirt/images''.#**<li>Make certain that the existing partitions have the file system type '''ext4''' (not xfs).#During </ul></ul><li>After the installation process starts you will also have the opportunity to create users.#*set <ul><li>Set the root password#*create <li>Create a '''user account''' named with '''your Seneca ID'''#After completing the installation, remove the DVD and reboot from your HDD.</ul></ol>
=== Booting your system First boot ===
#Login as In the user current version of CentOS the first time you created and open boot your system a terminal windowlicence prompt comes up. Then use To save you some stress, here are the keys you need to press to get past it::: '''1''' ''ENTER'':: '''2''' ''ENTER'':: '''c''' ''ENTER'':: '''c''' 'su' to become root and run the ENTER'yum update' command. Reboot after all updates <ol><li value="2">Log in and check that you have completed. Now that your system is up access to date, again login using your learnid and do the following:#*Verify that your system date and time are correctinternet. If not then set you don't - you need to get the correct system date and time.#*Verify that your network is functioninginterface to come up on boot.#**If you do not have an ip address, edit the line in either the file Edit '''/etc/sysconfig/network-scripts/ifcfg-eno1''' or (the name of the interface may be different) and make change '''/etc/sysconfig/network-scripts/ifcfg-eth0onboot''' (note this file name may differ between machines). onboot=no:should be: to '''onboot=yes'''.<olul><li value="2">If You can then use the '''ifup'''/'''ifdown''' commands to reset your network configuration or you had to change that, can just reboot your machine before continuing.</li><li/ul>Run and record the purpose and output after issuing the following commands:</li></olli> '''df -hTDisable SELinux'''or else you may run into unnecessary problems during the course. SELinux is an important technology but we won' t have time to cover it in this course. To disable it edit the '''cat /etc/fstabselinux/config''' '''cat file and follow the instructions inside.</etc/issueli><li>Install all the security updates using the ''' '''uname -ayum update'''command.</li></ol>
===Using iptables===
The most recent variants of Centos and Fedora are using a service called '''firewalld''' that is intended to replace '''iptables''', however the ''iptables'' service is still in relatively common usage. In this course we will keep running concentrate on ''iptables'' on the host machine, and gain experience with the new service (.<ol><li>Disable firewalld) on the virtual machines.:#install and enable iptables<source lang="bash"> '''yum install iptables-services'''systemctl disable firewalld '''systemctl enable iptables'''stop firewalld</source></ol><ol><li value="2">disable firewalld by issuing Install and enable the commandIPTables services:<brsource lang="bash">yum install iptables-servicessystemctl enable iptablessystemctl start iptables</lisource></ol>At this point you have a basic Centos system installed and updated. This will serve as a host for the virtual machines where you will do the majority of the work in this course. All the rest of our labs will assume you have this basic system running. If, for any reason, your system becomes corrupted during the semester, you'''systemctl disable firewalld'''ll have to redo this lab to be able to continue with the remaining uncompleted labs. You are responsible for YOUR system. If you do not perform back-ups you have taken this risk on yourself. Poor planning on your part does not constitute an emergency for anyone else.
<ol><li value="3">Note that the machine will not switch over to using ''iptables'' until you rebootRecord steps, but you will be doing that shortlycommands, so there is no need to do so right now.</li></ol>and your observations in INVESTIGATION 1 in your OPS335 lab log-book'''
===Configuring a Linux Gateway===
At this point you have a basic Centos system installed and updated. This will serve as a host for the virtual machines where you will do the majority of the work in this course. All the rest of our labs will assume you have this basic system running. If, for any reason, your system becomes corrupted during the semester, you'll have to redo this lab to be able to continue with the remaining uncompleted labs. You are responsible for YOUR system. If you do not perform back-ups you have taken this risk on yourself. Poor planning on your part does not constitute an emergency for anyone else.
==INVESTIGATION 2: VIRTUAL MACHINE INSTALLATION== ===Configuring a VM host=== #You will need to install some software to allow your machine to act as a host for virtual machines. Issue We'll be using the same '''libvirt''' and '''virt-manager''' you used in OPS235.<br>You may find it helpful to refer back to the '''OPS235 notes''' to perform the following commandoperations: '#* Install the required virtualization software#* Start and enable the virtualization service#* Reboot your host machine<br><br># Start the graphical virtual machine manager (''yum install virt-manager libvirt''). Do this as you regular user, and don't run virt-manager from a terminal where you're logged in as root.# We will be creating our own virtual network. A default virtual network has been created for you, but you will be using a <olu>custom<li value="2"/u>Start one in this course.#* Right click '''localhost (QEMU)''' and select '''Details'''.#* Click on the '''Virtual Networks''' tab.#* Stop and enable delete the '''default''' network.#* Use the '''plus sign''' to add a new virtual network using the virtualization servicefollowing options:#** Name your virtual network '''ops335'''#** Use the '''last two digits of your student number for the third octet of network IP address''' (for example, if your student number is 000-000-0<b>90</lib>, the network address would be 192.168.<b>90</olb>.0/24.#** Ensure the DHCP range will allow you to assign '''at least 10 static IP addresses outside it'''. #** Choose '''Forwarding to physical network''' radio button, '''Destination: Any physical device''' and '''systemctl start libvirtdMode: NAT''' #** Ensure the network is '''systemctl enable libvirtdstarted at boot'''.
<ol><li value="3">Reboot your machine. If you do not, you will not be able to install any virtual machines.</li><li>Start the graphical virtual machine manager (''virt-manager'')<ul><li>You will need to enter your root password.</li></ul><li>We will be creating our own virtual network. A default virtual network has been created for you, but you will be using a <u>custom</u> one in this course.<ul type="a"><li>Right click '''localhost (QEMU)''' and select '''Details'''. Click on the '''Virtual Networks''' tab.</li><li>Stop and delete the '''default''' network.</li><li>Run, and record the output of the following command:</li></ul></li></ol> '''iptables -t nat -L'''<ol><li value="6">Use the '''plus sign''' to add a new virtual network using the following options.<ol typeVM Installation==="a"><li>Name your virtual network '''ops335'''</li><li>Use the '''last two digits of your student number for the third octet of network IP address''' (for example, if your student number is 000-000-0<b>90</b>, the network address would be 192.168.<b>90</b>.0/24.</li><li>Ensure the DHCP range will allow you to assign '''at least 10 static IP addresses outside it'''.</li><li>Choose '''Forwarding to physical network''' radio button, '''Destination: Any physical device''' and '''Mode: NAT'''</li><li>Ensure the network is '''started at boot'''.</li></ol></li><li>Once completed changing these settings, open a terminal and observe and record the output of the following command (noting the difference from the last time you ran it. We will discuss it in a few weeks):</li></ol> '''iptables -t nat -L'''
With the virtualization software installed and your personal network created, you are now ready to create your first virtual machine. You will need an ISO file for CentOS 7 (the same one you burned your DVD from). It is recommended to use the wget command to download this image onto your host machine. In this way, you can keep it on your host machine for the remainder of this course in case you need it.
'''Record Perform the following steps, commands, and to create your observations in Part A in first Centos7 VM on your OPS335 lab log-book'''Virtual Machine Manager application:
==Part B: Virtual Machine Installation ==With the virtualization software installed and your personal network created, you are now ready to create your first virtual machine. If you have an installation DVD for Fedora you can use that, but it will be much faster to download the iso from belmont and install directly from it. '''wget http://belmont.senecacollege.ca/pub/fedora/releases/21/Server/x86_64/iso/Fedora-Server-DVD-x86_64-21.iso''' If it has not been made available use the publicly available link: '''wget --no-check-certificate https://download.fedoraproject.org/pub/fedora/linux/releases/22/Server/x86_64/iso/Fedora-Server-DVD-x86_64-22.iso'''===Installation===#Click on the icon '''Create a new virtual machinenamed ''' to begin.#Name your machine '''f22c7-vm1''' and choose your installation method: '''Local install media'''. Choose the desired option to install from either the CD or iso.#Use the default memory and CPU options for use with lab computers (Depending on available hardware these settings can be adjusted). Then click on the '''Forward''' button to proceed.#Leave Set the disk image size set at to '''8GB''' and click on the '''Forward''' button.<ol><li value="5">At the # The VM will be connected to your new ops335 virtual network# You don'''Ready t need to begin modify the disk layout, in fact leave most of the installation''' window click settings at defaults.# For Software Selection: Do NOT install a GUI on '''Advanced options''' arrow to review available optionsthe virtual machine, none of your VMs in this course will have a GUI.<ul><li>Select the Virtual Network named '''ops335server'''instead. Make note of any other available options (you will need them again in the assignments).</li></ul></li></ol><ol><li value="6">Select # Ensure that your host-name is set to: '''Install to Hard Drivevm1.localdomain''' to begin your Fedora installation. Select the appropriate default options (You may wish to review your OPS235 notes to remind yourself what these are).</li><li># During installation you will be prompted to set the root password and an initial user account. For the initial user, enter the same information you entered on your host machine.</li><li>Set your hostname to '''vm1.localdomain'''.</li></ol>
{{Admon/importanttip|Firstboot - First user created|For successful completion of the labs, please ensure the first user created is named using your Seneca username.}}
===First Boot===
#Ensure your machine has a network connection by running the command
'''host cbc.ca'''
<ol><li value="3">If that did not work, edit the line in the file '''/etc/sysconfig/network-scripts/ifcfg-eno1''' or '''/etc/sysconfig/make sure your network-scripts/ifcfg-eth0''' interface is started automatically on boot.</li></ol> {{Admon/tip|Default for network config for onboot=no:should |If you've turned on your networking interface during installation - it will be '''onboot=yes''turned on by default. If you've left the network interface off during the installation - it will be off by default.}}<ol><li value="4">If you had to change that, reboot your machine.</li><li>Once you have a working connection - update your machine (this may take a while).</li></ol>
'''yum update'''
<ol><li value="65">Reboot the virtual machine once it is updated.</li><li>If your virtual machine hangs on boot, you will need to change a graphics option:<ul><li>While the VM is off, click on '''View''' (from the menu at the top of the VM window), and select '''Details'''.</li><li>From the menu on the left side, select '''Display'''.</li><li>Change the drop-down list for Type from '''VNC''' to '''Spice''', and click apply.</li><li>Switch the view back to '''Console''' and start the machine again.</li><li>Now run the following commands and note the output.</li><li>Issue the commands below and note in your lab logbook how they differ from the Centos installation on your host.</li></ul></li></ol> '''df -hT''' '''cat /etc/fstab''' '''cat /etc/issue''' '''uname -a'''
===Cloning a Virtual Machine===
#Now that you have one virtual machine working, you will create two more. If you struggled with the previous steps, repeat them to create two more virtual machines (naming them '''f22c7-vm2''' and '''f22c7-vm3''', with hostnames '''vm2.localdomain''' and '''vm3.localdomain''' respectively).<ol><li value="2">If you are confident with what you have done so far, you may clone your existing machine to create the others by following there steps:<ul><li>To quickly create additional VM's VMs shutdown ''f22c7-vm1'', '''right click''' and select '''Clone...'''.</li><li>Set the Name to be: '''f22c7-vm2'''</li><li>Once successfully created, boot the new VM and correct the host name. This can be done using the hostnamectl command-line tool.</li><li>Record in your notes how each is done.</li><li>Use the host command to check for connectivity</li><li>After creating f22c7-vm2 repeat the above steps to create f22c7-vm3 and correct the host name.</li></ul></li></ol>
'''Record steps, commands, and your observations in INVESTIGATION 2 in your OPS335 lab log-book'''
'''Record steps, commands, and your observations in Part B in your OPS335 lab log-book'''
 == Completing the Lab COMPLETING THE LAB ==
[[Image:lab1_signoff.png|thumb|right|500px|Students should be prepared with '''all required commands (system information) displayed in a terminal (or multiple terminals) prior to calling the instructor for signoff'''.]]
'''Arrange evidence (command output) for each of these items on your screen, then ask your instructor to review them and sign off on the lab's completion:'''
::<span style="color:green;font-size:1.5em;">&#x2713;</span> Host Machine installed
::<span style="color:green;font-size:1.5em;">&#x2713;</span> 3 virtual machines installed (running Fedora 22 Server)
::<span style="color:green;font-size:1.5em;">&#x2713;</span> Each machine (host and VM) has access to the network
::<span style="color:green;font-size:1.5em;">&#x2713;</span> Lab logbook completed
::<span style="color:green;font-size:1.5em;">&#x2713;</span> Run a shell script to submit your lab:<br> &nbsp; &nbsp; '''Steps:'''
::*Issue the following command to download the bash shell script:<br>'''wget http://matrixscs.senecac.onsenecacollege.ca/~peterandrew.callaghan/filessmith/OPS335ops335/labcheck0labcheck_install.bashsh'''::*Run the commandscript (don't forget to give it execute permissions):<br> '''labcheck0.bash > lab0hostlabcheck_install.txtsh'''::*Follow the instructions and press SEND for marking (only 1 submission permitted) 
== Exploration questions EXPLORATION QUESTIONS==
#What is the code name of your installed Fedora Linux system? How did you determine this?
#What kernel release is your host system running?
#What kernel release are your virtual machines running?
#What is the size and type of the /boot file system on your host?
#What file was edited to change the host name on your VM's?
#Explain the iptables rules displayed when you ran the command 'iptables -t nat -L'. How did they change after creating your personal network.
13,420
edits