{"id":93,"date":"2009-10-29T16:39:39","date_gmt":"2009-10-29T22:39:39","guid":{"rendered":"http:\/\/benincosa.com\/blog\/?p=93"},"modified":"2014-11-19T11:26:55","modified_gmt":"2014-11-19T17:26:55","slug":"kvm-with-rhel5-4","status":"publish","type":"post","link":"https:\/\/benincosa.com\/?p=93","title":{"rendered":"KVM with RHEL5.4"},"content":{"rendered":"<p>Installing KVM with RHEL5.4 is pretty easy.\u00a0 These were some of my notes that I hope you can somewhat follow along with.  I have since done it with RHEL5.5 with the same results.  Here&#8217;s how I got my virtual machine up:<\/p>\n<h3>1. Install Packages<\/h3>\n<p>[cc lang=&#8221;bash&#8221;]<br \/>\nyum -y install kvm python-virtinst libvirt libvirt-python virt-manager virt-viewer<br \/>\n[\/cc]<br \/>\n** Note:  I got some of these packages from xCAT&#8217;s distribution which has some updates.  But some of these should still work.<\/p>\n<h3>2. Start libvirt<\/h3>\n<p>[cc lang=&#8221;bash&#8221;]<br \/>\nchkconfig &#8211;level 345 libvirtd on<br \/>\nservice libvirtd start<br \/>\n[\/cc]<\/p>\n<h3>3. Configure Bridge Network<\/h3>\n<p>In my set up I want my virtual machines to be able to access the network.\u00a0 I also want machines on the network to access my virtual machine.\u00a0 In my setup, eth1 is on the internal network to my cluster.\u00a0 What I will do is create a bridge with eth1.\u00a0 I also need to make a few aliases to handle my different networks.<\/p>\n<p><strong>\/etc\/sysconfig\/network-scripts\/ifcfg-eth1<\/strong><\/p>\n<p>[cc lang=&#8221;bash&#8221;]<br \/>\n# Intel Corporation 80003ES2LAN Gigabit Ethernet Controller (Copper)<br \/>\nDEVICE=eth1<br \/>\nHWADDR=00:15:17:85:A8:CD<br \/>\nONBOOT=yes<br \/>\nBRIDGE=br0<br \/>\n[\/cc]<\/p>\n<p><strong>\/etc\/sysconfig\/network-scripts\/ifcfg-br0<\/strong><\/p>\n<p>[cc lang=&#8221;bash&#8221;]<br \/>\nDEVICE=br0<br \/>\nBOOTPROTO=static<br \/>\nONBOOT=yes<br \/>\nTYPE=Bridge<br \/>\nIPADDR=172.20.0.1<br \/>\nNETMASK=255.255.0.0<br \/>\n[\/cc]<\/p>\n<p><strong>\/etc\/sysconfig\/network-scripts\/ifcfg-br0:1<\/strong><br \/>\n[cc lang=&#8221;bash&#8221;]<br \/>\nDEVICE=br0:1<br \/>\nIPADDR=172.29.0.1<br \/>\nNETMASK=255.255.0.0<br \/>\nONBOOT=yes<br \/>\n[\/cc]<\/p>\n<p><strong>\/etc\/sysconfig\/network-scripts\/ifcfg-br0:2<\/strong><br \/>\n[cc lang=&#8221;bash&#8221;]<br \/>\nDEVICE=br0:2<br \/>\nIPADDR=172.30.0.1<br \/>\nNETMASK=255.255.0.0<br \/>\nONBOOT=yes<br \/>\n[\/cc]<\/p>\n<h3>4. Create Virtual Machine<\/h3>\n<p>[cc lang=&#8221;bash&#8221;]<br \/>\nvirt-install &#8211;name xcatmgr &#8211;ram 1024 &#8211;connect qemu:\/\/\/system &#8211;disk path=\/install\/libvirt\/images\/xcat.img,size=10 &#8211;vnc &#8211;cdrom=\/install\/isos\/RHEL5.4-Server-20090819.0-x86_64-DVD.iso -b br0 &#8211;os-variant=rhel5<br \/>\n[\/cc]<\/p>\n<h3>4.2 Copying Virtual Appliance<\/h3>\n<p>I created an xCAT appliance that I wanted to run:<br \/>\n[cc lang=&#8221;bash&#8221;]<br \/>\nmodprobe kvm<br \/>\nmodprobe kvm.intel<br \/>\nservice libvirshd restart<br \/>\n[\/cc]<br \/>\nThen import my machine:<\/p>\n<p>define \/install\/xcatapp\/xcatmgr.xml<\/p>\n<p>(or just copy it to \/etc\/libvirtd\/qemu and restart libvirshd)<\/p>\n<p>From there it just booted up, launched virt-viewer and away it went.\u00a0 I&#8217;m doing this on 1TB SATA disks, and the performance is just horrible.<\/p>\n<p>Even though I did this all with RHEL5.4, this <a href=\"http:\/\/www.howtoforge.com\/installing-kvm-guests-with-virt-install-on-ubuntu-8.10-server\">post<\/a> was very helpful as well.<\/p>\n<p>Now, I also want my nodes to bridge directly to the physical network.<br \/>\n[cc lang=&#8221;bash&#8221;]<br \/>\nservice libvirtd stop<br \/>\nip link set virbr0 down<br \/>\nbrctl delbr virbr0<br \/>\ncreate br0 with \/etc\/sysconfig\/network-scripts<br \/>\n[\/cc]<\/p>\n<p>bind it to eth1<\/p>\n<p>then make new net:<br \/>\n[cc lang=&#8221;bash&#8221;]<br \/>\nbrctl setfd vlan1 0<br \/>\nip addr add dev vlan1 172.20.1.19\/16<br \/>\nbrctl addif vlan1 eth0<br \/>\nip addr del dev eth0 172.20.1.19\/16<br \/>\nip link set vlan1 up<br \/>\nvirt-viewer xcatmgr<br \/>\n[\/cc]<\/p>\n<p>Other good notes:<\/p>\n<p>http:\/\/wiki.centos.org\/HowTos\/KVM#head-c02a0b33e7949b0bc3b151ac6e0bdfb91b6bbd1c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing KVM with RHEL5.4 is pretty easy.\u00a0 These were some of my notes that I hope you can somewhat follow along with. I have since done it with RHEL5.5 with the same results. Here&#8217;s how I got my virtual machine up: 1. Install Packages [cc lang=&#8221;bash&#8221;] yum -y install kvm python-virtinst libvirt libvirt-python virt-manager virt-viewer&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[920,916],"tags":[82,35],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/93"}],"collection":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=93"}],"version-history":[{"count":7,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/93\/revisions"}],"predecessor-version":[{"id":233,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/93\/revisions\/233"}],"wp:attachment":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}