13,420
edits
Changes
no edit summary
# 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/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>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 Destroy <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>. You may see some error messages, but this is normal.
<li>Shut down the VM.</li>
<li>Restore the original image from the backup in your home directory (type 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="6">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>
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 '''''f19host''''', 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 f19host 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?