问题一:KVM宿主机,在使用virsh console时,发现控制台(console)无法使用
报出如下错误:
error: operation failed: Active console session exists for this domain
现象:
# virsh console v03 Connected to domain v03 Escape character is ^] error: operation failed: Active console session exists for this domain
解决办法:
# ps aux | grep console root 19449 0.0 0.0 300964 3648 pts/1 Sl 2013 33:33 /usr/bin/virsh --connect qemu:///system console 2 kill -9 19449
重新登录console
# virsh console v03 Connected to domain v03 Escape character is ^]
问题二: KVM明明有内存很多的内存,但是因为内存不够无法创建虚拟机。
实际内存情况:
# free -m total used free shared buffers cached Mem: 32060 31180 879 0 163 22466 -/+ buffers/cache: 8550 23509 Swap: 16383 4 16379
KVM中可分配内存仅为890M:
# virsh freecell Total: 880492 KiB
发现是linxu下内存cache的问题,清理内存cache:
sync; echo 3 > /proc/sys/vm/drop_caches
现在的状态:
# free -m total used free shared buffers cached Mem: 32060 7652 24407 0 0 15 -/+ buffers/cache: 7635 24424 Swap: 16383 4 16379
现在KVM可分配内存如下所示:
virsh freecell Total: 24985164 KiB
😛 🙂