Open main menu

CDOT Wiki β

Changes

OPS235 Lab 2 - CentOS7 - VMware

No change in size, 18:45, 22 May 2016
no edit summary
{| width="40%" align="right" cellpadding="10"
|- valign="top"
|{{Admon/tip|Perform Downloads and Network installs at Seneca|'''It is recommended to perform this lab in one of Seneca College's labs'''. This lab uses servers which are on the Seneca network and which are not available from other locations (such as your home). If you attempt this lab from another location, adjust the belmont.senecac.on.ca URLs to point to another mirror server -- note that you may need to change the directory name as well as the server name. The installation of the '''centos3centos4''' virtual machine <u>must</u> be done at Seneca.}}
|}
:'''VM Details:'''
:: '''VM Name (and hostname):''' centos3centos4
:: '''Boot media:''' Network installation
:: '''Installation source URL:''' http://belmont.senecac.on.ca/centos/7/os/x86_64/
:: '''Kickstart File URL:''' http://matrix.senecac.on.ca/~andrew.smith/ops235/centos7-kickstart-v01.cfg
:: '''VM Image Pathname:''' /var/lib/libvirt/images/centos3centos4.img
:: '''Memory:''' 2048MB
:: '''Disk space:''' 15GB
# Create the VM as you did with the ''centos2'' virtual machine, specifying a network install as before, but specify the kickstart location under the "options section" for network install. What do you think is the purpose of this kickstart file?
# Observe the installation. How is it different from booting from a downloaded image?
# Complete the installation. Record the time taken to install, and compare this to the time taken by the previous installations.<br><br>If the during the installation, you see the message at the bottom '''Pane is Dead''', click the '''Virtual Machine''' menu at the top, select '''Shut Down''' -> '''Force Off''', '''right-click''' on '''centos3centos4''' in the ''virtual manager'' window and select '''Delete'''. Redo the VM setup for a new instance of the ''centos3centos4'' VM.
# What happens when the installation is finished?
# 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'''.
# Repeat the steps as you did to '''start the SSH service''', '''set iptables to accept connections via ssh''', '''test connections between centos3 centos4 and c7host''', and '''disable SELinux''' (refer to lab1).# Remember that centos3 centos4 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.
|colspan="2"|{{Admon/note|Manage virtual machines from the host|The commands used to manage virtual machines must be executed on the host (your disk pack) and not inside a virtual machine.}}
|}
# Start the '''centos1''' virtual machine, and stop the '''centos2''' and '''centos3centos4''' virtual machines.
# Switch to the '''c7host''' machine, and open a shell terminal.
# Enter these admin commands into your '''c7host''' machine and note the result:
# Shut down all of the virtual machines.
# Change to the directory <b><code>/var/lib/libvirt/images/</code></b>. Note the size of the files in this directory. What do these files contain?
# Make a compressed backup of the '''centos3centos4.img''' file to your home directory with this command: <b><code><span style="color:#3366CC;font-size:1.2em;">gzip < centos3centos4.img > ~YourUserId/centos3centos4.img.backup.gz</span></code></b><br />(Note: Make certain to use the redirection signs "<" and ">" properly in the command!)
# Compare the size of the compressed and original files (hint: use '''ls -lh'''). If file is very large (like 15GB), you didn't compress it and you need to remove that file and perform the previous step until you get it right!
# Start the '''''centos3centos4''''' VM.
# '''Make certain that you are in your VM and <u>not</u> in your main system!'''
# Wreck <u>only</u> your centos3 centos4 system! Try this command inside the centos3 centos4 virtual machine:<b><code><span style="color:#3366CC;font-size:1.2em;">rm -rf /*</span></code></b> (ignore error messages).# Shut down the centos3 centos4 VM. If you tried to start the centos3 centos4 VM, it would not boot since all system files have been removed!# Restore the original image from the backup in your home directory by typing this command: <b><code><span style="color:#3366CC;font-size:1.2em;">gunzip < ~YourUserId/centos3centos4.img.backup.gz > centos3centos4.img'''</span></code></b>
# Restart the VM. Is it working normally?
# Create compressed backups of your other virtual machines (ie. '''centos1''' and '''centos2''').
# You should make a copy of the xml configuration file in case you "wipe" and re-install the host machine, and want to add a restored VM backups to the virtual machine manager list. We will demonstrate using the centos3 centos4 xml configuration file, and prove that a "clone" can be added to your list.Please perform the following step:# Execute the following command: <b><code><span style="color:#3366CC;font-size:1.2em;">virsh dumpxml centos3 centos4 > centos3centos4.xml</span></code></b># Examine the file <b><code><span style="color:#3366CC;font-size:1.2em;">centos3centos4.xml</span></code></b>. What does it contain? What format is it in?<br><br>
# We will now learn how to download a compressed image file and xml configuration file and add it as a VM to the virtual manager menu.
# Issue the following commands:<ul><li><b><code><span style="color:#3366CC;font-size:1.2em;">wget http://cs.senecac.on.ca/~murray.saul/ops235/practical1.img.gz</span></code></b></li><li><b><code><span style="color:#3366CC;font-size:1.2em;">wget https://scs.senecac.on.ca/~murray.saul/ops235/practical1.xml</span></code></b><br><br></li></ul>
</code>
<br>
<ol><li value="4">Save your editing session, but remain in the text editor.</li><li>This shell script is designed particularly for your centos1, centos2, and centos3 centos4 VMS.</li><li>The code displayed below will prompt the user if they wish for all VMs to be backed-up; otherwise, allow the user the option of specifying which VMs to be backed-up. Add the following code</li></ol>
<br>
<code style="color:#3366CC;font-family:courier;font-size:.9em;">
# How do you SSH into your virtual machines?
# What is procedure to backup your VM images (and XML config files) to your USB key?
# The kickstart installation (centos3centos4) was a network installation. Can a kickstart file be used with a DVD installation?# The kickstart installation (centos3centos4) was fairly fast. Why? Under what circumstances would it take a long time, even on a fast network?
[[Category:OPS235]]
[[Category:OPS235 Labs]]
13,420
edits