Changes

From Amahi Wiki
Jump to: navigation, search
4,928 bytes added ,  04:23, 26 October 2011
no edit summary
What I will try to describe is a fairly advanced concept called LVM (Logical Volume Manager). There are many methods to create a volume group in Linux but as far as I know it is nessasary to use the KVM gui or cli tools to integrate them properly into KVM. I am not going to describe all the details of LVM because its just so much. Just know that it works well and is very well developed. KVM utilizes LVM and has some built in tools to create and use volume groups. KVM calls them storage pools for some reason, probably to make it easier for people migrating from ESX or others. It makes sense but it can get confusing when all these terms are being tossed around.
==Here We Go== Please make sure to follow these steps because you can blow away your system. I have a space PC I am using for this so I am not worried about any datedata.* First you have to fire up virt-manager. This is a gui based tool and the following steps will all utilize the gui. There are a ''ton'' more options in the cli but we are going to keep in simple here. #Start virt-manager from the command line or menu or whatever#*[https://lh6.googleusercontent.com/-PqNshtWkxh4/Tqd-O13ZsKI/AAAAAAAADAM/KOamaJAGbYs/s912/1virt-man.png Image1]#Its going to bug you to authenticate as the root user. You can avoid this by starting virt-manager at the command line as root but anyway#*[https://lh5.googleusercontent.com/-JIjMnfk6Urc/Tqd-UJzhcQI/AAAAAAAADAU/x8ZJcie9GAU/s912/2virt-man.png Image2]#Once you are in you need to goto Edit --> Connection Details. It should bring up the following overview panel.#*[https://lh3.googleusercontent.com/-3Nm0v70_Y7A/Tqd-UjEJ50I/AAAAAAAADAo/-xLIzzc2dd8/s912/3conn_details.png Image3]#Goto the Storage tab so we can build our storage pool for the KVM VMs.#*[https://lh6.googleusercontent.com/-NVif9rgSGQA/Tqd-UXaQ78I/AAAAAAAADAY/ZpIC51VAd6A/s912/4storage.png Image4]#Once we are there we want to Add a Pool like so#*[https://lh6.googleusercontent.com/-4FgJvgcr4is/Tqd-U2Dyn_I/AAAAAAAADAk/cTzntzAuKdg/s912/5add_storage_pool.png Image5]#*Fill in a name that makes sense to you in the top field. Since this step is creating a volume group I start off with that and then use the underscore and name the volume group.#*In this case we are using LVM so follow along. As you can tell there are many other options including stuff used in the enterprise like iSCSI and others like LVM. You can also choose to just do a file like vmware to keep it simple.#At this point we are performing the steps of creating a Logical Volume Group. in the bottom left click the plus sign to add a new Volume group. The volume group will store all the logical volumes of the VMs to be created soon. You will also need that drive ID you recorded earlier. You do have that right? #*[https://lh6.googleusercontent.com/-BlVneEgyb7w/Tqd-VSDRgfI/AAAAAAAADA4/dsCgnjYs8B4/s912/6storage_target.png Image6]#After hitting the Forward button you will be presented with something like this#*[https://lh5.googleusercontent.com/-6BlV30CaNLw/Tqd-V6ikVzI/AAAAAAAADA0/AsiEOpqx7Ng/s912/7disk_by_id.png Image7]#*This is where you need that ID. Hit the browse button by '''"source path"'''and navigate to /dev/disk/by-id From there pick the one with the filename that matches your number ID. '''Don't screw this up or you can blow your host system away!!'''#*[https://lh3.googleusercontent.com/-9gk8Mbm4f4U/Tqd-WEc_4SI/AAAAAAAADBI/SpApMvZ-1sU/s912/8storage_final.png Image8]#*Once you pick the correct device you should have this. Check the "build pool" box so the Volume group gets created on the device.#Here is you final warning.#*[https://lh4.googleusercontent.com/-WX5UJn0ZOzU/Tqd-Wi2-N4I/AAAAAAAADBE/0JkLn5BXPR4/s912/9storage_you_sure.png Image9]#At this point our Volume group is created. You can also call this a storage pool. Inside this pool we want to create a new disk or Logical Volume. This will be used to store the VM itself. This will also give the VM direct access to the device just like a non virtualized PC. Select New Volume#*[https://lh5.googleusercontent.com/-utcIDf_w6WM/Tqd-XCmfCDI/AAAAAAAADBU/HCq6lx4y9ck/s912/10new_pool.png Image10]#Now give the LV a name. I fall back on my own naming standards which you really need to develop when you do alot of this. Otherwise this field is free form. I name it after the VM that will go on this volume.#*[https://lh5.googleusercontent.com/-utcIDf_w6WM/Tqd-XCmfCDI/AAAAAAAADBU/HCq6lx4y9ck/s912/10new_pool.png Image11]#*Notice the size fields. KVM has the ability to "thin provision" I won't go into too much detail about this. The first field is the ultimate size the volume will be allowed to grow to without an extension. The second field is what will be allocated intially. It will automatically grow to the max field setting over time.#Once you hit finish you'll have a nice new shiny volume to install whatever you like on it.#*[https://lh6.googleusercontent.com/-UCthw_ttdt4/Tqd-YKSWEWI/AAAAAAAADBk/_c8XUdCrKRc/s912/12volume_done.png Image 12]#At this point we are ready to install our new VM. You can safely close out the Host Details window and Click the New VM button in the original virt-manager window. Thats the button in the upper left corner of virt-manager. You will be presented with a wizard like interface.#*[https://lh5.googleusercontent.com/-kB4VdNkappI/Tqd-YgcYWGI/AAAAAAAADBo/JXC_YiK3Eh8/s912/13new_vm_name.png Image13]#*This is where the ISO we copied over earlier comes in handy. Select ISO as the local install media.#Now just browse to the location where the ISO is located and select your OS type in the dropdowns#*[https://lh4.googleusercontent.com/-si2UbG9im60/Tqd-ZBEb_oI/AAAAAAAADB0/gmhjqG8BhEE/s912/14media_ostype.png Image14]#