Changes

Jump to: navigation, search

OPS235 Lab 2 - CentOS7

596 bytes added, 12:28, 24 September 2018
no edit summary
[[Category:OPS235]]
 {{Admon/caution|THIS IS AN OLD VERSION OF THE LAB|'''This is an archived version. Do not use this in your OPS235 course.'''}}
= LAB PREPARATION =
# Open a web-browser, and open the OPS235 Lab #2 WIKI.
# Open a shell terminal.<br><br>'''WARNING:''' You must perform a '''yum update''' on your '''c7host''' machine before proceeding with the next steps.<br><br>
# You will need to download an image file for the Centos7 LIVE DVD by issuing the following command (best works while at Seneca):<br><b><code><span style="color:#3366CC;font-size:1.2em;">wget http://belmont.senecac.on.ca/centos/7/isos/x86_64/CentOS-7-x86_64-LiveGNOME-15031511.iso</span></code></b><br><br>
# Install the virtualization software by issuing the command:<br><b><code><span style="color:#3366CC;font-size:1.2em;">yum install qemu-kvm qemu-img virt-manager libvirt libvirt-python \<br>python-virtinst libvirt-client virt-install virt-viewer bridge-utils</span></code></b> <br><br>
:'''VM Details:'''
:: '''VM Name(and hostname):''' centos1
:: '''Boot media:''' LIVE CD Image
:: '''Installation source:''' Downloaded Centos7 LIVE CD image (http://belmont.senecac.on.ca/centos/7/isos/x86_64/CentOS-7-x86_64-LiveGNOME-1511.iso)
:: '''CPUs:''' 1
# Make certain you used the wget command to download the LiveGNOME iso file from the Belmont server (from previous instructions).
# In the Virtual Machine Manger, click on the icon to ''Create a Virtual Machine'' in the upper-left corner:
# A window will appear with the title ''New VM''. There are five steps to be completed; click Forward after each step:
# '''Step 1 of 5:'''Select '''Local install media''' and click '''Forward'''.
# '''Step 2 of 5:''' Select '''Use ISO Image''', click the '''Browse''' button, and then the '''Browse Local''' button. Navigate to the location of the downloaded Centos7 LIVE CD image, select the image file and click '''Open'''. When finished, click Forward to proceed. If an error message appears regarding search permissions, just click '''yes''' to proceed.<br><br>'''NOTE:''' Select from the installation menu '''Troubleshooting''' and then select '''Install in Basic Graphics Mode'''.<br><br>
# '''Step 3 of 5:''' Set the memory to '''2048 MB''' and the number of CPUs to '''1'''
[[Image:vm-path.png|thumb|right|300px|It is extremely important to '''correctly specify the VM image file path-name'''. Double-check the spelling of the path-name before proceeding!]]
  # <ol><li value="7">'''Step 4 of 5:''' This next step creates a disk file that will be used to simulate the virtual machine's disk drive. Select a size of '''10 GB'''. Click on<br> '''Select managed or other existing storage''' and type the VM image file pathame:<br> '''/var/lib/libvirt/images/centos1.img''' (make certain that the pathname is correct) and then click '''Forward''' to proceed.# </li><li>'''Step 5 of 5:''' Enter the virtual machine name: '''centos1'''. Review the VM information, and click '''Finish'''.<br><br>#</li><li>'''The virtual machine will now start''' - start timing your installation and making notes for '''centos1''' virtual machine in the installation comparison chart in lab2 logbook. The virtual machine is running from the live disc at this point, and no software has been installed on the ''hard drive'' of the virtual machine. The point of a live disk is to allow you to test the distribution to see whether you like it without installing to the hard-drive first.#</li><li>Double-click '''Install to Hard Drive'''. The installation program, similar to the one used when installing CentOS in Lab 1, will appear. You basically perform the same installation operations for this VM including for '''Date & Time''', '''Network & Hostname''', and '''Installation Destination'''. Make certain to use the '''hostname''': '''<u>centos1</u>''' as opposed to ''c7host'') for this installation. (with a few slight differences).#</li><li>For '''Installation Destination''', select the destination option: '''I will configure partitioning''' and then click '''Done'''. Make certain that the '''Partition Scheme''' is set to '''LVM''' and then click on the link: '''Click to Create Automatically'''. '''Done'''. Check to make certain that the root partition has file system type: '''ext4'''.#</li><li>Accept the changes and then click '''Begin Installation'''.#<ol type="a"><li>You will be required to make selections very similar to what you did in lab1.#</li><li>While the system is installing, take a few minutes to record your observations (including slight differences with centos1 install as opposed to c7host install).#</li><li>When the installation process is complete, note the time required to install this system and record in the installation comparison chart of your lab2 logbook.<br><br>#</li></ol></li><li>Power-off your Centos7 LIVE system.#</li><li>You should notice that the Centos7 boot menu appears. Either press '''ENTER''' to start or wait for it to start automatically.#</li><li>Finish the final steps in the setup process (like you did in lab1).</li><li>#You may want to turn off the screen-saver (like you did in Lab1): [http://zenit.senecac.on.ca/wiki/index.php/OPS235_Lab_1_-_CentOS7#Customizing_Your_Account How to Turn-off Screen Saver (lab1)]</li></ol>
{| width="40%" align="right" cellpadding="10"
|- valign="top"
|}
<ol>
<li value="1413">Enable SSH access to your virtual machine with these commands (semi-colon allows commands to be run in sequence):<br /> <b><code><span style="color:#3366CC;font-size:1.2em;">service sshd start; chkconfig sshd on</span></code></b></li>
<li>Find out the IP address of your virtual machine and the name of your Ethernet network adaptor: <b><code><span style="color:#3366CC;font-size:1.2em;">ifconfig</span></code></b> </li>
<li>Enter the following command on your virtual machine to create a firewall exception to allow ssh traffic into the machine:<br /> <b><code><span style="color:#3366CC;font-size:1.2em;">iptables -I INPUT -p tcp -s0/0 -d0/0 --dport 22 -j ACCEPT</span></code></b></li><li>If you are logged in as root, logout to your regular user account.</li><li>Confirm that you can ssh to your virtual machine from the host (your main CentOS installation): <b><code><span style="color:#3366CC;font-size:1.2em;">ssh regularuserid@IPaddress</span></code></b> (where '''regularuserid''' is your regular user login id, and '''IPaddress''' is the '''IP_ADDRESS''' of your '''centos1''' VM!).</li><li>Make certain to '''disable SELinux for centos1''' (refer to lab1)</li><li>Adjust your screen-saver settings and run a '''yum update''' on your centos1 VM before proceeding to ''Part 2'',</li></ol>
:'''VM Details:'''
:: '''VM Name(and hostname):''' centos2
:: '''Boot media:''' Network installation
:: '''Installation source URL:''' http://belmont.senecac.on.ca/centos/7/os/x86_64/
:'''VM Details:'''
:: '''VM Name(and hostname):''' centos3
:: '''Boot media:''' Network installation
:: '''Installation source URL:''' http://belmont.senecac.on.ca/centos/7/os/x86_64/
# Take a look at the kickstart file (eg. view url in a webj-browser) to determine the root password as well as the name and password for the first user account!
# Boot the virtual machine and log in (use the user ID and password information from the previous step). Compare the experience to the first time you booted the other virtual machines. Record this information in the '''table contained in Investigation 4'''.
#You may want to turn off the screen-saver (like you did in Lab1): [http://zenit.senecac.on.ca/wiki/index.php/OPS235_Lab_1_-_CentOS7#Customizing_Your_Account How to Turn-off Screen Saver (lab1)]
# Repeat the steps as you did to '''start the SSH service''', '''set iptables to accept connections via ssh''', '''test connections between centos3 and c7host''', and '''disable SELinux''' (refer to lab1).
# Remember that centos3 is text-based interface only (no graphics). To recover from a blank screen, press a key (like the SPACE key) to return to the screen display.
# Record the time taken to install, and compare this to the time taken by the previous installations. Record your findings in the Installation Comparison chart in lab2 logbook.
 
=INVESTIGATION 2: MANAGING VIRTUAL MACHINES=
</ol>
::* In order to fully back up a virtual machine, what information should be saved in addition to the virtual machine image?
<ol><li value="24">A previous OPS235 student graciously created a shell script that you can download and run to check to see how you performed this lab (to see if you are on the right track).<br>Simply issue the command: <b><code><span style="color:#3366CC;font-size:1.2em;">wget http://matrix.senecac.on.ca/~murray.saul/ops235/lab2check2.bash</span></code></b> and run on your '''c7host machine'''.<br><br>'''If the shell script indicates any major errors, please inform your OPS235 instructor or lab assistant to advise what to do'''.<br><br></li></ol>
'''Answer the Investigation observations / questions in your lab log book.'''
'''Arrange proof of the following on the screen:'''
<ol><li><span style="color:green;font-size:1.5em;">&#x2713;</span> '''<u>All</u> VMs''':<blockquote><ul><li>Working virtual machines '''created''' and '''running'''</li><li>'''Disk layout''' and '''size''' correct on all virtual machines</li><li> Proof of '''yum updates'''</li><li>'''All virtual machines backed-up''' (eg. usb stick and/or home directory)</li></ul></blockquote></li><li><span style="color:green;font-size:1.5em;">&#x2713;</span>'''c7host''' machine:<blockquote><ul><li>'''Correct VM image filenames''' contained in '''/var/lib/libvirt/images directory'''</li><li>'''Disk layout''' and '''size''' correct on all virtual machines</li><li>Creation of your bash shell script called '''backupVM.bash'''</li><li>A list of your '''iptables''' rules(command: '''iptables -L''')</li></ul></blockquote></li><li><span style="color:green;font-size:1.5em;">&#x2713;</span> Lab2 logbook notes and '''Installation Comparison chart''' completed</li></ol>
== Practice For Quizzes, Tests, Midterm &amp; Final Exam ==

Navigation menu