Difference between revisions of "OPS335 Installation Lab draft"
(→First Boot) |
(→First Boot) |
||
Line 131: | Line 131: | ||
<li>Switch the view back to '''Console''' and start the machine again.</li> | <li>Switch the view back to '''Console''' and start the machine again.</li> | ||
</ul> | </ul> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
===Cloning a Virtual Machine=== | ===Cloning a Virtual Machine=== |
Revision as of 06:43, 9 January 2016
DRAFT COPIED FROM SOURCE 8 JAN2016 14:00
Contents
Objectives
There should be no new material for you in this page. Everything you need to do here you've already done in OPS235. That is to say - we won't spend much class time talking about installation, you're expected to be able to complete all this using your existing skills and knowledge.
- Install your host machine (Centos 7)
- Install 3 virtual machines (VMs) (Fedora 22 - Server)
- Prepare for Lab Exercises / Exploration Questions
Required materials
- Centos 7 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).
Part A: Host Installation
Installation instructions for Centos 7
- Download and burn on a DVD a copy of the Centos 7 installation DVD (64 bit edition) from the Centos web site or belmont. 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, and any computer you bought in the last few years for yourself will be 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
(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.) - Centos mirror list (available from any Internet connection): https://www.centos.org/download/mirrors/ (version: 7 (1511))
- Seneca's mirror of Centos: http://belmont.senecacollege.ca/pub/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso
- Insert your removable harddrive into the machine and boot from the DVD.
- Customize your installation following these guidelines:
- Turn on networking and use c7host as the hostname.
- Under software selection, choose Gnome desktop.
- The partition setup is similar to what you had in OPS235:
- Delete any old partitions.
- Click the link to create partitions automatically (this will give a typical layout with /, /boot, /boot/efi, /home, etc).
- 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.
- 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).
- Make certain that the existing partitions have the file system type ext4 (not xfs).
- After the installation starts you will also have the opportunity to create users.
- Set the root password
- Create a user account named with your Seneca ID
First boot
- In the current version of CentOS the first time you boot your system a licence prompt comes up. To save you some stress, here are the keys you need to press to get past it:
- 1
- 2
- c
- c
- Log in and check that you have access to the internet. If you don't - you need to get the network interface to come up on boot. Edit /etc/sysconfig/network-scripts/ifcfg-eno1 (the name of the interface may be different) and make change onboot to yes.
- Then you can use ifup/ifdown commands to reset your network configuration or you can just reboot.
- Disable 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 /etc/selinux/config file and follow the instructions inside.
- Install all the security updates using the yum command.
- write a script for this????????????????????????????
df -hT cat /etc/fstab cat /etc/issue uname -a
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 concentrate on iptables.
- Disable firewalld:
systemctl disable firewalld systemctl stop firewalld
- Install and enable the IPTables services:
yum install iptables-services systemctl enable iptables systemctl start iptables
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.
Record steps, commands, and your observations in Part A in your OPS335 lab log-book
Part B: 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. We'll be using the same libvirt and virt-manager you used in OPS235. You may find it helpful to refer back to the OPS235 notes if you don't remember the commands you need for these steps.
- Install the software you need
- Start and enable the virtualization service
- Reboot
- Start the graphical virtual machine manager (virt-manager). Do this as you regular user, 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 custom one in this course.
- Right click localhost (QEMU) and select Details.
- Click on the Virtual Networks tab.
- Stop and delete the default network.
- Use the plus sign to add a new virtual network using the following 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-090, the network address would be 192.168.90.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 Mode: NAT
- Ensure the network is started at boot.
VM Installation
With the virtualization software installed and your personal network created, you are now ready to create your first virtual machine. To do that you'll need the ISO file for CentOS (the same one you burned your DVD from. You should keep one somewhere on your host for the rest of this course.
- Create a new virtual machine named c7-vm1
- Use the default memory and CPU options for use with lab computers
- Set the disk image size set to 8GB
- The VM will be connected to your new ops335 virtual network
- You don't need to modify the disk layout, in fact leave most of the installation settings at defaults. Specifically - don't install a GUI on the virtual machine, none of your VMs in this course will have a GUI.
- The one option you should change is your hostname - make it vm1.localdomain
- 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.
First Boot
- You will notice that the server installation defaults to a command-line interface. This is normal, and we will only be using this interface during this course.
- Ensure your machine has a network connection by running the command
host cbc.ca
- If that did not work - make sure your network interface is started automatically on boot.
- Once you have a working connection - update your machine.
yum update
- Reboot the virtual machine once it is updated.
- If your virtual machine hangs on boot, you will need to change a graphics option:
- While the VM is off, click on View (from the menu at the top of the VM window), and select Details.
- From the menu on the left side, select Display.
- Change the drop-down list for Type from VNC to Spice, and click apply.
- Switch the view back to Console and start the machine again.
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 f22-vm2 and f22-vm3, with hostnames vm2.localdomain and vm3.localdomain respectively).
- 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:
- To quickly create additional VM's shutdown f22-vm1, right click and select Clone....
- Set the Name to be: f22-vm2
- Once successfully created, boot the new VM and correct the host name. This can be done using the hostnamectl command-line tool.
- Record in your notes how each is done.
- Use the host command to check for connectivity
- After creating f22-vm2 repeat the above steps to create f22-vm3 and correct the host name.
Record steps, commands, and your observations in Part B in your OPS335 lab log-book
Completing the Lab
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:
- ✓ Host Machine installed
- ✓ 3 virtual machines installed (running Fedora 22 Server)
- ✓ Each machine (host and VM) has access to the network
- ✓ Lab logbook completed
- ✓ Run a shell script to submit your lab:
Steps:
- Issue the following command to download the bash shell script:
wget http://matrix.senecac.on.ca/~peter.callaghan/files/OPS335/labcheck0.bash - Run the command:
- Issue the following command to download the bash shell script:
labcheck0.bash > lab0host.txt
- Follow the instructions and press SEND for marking (only 1 submission permitted)
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 UUID (Universally Unique Identifier) of your root file system? What command was used to obtain this information?
- 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.