Open main menu

CDOT Wiki β

Changes

OPS235 Lab 2 - CentOS7 - VMware

4,156 bytes removed, 18:26, 22 May 2016
no edit summary
== Purpose / Objectives of Lab2==
[[Image:hostmachinevmware-1.png|thumb|right|300px550px|The c7host centos1 Linux server will run virtualization software to install and run 3 virtual machines (installed in lab2). ]]
'''In this lab, you will create three virtual machines'''. This also gives you an opportunity to experiment with different ways of installing CentOSLinux.
<br><br>
<u>Main Objectives</u>
* '''Installing Virtualization Software''' on your '''c7host''' machine
* '''Create 3 separate VMs (virtual machines) using different installation methods:'''
:* Centos Live DVDInstallation
:* Network Centos Installation without configuration file:* Network Centos Installation with configuration file (Kickstart)
* Understand the '''advantages and disadvantages of each type of installation''', and be able to '''select the best installation method''' for a particular situation.
* '''Manipulate virtual machines by CLI''' (virsh)
* '''Properly backup VMs and VM configuration''' in virtual manager application onto home directory and to external source (USB Key)
* Observe how '''Bash Shell Scripting''' can be used to automate routine tasks involving VM management
 
 
== What is a Virtual Machine?==
 
A '''virtual machine''' is a software simulation of a computer which can be used as though it were actual hardware. It's possible to run multiple virtual machines on one computer, reducing hardware requirements and promoting flexibility when working with multiple operating systems. Some common uses of virtualization include:
 
:* '''Software testing''' -- Using multiple operating systems simultaneously on a single computer for testing and experimentation.
:* '''Network simulation''' -- Testing network services, protocols, and security scenarios with a small number of computers.
:* '''Isolation''' -- Protecting multiple sets of data by storing them on multiple virtual machines. If one of the virtual machines is compromised, the data on other virtual machines is still protected.
:* '''Server consolidation''' -- Reducing the number of physical servers in a network by moving physical machines to virtual machines. This saves hardware, administration, cooling, and electricity costs, and it can increase the utilization of hardware (by ensuring that the hardware is not under-loaded).
:* '''Load-balancing and disaster recovery''' -- It is possible to migrate virtual machines between different physical machines, to ensure that a workload is balanced across multiple computers, to allow routine hardware maintenance and upgrading, and to compensate for hardware failure or other disasters.
|- valign="top"
 
|width="10%" | [[Image:harddrive.png|thumb|left|85px|<b>Removable Hard Disk Pack</b> (SATA)]]
|width="10%" |[[Image:ubs-key.png|thumb|left|85px|<b>USB key</b><br>(for backups)]]
|- valign="top"
|width="20%" |<u>Virtualization:</u>
[http://linux.die.net/man/1/virt-manager virt-manager]x<br>[http://linux.die.net/man/1/virsh virsh]x
|width="20%" |<u>Commands</u>
[http://unixhelp.ed.ac.uk/CGI/man-cgi?gzip gzip, gunzip]<br>
As you proceed throughout this lab, you will be required to fill in the comparison chart for three of the VMs (virtual machines) that you will be installing.
 
 
'''Complete the following steps to install and run the virtual manager application:'''
 
 
# 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-1511.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>
 
{{Admon/important|Restart your Host Machine|You must restart your '''c7host''' machine after installing the virtualization program above. If you fail to do this, you may experience virtualization network problems!}}
 
 
::This will install many applications (including):
:::* '''kvm/qemu''' - the hypervisor and other hardware emulation systems.
:::* A system service named '''libvirtd''' that manages the VMs.
:::* A graphical tool for managing virtual machines ('''virt-manager''') and the '''virsh''' command-line tool.<br><br>
<ol>
<li value="5">Start the virtualization service: <b><code><span style="color:#3366CC;font-size:1.2em;">service libvirtd start</span></code></b></li>
<li>The firewall configuration is altered by the addition of the virtualization software. Centos7 uses firewalld for firewall, but we will be switching back to using iptables. Issue the following series of command to install iptables and restart the firewall:<br><br> <b><code><span style="color:#3366CC;font-size:1.2em;">systemctl stop firewalld</span></code></b><br><b><code><span style="color:#3366CC;font-size:1.2em;">systemctl mask firewalld</span></code></b><br><b><code><span style="color:#3366CC;font-size:1.2em;">yum install iptables-services</span></code></b><br><b><code><span style="color:#3366CC;font-size:1.2em;">systemctl enable iptables</span></code></b><br><b><code><span style="color:#3366CC;font-size:1.2em;">systemctl start iptables</span></code></b><br><b><code><span style="color:#3366CC;font-size:1.2em;">service iptables save</span></code></b><br><br></li>
</ol>
{| width="40%" align="right" cellpadding="10"
|- valign="top"
|colspan="2"|{{Admon/important|Run virt-manager as a regular user, not as root|Otherwise all your virtual machines will be owned by root and you won't be able to use them as a regular user.}}
 
|}
<ol>
<li value="7">Start the graphical tool by selecting the menu options '''Applications'''>'''System Tools'''>'''Virtual Machine Manager''' or by typing the command<b><code><span style="color:#3366CC;font-size:1.2em;"> virt-manager</span></code></b></li>
</ol>
 
 
 
:: '''CPUs:''' 1
# 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-1511.iso</span></code></b><br><br>
# 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:
13,420
edits