1

I am on host-machine with Centos 6.5, qemu+KVM and 2 virtual hosts in it (behind NAT). Both virtual hosts were configured with Virtual Machine Manager (one of them is with Windows 2003 and other with Centos 6.5), both have fixed ram (8Gb and 4Gb). I've got 2 problems/questions.

  1. If I configure not fixed RAM capacity in Virt.manager (f.e. allow to use from 4Gb to 8Gb) my virtual machine eats all available memory in host machine (more than 8Gb)

  2. In htop of host machine I see not one qemu process for each virtual machine, but a lot of processes of same virt. machine. What is wrong?

If I get into a virt.machine and check free -m I see that there a lot of free mem.

Added (VM domxml):

    <domain type='kvm'>
      <name>myvm</name>
      <uuid>27934a14-b54e-1e4e-65de-7f6d03b1e7ce</uuid>
      <memory unit='KiB'>8388608</memory>
      <currentMemory unit='KiB'>8388608</currentMemory>
      <vcpu placement='static'>2</vcpu>
      <os>
        <type arch='x86_64' machine='rhel6.6.0'>hvm</type>
        <boot dev='hd'/>
      </os>
      <features>
        <acpi/>
        <apic/>
        <pae/>
      </features>
      <clock offset='utc'/>
      <on_poweroff>destroy</on_poweroff>
      <on_reboot>restart</on_reboot>
      <on_crash>restart</on_crash>
      <devices>
        <emulator>/usr/libexec/qemu-kvm</emulator>
        <disk type='file' device='disk'>
          <driver name='qemu' type='raw' cache='none'/>
          <source file='/var/lib/libvirt/images/myvm.img'/>
          <target dev='vda' bus='virtio'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
        </disk>
        <disk type='block' device='cdrom'>
          <driver name='qemu' type='raw'/>
          <target dev='hdc' bus='ide'/>
          <readonly/>
          <address type='drive' controller='0' bus='1' target='0' unit='0'/>
        </disk>
        <controller type='usb' index='0' model='ich9-ehci1'>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
        </controller>
        <controller type='usb' index='0' model='ich9-uhci1'>
          <master startport='0'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
        </controller>
        <controller type='usb' index='0' model='ich9-uhci2'>
          <master startport='2'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
        </controller>
        <controller type='usb' index='0' model='ich9-uhci3'>
          <master startport='4'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
        </controller>
        <controller type='ide' index='0'>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
        </controller>
        <interface type='network'>
          <mac address='52:54:00:99:ee:4f'/>
          <source network='default'/>
          <model type='virtio'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
        </interface>
        <serial type='pty'>
          <target port='0'/>
        </serial>
        <console type='pty'>
          <target type='serial' port='0'/>
        </console>
        <input type='tablet' bus='usb'/>
        <input type='mouse' bus='ps2'/>
        <graphics type='vnc' port='-1' autoport='yes'/>
        <sound model='ich6'>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
        </sound>
        <video>
          <model type='cirrus' vram='9216' heads='1'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
        </video>
        <memballoon model='virtio'>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
        </memballoon>
      </devices>
    </domain>

Added output of "ps -ef | grep myvm":

qemu 8105 1 21 Apr23 ? 06:23:05 /usr/libexec/qemu-kvm -name myvm -S -M rhel6.6.0 -enable-kvm -m 8192 -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid 27934a14-b54e-1e4e-65de-7f6d03b1e7ce -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/myvm.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2 -drive file=/var/lib/libvirt/images/myvm.img,if=none,id=drive-virtio-disk0,format=raw,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=22,id=hostnet0,vhost=on,vhostfd=23 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:99:ee:4f,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -vnc 127.0.0.1:0 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7 -msg timestamp=on

1
  1. The used memory are claimed pages, not necessarily used in the VM. KSM can clear those if this is critical (I usually run it when the host hits 80% memory usage)
  2. Every virtual CPU is a process, so you get a process for every virtual core, not per VM. This is also what allows KVM to avoid gang scheduling, like you see in VMWare.
  • 2. Each of mine virtual machines has 2 CPUs, so I should see 4 processes, but I see much more of them tinypic.com/view.php?pic=11t9ypu&s=8#.VTpLq0TWRvw – tester3 Apr 24 '15 at 13:54
  • Can you post the VM domxml? These could be IO threads, or other worker threads, depending on the settings – dyasny Apr 24 '15 at 15:43
  • updated question with VM xml – tester3 Apr 24 '15 at 16:13
  • Thanks. I expected to find io-threads in the disk xml, but it might still be the default. When you run ps -ef |grep VMNAME, do you see threads there? Also, when you stop the two VMs, do all these processes go away? – dyasny Apr 24 '15 at 16:24
  • Thanks for trying to help! Updated question with ps -ef output. When I stop both VMs all processes go away. – tester3 Apr 24 '15 at 16:40

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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