Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a standard (not modified) KVM+libvirtd installed on clean Centos 6 machine with 8G of RAM and 8 cores CPU.

When I am trying to install guest centos 6 using virt-manager it takes ages to finish installation. I gave 2 cores and 3 GB of RAM to it and I can see in performance tab that it uses all 3GB of RAM permanently.

Where is a problem?

share|improve this question
    
Using up all the RAM allocated for the VM is not a problem; see linuxatemyram.com . A slow installation might be a problem, but if it is, you should focus on that instead of the irrelevant RAM issue. –  Michael Hampton Dec 4 '13 at 19:20
    
What can you recommend regarding slow installation? –  Alex Dec 4 '13 at 19:33
    
Check CPU bottlenecks, disk i/o bottlenecks, verify you don't have any unexpected processes eating up all your RAM, attach strace to the process to see where it's hanging.. the same things you would do to troubleshoot slow ______ (fill in the blank). –  yoonix Dec 4 '13 at 20:59
1  
Why is this titled "KVM consumes all RAM"? It sounds like it's using exactly as much RAM as you told it to use, and the issue is slow installation. –  David Schwartz Dec 4 '13 at 22:42
    
provide some details - how is the VM set up, how is the underlying storage set up, what kind of hardware it is running on –  dyasny Dec 5 '13 at 22:01
show 1 more comment

1 Answer 1

I had this issue with KVM (CentOS EL 6.4) so I ran a benchmark to find out what was happening. Turns out my guest VM was running only 15% as fast as the host (bare metal OS). I had checked the prerequisites of kvm and verified my Intel processor has the VT-x (vmx) [AMD calls it svm].

cat /proc/cpuinfo | grep vmx

Why then the slow performance?? Turns out that I needed to enable VT-x in the BIOS of the system (older machine circa 2006). To verify that this was the problem, I checked to see if kernel module kvm_intel was running:

lsmod | grep kvm

Turns out that it was not running with kvm_intel. When I had installed my virtual machine, libvirt defined the domain type as qemu. But this should be type kvm. You can check:

virsh edit your_vm_guest_domain

... check the line at the top ...

<domain type='qemu'>

That was libvirt telling me it didn't detect the kvm_intel presence on my system and defaulted to plain qemu emulation.

When I enabled the VT-x in the BIOS, I found that I could load the kvm_intel module and then changed the <domain type='kvm'>. I executed the same benchmark again and found virtually no difference in speed between the guest VM and the host OS.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.