Changes

Jump to: navigation, search

OPS245 Lab 2

894 bytes added, 17:52, 17 September 2021
m
Practice For Quizzes, Tests, Midterm & Final Exam: - removing some bash-based questions
=== Part 3: Installing from a Network using a Kickstart File ===
{| width="40%" align="right" cellpadding="10"
|- valign="top"
|colspan="2"|{{Admon/important|Using a Kickstart file with a local install|Under most circumstances, a network install would be drawing the installation data from a server in the local network, allowing it to transmit data at higher speeds than we can achieve over the internet. If your download speed is slow enough that network installs are failing, it is acceptable to install these VMs from local media. However, you will still need to provide a kickstart file to Centos3. <br /><br />To do so, start the install process as normal for an installation from an iso file, but when presented with the menu giving you the option to 'Install CentOS 7' or 'Test this media &amp; install CentOS 7', highlite 'Install CentOS7' and press '''&lt;tab&gt;'''. This will open a prompt at the bottom of the window for you to enter grub configuration options. Type '''inst.ks&#61;https://ict.senecacollege.ca/~ops245/labs/centos7-kickstart-local.cfg''' andf hit '''&lt;enter&gt;'''.}}
|}
 
:'''VM Details:'''
|}
This week you have added some significant capabilities to your python scripting. The ability to run loops and make decisions makes your scripts much more powerful. In this investigation you will write a python script that backs up the centos1, centos2, and centos3 VMs, or lets the user to specify which VMs they want backed up.
<ol>
<li>Now we have a script that asks the user if they want to back up all VMS, and if they say they do it does. But if they don't want to back up every VM, it currently does nothing.</li>
<li>Add an else statement to handle the user not wanting to back up every VM. Inside that else clause ask the user which VM they would like to back up (you can even give them the names of available VMs (Centos1, Centos2, Centos3).</li>
<li>Now nest and an if statement inside that else so that your script can handle what your user just responded with. If they asked for Centos1, back up Centos1. If they want to back up Centos2, only back up Centos2, etc. Hint: You might want to use elif for this.</li>
<li>Test your script again. You should now have a script that:<ul><li>Makes sure the user is running the script with elevated permissions.</li><li>Asks the user if they want to back up every VM.</li><li>If they want to back up every VM, it backs up every VM.</li><li>If they user does not want to back up every VM, the script asks them which VM they do want to back up.</li><li>If they user selected a single VM, the script will back up that one VM.</li></ul></li>
</ol>
# List the steps to correctly restore your VMs from a USB disk to your c7host VM.
# How can you prompt the user for data and store into a variable?
# How do you perform mathematical operations in the Bash shell?
# What is the difference between a determinant loop and an in-determinant loop?
# Show a few examples how loops can be used to error-check when prompting the user for data.
# What does the command '''rpm -qi centos-release''' do and why is it important?
932
edits

Navigation menu