CentOS Qemu + KVM大量的虚拟机进程

我在主机上安装了Centos 6.5,qemu + KVM和2个虚拟主机(在NAT后面)。 这两个虚拟主机都configuration了虚拟机pipe理器(其中一个与Windows 2003和其他与Centos 6.5),都有固定的内存(8Gb和4Gb)。 我有2个问题/问题。

  1. 如果我在Virt.manager中configuration了不固定的RAM容量(不允许使用从4Gb到8Gb),我的虚拟机将在主机(大于8Gb)内占用所有可用内存,

  2. 在主机的htop中,我看不到每个虚拟机都有一个qemu进程,但是有很多相同的进程。 机。 哪里不对?

如果我进入virt.machine并检查免费-m我看到有很多免费的内存。

新增(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> 

添加了“ps -ef | grep myvm”的输出:

qemu 8105 1 4月23日? 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 = 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,f d = 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. 使用的内存是声称的页面,不一定在虚拟机中使用。 KSM可以清除这些如果这是至关重要的(我通常运行时,主机达到80%的内存使用量)
  2. 每个虚拟CPU都是一个进程,因此您可以为每个虚拟内核获取一个进程,而不是每个虚拟机。 这也是允许KVM避免团伙调度,就像你在VMWare中看到的一样。