虚拟机使用SPICE连接,虚拟机里安装 了vdagent,是从spice官网下载的
使用openstack运行虚拟机后发现虚拟机里CPU占用率100%,查找的话发现是vdagent服务导致的。
查看vdagent日志
应该是vio_serial的问题
用virsh dumpxml去看和正常的区别,会发现有channel设备类型是pty,应该是spicevmc才对
所以就暴力的修改源代码来解决吧,虚拟机没有声音,顺便增加了声音设备
修改如下:
diff -aruN nova-2015.1.0.org/nova/virt/libvirt/config.py nova-2015.1.0/nova/virt/libvirt/config.py
--- nova-2015.1.0.org/nova/virt/libvirt/config.py 2015-10-29 15:01:39.819057624 +0800
+++ nova-2015.1.0/nova/virt/libvirt/config.py 2015-10-29 15:03:36.093143274 +0800
@@ -1329,7 +1329,14 @@
return dev
-
+class LibvirtConfigGuestSound(LibvirtConfigGuestDevice): #wz
+ def __init__(self, **kwargs):
+ super(LibvirtConfigGuestSound, self).__init__(root_name="sound",**kwargs)
+ self.type = "ich6"
+ def format_dom(self):
+ dev = super(LibvirtConfigGuestSound, self).format_dom()
+ dev.set("model",

在OpenStack KVM环境中,使用SPICE连接的Windows虚拟机安装vdagent后,出现CPU占用100%的情况。问题源于vio_serial,正确配置应为spicevmc。通过修改虚拟机XML配置文件,将channel设备类型从pty更改为spicevmc,并添加声音设备,解决了此问题。参考了相关博客进行修复。
最低0.47元/天 解锁文章
1753

被折叠的 条评论
为什么被折叠?



