当我启动 2C16G40G Windows 虚拟机时,虚拟机将分配计算节点中的所有内存,并且我已经在虚拟机中启用了 balloon 并手动设置了内存分配。相比之下,Linux 虚拟机的内存可以通过 balloon 自动分配。
这是 Windows VM 在 kvm/qemu 中的错误还是我的配置不正确?
root@cmp001:/# virsh version
Compiled against library: libvirt 6.0.0
Using library: libvirt 6.0.0
Using API: QEMU 6.0.0
Running hypervisor: QEMU 4.2.1
root@cmp001:~# virsh qemu-monitor-command instance-000112f4 --hmp "info balloon"
balloon: actual=16384
root@cmp001:~# top -p 8977
top - 10:12:37 up 14 days, 16:05, 1 user, load average: 5.12, 5.29, 5.09
Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie
%Cpu(s): 9.6 us, 5.5 sy, 0.0 ni, 84.5 id, 0.0 wa, 0.0 hi, 0.4 si, 0.0 st
KiB Mem : 13188148+total, 23065860 free, 88282144 used, 20533472 buff/cache
KiB Swap: 8388604 total, 7387032 free, 1001572 used. 38870928 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
8977 libvirt+ 20 0 18.316g 0.015t 30668 S 9.7 12.5 1938:22 qemu-system-x86
root@cmp001:~# virsh qemu-monitor-command instance-000112f4 --hmp "balloon 8192"
root@cmp001:~# virsh qemu-monitor-command instance-000112f4 --hmp "info balloon"
balloon: actual=8192
root@cmp001:~# virsh dumpxml instance-000112f4
<memory unit='KiB'>16777216</memory>
<currentMemory unit='KiB'>8388608</currentMemory>
root@cmp001:~# top -p 8977
top - 10:24:45 up 14 days, 16:17, 2 users, load average: 7.90, 6.90, 6.03
Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie
%Cpu(s): 9.6 us, 5.8 sy, 0.0 ni, 84.0 id, 0.0 wa, 0.0 hi, 0.5 si, 0.0 st
KiB Mem : 13188148+total, 23020384 free, 88319936 used, 20541164 buff/cache
KiB Swap: 8388604 total, 7395992 free, 992612 used. 38826532 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
8977 libvirt+ 20 0 18.316g 7.772g 30668 S 6.7 6.2 1940:13 qemu-system-x86