Open main menu

CDOT Wiki β

Changes

OPS245 Lab 2

1 byte removed, 19:01, 17 January 2021
m
Part 1: Backing Up Virtual Machines: - clarifying instructions.
[http://wiki.centos.org/HowTos/KVM Installing &amp; Using KVM on CentOS ]<br>
[http://www.dedoimedo.com/computers/kvm-intro.html Using KVM (tutorial)]<br>
[https://www.centoslibvirt.org/docssources/5virshcmdref/html-single/5.2/Virtualization/sect-Virtualization-Commands_for_Red_Hat_Virtualization-virsh_the_command_line_interface_tool_for_virtualization.html virsh command reference ]<br>
|valign="top" style="padding-left:20px;"|
Miscellaneous<br>
# Launch the ''KVM virtual machine manager'' by clicking '''Applications''' -> '''System Tools''' -> '''Virtual Machine Manager'''.
# When prompted, enter your '''root''' password.
# Click the '''create a new VM icon''' located near the top left-corner of the application window.
# Select the '''Network Install''' option and click '''Forward'''.
#<span style="background-color:yellow;">Repeat the steps as you did in the previous investigation ([https://wiki.cdot.senecacollege.ca/wiki/OPS235_Lab_2#Part_1:_Install_KVM_Virtualization_Application Investigation1 Part 1]) to '''stop and disable firewalld, install iptables-services, start and enable iptables''' for this newly-created VM.</span>
# <span style="background-color:yellow;">Repeat the steps as you did with c7host post-install to '''turn off SELinux''' (using the command 'vi' instead of 'vim') and perform a '''yum update'''.</span>
# Issue the following command to obtain and record your centos2 centos3 IPADDR in your lab2 logbook: <b><code><span style="color:#3366CC;font-size:1.2em;">ip address show</span></code></b>
# Record the time taken to install, and compare this to the time taken by the previous installations in your lab2 logbook.
:::*Home: http://mirror.netflash.net/centos/7/os/x86_64/
:: '''Kickstart File URL (Kernel options): '''
:::* Seneca LabHome:''' <span style="color:green;font-weight:bold">ks=</span>https://ict.senecacollege.ca/~ops235/labs/centos7-kickstart.cfg:::* Home:''' <span style="color:green;font-weight:bold">ks=</span>https://ict.senecacollegepeter.cacallaghan/~ops235ops245/labs/centos7-kickstart-ext.cfg
:: '''VM Image Pathname:''' /var/lib/libvirt/images/centos3.qcow2
:: '''Memory:''' 2048MB ('''IMPORTANT''' Do not use less than 2048MB during installation.)
# Create the VM (called '''centos3''')
# During the install, copy the network URL, then click the '''URL options''' to expand the '''kernel options''' input textbox. Type the following in the kernel options textbox: <ul><li>Seneca Lab:''' <span style="color:green;font-weight:bold">ks=</span>https://ict.senecacollege.ca/~ops235/labs/centos7-kickstart.cfg</li><li>'''Home:''' <span style="color:green;font-weight:bold">ks=</span>https://ictpeter.senecacollege.cacallaghan/~ops235ops245/labs/centos7-kickstart-ext.cfg</li></ul>
# Then click the '''forward''' button to proceed. Make certain to select the correct Memory Size and Disk Space size shown in the VM Details above
# Make certain to enter the name: '''centos3''', <u>AND</u> then select the option: '''Customize configuration before install''', and select '''Copy Host CPU Configuration''', click '''Apply''', and then click '''Begin Installation'''.
# Compare the experience to the first time you booted the other virtual machines.
# <span style="background-color:yellow;">Repeat the steps as you did in the previous investigation ([https://wiki.cdot.senecacollege.ca/wiki/OPS235_Lab_2#Part_1:_Install_KVM_Virtualization_Application Investigation1 Part 1]) to '''stop and disable firewalld, install iptables-services, start and enable iptables''' for this newly-created VM.</span>
# <span style="background-color:yellow;">Repeat the steps as you did with c7host post-install to '''turn off SELinux''' and perform a '''yum update'''.</span><br />:::You'll notice something when you go to set '''SElinux''' to '''permissive'''. The kickstart file already did that for you. It could even have performed the switch from firewalld to iptables for you (but it didn't).
# Issue the following command to obtain and record your centos2 IPADDR in your lab2 logbook: <b><code><span style="color:#3366CC;font-size:1.2em;">ip address</span></code></b>
# Remember that centos3 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.
# Shut down your '''centos1''', '''centos2''', and '''centos3''' VMs. For ''centos2'' and ''centos3'', which are CLI-only, you can issue the following command to shutdown: <b><code><span style="color:#3366CC;font-size:1.2em;">sudo shutdown -h</span></code></b>. Please be patient, the VMs will shut down!
# In your '''c7host''' VM, open a new Terminal window.
# Use elevated privileges ist to list the size and names of files in<b><code><span style="color:#3366CC;font-size:1.2em;">/var/lib/libvirt/images/</span></code></b><ul><li>What do these files contain?</li></ul>
# Use the command <b><code><span style="color:#3366CC;font-size:1.2em;">sudo -i</span></code></b> and enter your password if prompted. You are now root until you use the command <b><code><span style="color:#3366CC;font-size:1.2em;">exit</span></code></b> to return to your normal user account.
# Change to the images directory by issuing the following command: <b><code><span style="color:#3366CC;font-size:1.2em;"> cd /var/lib/libvirt/images/</span></code></b>. Note that you did not need to use sudo, as you are already using elevated permissions.
<li> '''Make certain that you are in your VM and <u>not</u> in your main system!''' </li>
<li> Wreck <u>only</u> your centos3 system! Try this command inside the centos3 virtual machine:<b><code><span style="color:#3366CC;font-size:1.2em;">sudo rm -rf /*</span></code></b> (ignore error messages).</li>
<li> Shut down and restart the centos3 VM(you may need to use the '''Force Reset''' option to do so). It </lI><li> When the machine restarts it will not boot since all system files have been removed!</li><li> Use the '''Force Off''' option to turn centos3 back off.</li>
<li> Restore the original image from the backup from your home directory to your '''images''' directory by typing this command:<br><b><code><span style="color:#3366CC;font-size:1.2em;">sudo gunzip < ~YourUserId/backups/centos3.qcow2.gz > /var/lib/libvirt/images/centos3.qcow2'''</span></code></b></li>
<li> Restart the VM. Is it working normally?</li>
932
edits