Redhat Virutulization KVM Faq's and commands

Min configuration 6GB disk space, 2GB RAM
Recommended   6GB+ Guest OS size , 2GB + Ram required for Guest OS

Check Intel® VT virtualization extensions are enabled .

xm dmesg | grep VMX

example output

(XEN) VMXON is done
(XEN) VMXON is done


VMXON in the output tells that it is on.

Check AMD-V architectures

xm dmesg | grep SVM

example output

(XEN) AMD SVM Extension is enabled for cpu 0
(XEN) AMD SVM Extension is enabled for cpu 1


Installing Redhat Virtulization with yum
----------------------------------------------------------
install "xen" and "kernel-xen" packages

# yum install xen kernel-xen
# yum install virt-manager libvirt libvirt-python libvirt-python python-virtinst

Installing guest with virt-install
---------------------------------------------
# virt-install --name fedora9 --ram 512 --file=/var/lib/xen/images/fedora9.img \
 --file-size=3 --vnc --cdrom=/path=to/fedora9.iso

Giving location of ISO file

virt-install --name nare-Cmd-Ubuntu --ram 512 --file=/var/ns-ubuntu.img   --file-size=8  --cdrom /home/kvm/ubuntu-9.04-desktop-i386.iso 


# virt-install -n rhel5PV -r 500 -f /var/lib/xen/images/rhel5PV.dsk -s 3 --vnc -p

-l\ftp://10.1.1.1/trees/RHEL5-B2-Server-i386/

sudo virsh reboot rhel5PV


--vnc opens a GUI window installation

creating guests with virt-manager
-------------------------------------------------
$ sudo virt-manager &








Note : Use default location for Guest  which is "/var/lib/xen/images/. "
          if you choose different location make sure it is added to your SELinux policy and  relabeled before you  continue with the installation

Creating XML configuration for installed VM

virsh dumpxml NS-test-ubuntu> naresh.xml
Cat naresh.xml will give show the xml file
 
After creating xml file of a VM 
 
virsh --connect qemu:///system
to get connected to virsh prompt and then define the Virtual machine. 
virsh # define /var/lib/libvirt/images/naresh.xml
 
after defining the VM we can issue commands like
 
 
virsh # shutdown NS-test-ubuntuDomain NS-test-ubuntu is being shutdown
 
 
virsh # start NS-test-ubuntuDomain NS-test-ubuntu started
 
 
virsh # list
 Id Name                 State
----------------------------------
  1 storage              running
  8 NS-test-ubuntu       running 
 
nice link for virtulization with KVM on ubuntu-9.10

No comments: