Changes

Jump to: navigation, search

OPS235 Lab 2 - Fedora17

1,981 bytes added, 12:29, 24 September 2018
no edit summary
[[Category:OPS235]][[Category:OPS235 Labs]]
{{Admon/caution|THIS IS AN OLD VERSION OF THE LAB|'''This is an archived version. Do not use this in your OPS235 course.'''}}
 
= Fedora 17 Installation Methods (on Virtual Machines: fedora1, fedora2, fedora3) =
* '''Boot media:''' Network installation
* '''Installation source:''' http://belmont.senecac.on.ca/fedora/releases/17/Fedora/x86_64/os/
* '''Memory:''' 768MB1024MB* '''Disk space:''' 15GB20GB
* '''CPUs:''' 1
* '''Installation source:''' http://belmont.senecac.on.ca/fedora/releases/17/Fedora/x86_64/os/
* '''Kickstart location:''' http://www.drivehq.com/file/df.aspx/shareID10606286/fileID1269952040/Fedora17-kickstart.cfg
* '''Memory:''' 768MB1024MB* '''Disk space:''' 10GB15GB
* '''CPUs:''' 1
# Start the ''fedora1'' virtual machine, and stop the ''fedora2'' and ''fedora3'' virtual machines.
# Switch to the f19host machine, and open a shell terminal.# Enter these commands into your host f19host machine and note the result:#* <code>'''virsh list'''</code>#* <code>'''virsh list --all'''</code>#* <code>'''virsh list --inactive'''</code># Start Now, shut-down your fedora1 VM normally, and close the ''fedora3'' virtual machine from fedora1 VM window. Make certain NOT to close the Virtual Machine Manager main window.# Switch to your terminal and issue the command line: <code>'''virsh start fedora3fedora1'''</code># Repeat the commands from step 2 and notice any changesCheck to see if your fedora1 VM is now running.# Stop Switch to the terminal and issue<code>''fedora3'virsh list --all''' virtual machine: <code>virsh shutdown fedora3</code>and confirm the status of the fedora1 VM.# There are other commands that can be used (such as suspend, or shutdown). The "shutdown" command may not always work since it sends a request to "shutdown virtual machine gracefully", but may not always work. Why do you think it is useful to have commands to manipulate VMs?
{{Admon/note|Virtual Machine Does not Shutdown from Command|If the Virtual machine fails to shutdown from the <code>virsh shutdown</code> command, then you can go to the '''Virtual Machine manager''' and '''halt''' or '''shutdown''' within the VM itself, then you can click the '''PowerOff''' button in the VM window. You'll want to avoid a forced shutdown since those are equivalent to yanking the cord out of the wall on a physical machine!|}}
 
<ol>
<li value="6">Confirm that ''fedora3'' has been shut down.</li>
</ol>
'''Answer the Investigation 5 observations / questions in your lab log book.'''
== Investigation 6: How do I backup a virtual machine? ==
{{Admon/important|Backing up VMs|There are two general processes in order to back up your images:<ol><li>'''Compressing your images''' (also recommended to backup up to external storage USB Key) using the '''gzip''' command.</li><li>'''Backup the VM xlm configuration file''' (preferably to USB key) using '''virsh''' shell command to add VM to virtual machine manager list (in the event that the HOST machine is "wiped" and re-installed, but VM images and xml configuration files have been backed up external storage).</li></ol><br />Taking the time to backup the image of the Operating System's file system allows the user to return to a '''"restoration point"''' using the '''gunzip''' command in case something bad occurs to the OS during a lab. <br />Failure to take the time to make and confirm backups can result in loss of lab work for the student!|}}
# Shut down all of the virtual machines.
# Change to the directory <code>/var/lib/libvirt/images/</code>. Note the size of the files in this directory. What do these files contain?
# Make a compressed backup of the <code>fedora3.img</code> file to your home directory with this command: <code>'''gzip <fedora3.img >~'''YourUserId'''/fedora3.img.backup.gz'''</code>{{Admon<br /caution|There are two parts to backing up your images:<ol><li>Compressing your images (also recommended '''Note: Make certain to backup up to external storage (USB Key)use the redirection signs "</li" and "><li>Backup " properly in the VM xlm configuration file (preferably to USB key) using virsh shell command to add VM to virtual machine manager list (if HOST machine is "wiped" and re-installed!''').<{{Admon/li></ol><br /><br /> caution| Make sure the backup is successful!|If there are any error messages, '''DO NOT''' proceed past this point. You're going to destroy your fedora3 virtual machine and restore it using the backup you have created -- if there are any problems with the backup, you will not have a working virtual machine, and will have to re-install it.}}
<ol>
<li value="4">Compare the size of the compressed and original files.</li>
<li>Start the '''''fedora3''''' VM.</li> <li>'''Make certain that you are in your fedora VM, and <u>not</u> in your Fedora main system.!'''</li> <li>Wreck <u>only</u> your fedora 3 system! Try this command inside the fedora3 virtual machine ('''DO NOT''' do this on your main Fedora system, or you will have to repeat your '''lab1''' and portions of your '''lab2'''!): <code>'''rm -rf /*'''</code></li> <li>Shut down the VM.If you tried to start the Fedora3 VM, it would not boot since all system files have been removed!</li> <li>Restore the original image from the backup in your home directory (type by typing this command carefully): <code>'''gunzip <~'''YourUserId'''/fedora3.img.backup.gz >fedora3.img'''</code></li>
<li>Restart the VM. Is it working normally?</li>
<li>Create compressed backups of your other virtual machines.</li>
<ol>
<li value="12">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 fedora 3 xml configuration file, and prove that a "clone" can be added to your list.Please perform the following step:<ol type="a">
<li>Verify that you are in the directory: <code>/var/lib/libvirt/images/</code>.</li> <li>Execute the following command: <code>virsh dumpxml fedora3 >fedora3.xml</code></li>
<li>Examine the file <code>fedora3.xml</code>. What does it contain? What format is it in?</li>
<li>Make a copy of <code>fedora3.xml</code> called <code>fedora3a.xml</code>.</li>
::* Change at least one of the hexadecimal characters in the UUID. Do not change the length of the UUID. Valid hexadecimal characters are 0-9 and a-f.
<ol type="a" >
<li value="116">Issue this command: <code>virsh define fedora3a.xml</code>
<li>Issue the command <code>virsh list --all</code> and record any changes.
<li>Issue the command: <code>virsh undefine fedora3a</code>
<li>List all of the virtual machines again, and note any changes. </li></ol>
<li>For the remainder of these labs, it is assumed that you will backup <u>'''both'''</u> the images and xml configuration files for <u>'''all'''</u> Virtual machines, when asked to backup your virtual machines. It is also highly recommended to backup these files to an external storage device (eg. USB key) in case the host machine gets "wiped" and you need to rebuild your HOST machine and then restore your Virtual Machines...</li><li>Answer this question in your log book:</li>
</ol>
::* In order to fully back up a virtual machine, what information should be saved in addition to the virtual machine image?
== Investigation 7: Kickstart Files ==
{{Admon/tip|SSHD and Firewall|If you have restarted your virtual machine ''fedora1'', the sshd server you started in section investigation 1-16 (step 15) will no longer be running. In addition, the firewall will have reverted to its original state. In order to use '''scp''', below, you will need to restart ssh and adjust the firewall again.<br /><br />If students cannot backup their kickstart files using the '''scp''' command, they can use a web-browser to access their Seneca e-mail with attachment (copy kickstart file to their home directory first!). For the text-based Linux system "fedora3", students can use the '''mail''' command (refer to the man command to learn how to send e-mail attachments).}}
When you perform a non-Kickstart installation, the installation program creates a Kickstart file in the <code>/root</code> directory for reference.
# Obtain the kickstart files for all four of your installations (your disk pack ''f17host'', plus the ''fedora1'', ''fedora2'', and ''fedora3'' virtual machines). # To prevent confusion, copy your kickstart files to kickstart filenames that describe their purpose (eg. kickstart_host, kickstart_fedora1, kickstart_fedora2, etc...)# Copy them all to your f17host system (tip: use <code>scp</code>), or use the hint in the tip box above to send via e-mail.
# Compare these files. What are the differences? Similarities? (Tip: you may want to use tools such as <code>sdiff</code> to help with the comparison).
# How could you use the kickstart file produced by the installation program to perform additional, identical installations?

Navigation menu