Description =========== In openstack kilo release(I know it's somekind of out of date, howerver I noticed that the code cause this issue still exists in the latest nova.git repo), if you use spice as the default console, the type of a spice channel(used by apice agent) is 'pyt', which should be 'spicevmc'. Steps to reproduce ================== 1. Modify the nova.conf to use spice as default console. Edit /etc/nova/nova.conf, add the following lines: [default] vnc_enabled=false [spice] html5proxy_base_url=http://192.168.209.11:6082/spice_auto.html server_listen=0.0.0.0 server_proxyclient_address=192.168.209.31 enabled=true keymap=en-us 2. Modify the nova-compute log level to debug(For convenience, I just edit the log code from LOG.debug to LOG.error.) The log code is in: /usr/lib/python2.7/site-packages/nova/virt/libvirt/config.py def to_xml(self, pretty_print=True): root = self.format_dom() xml_str = etree.tostring(root, pretty_print=pretty_print) LOG.debug("Generated XML %s ", (xml_str,)) return xml_str Restart the openstack-nova-compute.service: systemctl restart openstack-nova-compute.service 3. Start an instance. 4. Check the printed xml in /var/log/nova/nova-compute.log, you will see the generated xml: 2016-10-18 16:54:36.848 7061 ERROR nova.virt.libvirt.config [req-76070e65-4c92-41eb-9ee6-a124fefae4d2 03a011159e8d464bafc89a88823a7403 92de23d236a6461f96c43e71ac7c60ae - - -] Generated XML ('\n 38181e25-df56-4594-97e6-f1da2bfe1579\n instance-00000044\n 4194304\n 2\n \n \n \n test\n 2016-10-18 08:54:36\n \n 4096\n 40\n 0\n 0\n 2\n \n \n admin\n admin\n \n \n \n \n \n \n Fedora Project\n OpenStack Nova\n 2015.1.2-1.el7\n 4d6ca91a-f38e-4329-95cc-0ff79326bd37\n 38181e25-df56-4594-97e6-f1da2bfe1579\n \n \n \n hvm\n \n \n \n \n \n \n \n \n 2048\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n',) Expected result =============== The channel type should be 'spicevmc', like this: I confirmed the expect result from the following aspects: 1. Firstly, the test code in nova/tests/unit/virt/libvirt/test_config.py(latest nova.git repo) 1411 class LibvirtConfigGuestChannelTest(LibvirtConfigBaseTest): 1412 def test_config_spice_minimal(self): 1413 obj = config.LibvirtConfigGuestChannel() 1414 obj.type = "spicevmc" 1415 1416 xml = obj.to_xml() 1417 self.assertXmlEqual(xml, """ 1418 1419 1420 """) 1421 1422 def test_config_spice_full(self): 1423 obj = config.LibvirtConfigGuestChannel() 1424 obj.type = "spicevmc" 1425 obj.target_name = "com.redhat.spice.0" 1426 1427 xml = obj.to_xml() 1428 self.assertXmlEqual(xml, """ 1429 1430 1431 """) 2. Secondly, if we use the channel whose type is 'pty', and install vdagent or spice-guest-tools-0.100.exe in windows 7 guest os, the CPU utilization of vdagent.exe is very high(I noticed both %50 and 99%, in two instances), and the error log is printed: (C:\Windows\Temp\vdagent.log) 1724::INFO::2016-10-18 0613:21,821::VDAgent::run::***Agent started in session 1*** 1724::INFO::2016-10-18 0613:21,821::log_version::0.5.1.0 1724::INFO::2016-10-18 0613:21,821::DesktopLayout::consistent_displays::#qxls 1 #others 0 1724::INFO::2016-10-18 0613:21,821::VDAgent::send_announce_capabilities::Sending capabilities: 1724::INFO::2016-10-18 0613:21,821::VDAgent::send_announce_capabilities::6B7 1724::INFO::2016-10-18 0613:21,821::VDAgent::run::Connected to server 1724::INFO::2016-10-18 0613:21,821::VDAgent::input_desktop_message_loop::Desktop: Winlogon 1724::INFO::2016-10-18 0613:21,821::VDAgent::write_completion:vio_serial write completion error 554 The mouse cursor moves slowly, you also cannot use clipboard between the guest os and the client. If I modify the channel type to 'spicevmc', all the problems disappeared. Actual result ============= The channel type for spice agent is 'pty': Environment =========== 1. OS and openstack release [root@node3 ~]# cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) [root@node3 ~]# uname -a Linux node3 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux [root@node3 ~]# rpm -qa | grep nova openstack-nova-common-2015.1.2-1.el7.noarch openstack-nova-compute-2015.1.2-1.el7.noarch python-nova-2015.1.2-1.el7.noarch python-novaclient-2.23.0-1.el7.noarch 2. Hypervisor Libvirt + QEMU + KVM [root@node3 ~]# rpm -qa | grep libvirt libvirt-client-1.2.17-13.el7_2.5.x86_64 libvirt-daemon-driver-nodedev-1.2.17-13.el7_2.5.x86_64 libvirt-daemon-driver-storage-1.2.17-13.el7_2.5.x86_64 libvirt-daemon-1.2.17-13.el7_2.5.x86_64 libvirt-daemon-driver-nwfilter-1.2.17-13.el7_2.5.x86_64 libvirt-daemon-driver-secret-1.2.17-13.el7_2.5.x86_64 libvirt-python-1.2.17-2.el7.x86_64 libvirt-daemon-driver-qemu-1.2.17-13.el7_2.5.x86_64 libvirt-daemon-kvm-1.2.17-13.el7_2.5.x86_64 libvirt-daemon-driver-network-1.2.17-13.el7_2.5.x86_64 libvirt-daemon-driver-interface-1.2.17-13.el7_2.5.x86_64 [root@node3 ~]# rpm -qa | grep qemu libvirt-daemon-driver-qemu-1.2.17-13.el7_2.5.x86_64 qemu-kvm-common-1.5.3-105.el7_2.7.x86_64 ipxe-roms-qemu-20160127-1.git6366fa7a.el7.noarch qemu-img-1.5.3-105.el7_2.7.x86_64 qemu-kvm-1.5.3-105.el7_2.7.x86_64 Logs & Configs ============== Normal vdagent log if I use the 'spicevmc' channel type: 1284::INFO::2016-10-18 06:39:43,000::VDAgent::run::***Agent started in session 1*** 1284::INFO::2016-10-18 06:39:43,000::log_version::0.5.1.0 1284::INFO::2016-10-18 06:39:43,000::DesktopLayout::consistent_displays::#qxls 1 #others 0 1284::INFO::2016-10-18 06:39:43,000::VDAgent::send_announce_capabilities::Sending capabilities: 1284::INFO::2016-10-18 06:39:43,000::VDAgent::send_announce_capabilities::6B7 1284::INFO::2016-10-18 06:39:43,000::VDAgent::run::Connected to server 1284::INFO::2016-10-18 06:39:43,000::VDAgent::input_desktop_message_loop::Desktop: Winlogon 1284::INFO::2016-10-18 06:39:43,031::VDAgent::handle_announce_capabilities::Got capabilities (1) 1284::INFO::2016-10-18 06:39:43,031::VDAgent::handle_announce_capabilities::1077 1284::INFO::2016-10-18 06:39:43,031::VDAgent::send_announce_capabilities::Sending capabilities: 1284::INFO::2016-10-18 06:39:43,031::VDAgent::send_announce_capabilities::6B7 1284::INFO::2016-10-18 06:39:43,046::DisplaySetting::set::setting display options 1284::INFO::2016-10-18 06:39:43,046::DisplaySetting::get_user_process_id::explorer.exe not found 1284::INFO::2016-10-18 06:39:43,046::DisplaySetting::reload_from_registry::get_user_process_id failed 1284::INFO::2016-10-18 06:39:43,046::VDAgent::handle_max_clipboard::Set max clipboard size: 104857600 1284::INFO::2016-10-18 06:39:43,046::VDAgent::handle_mon_config::0. 1024*768*32 (0,0) 1 1284::INFO::2016-10-18 06:39:43,046::DesktopLayout::consistent_displays::#qxls 1 #others 0 1284::INFO::2016-10-18 06:39:43,046::DesktopLayout::set_displays::Set display mode 1024x768 1284::INFO::2016-10-18 06:39:43,078::VDAgent::wnd_proc::Display change 1284::INFO::2016-10-18 06:39:43,078::DesktopLayout::consistent_displays::#qxls 1 #others 0 1284::INFO::2016-10-18 06:39:48,625::VDAgent::handle_control_event::Control command 2 1284::INFO::2016-10-18 06:39:48,625::VDAgent::handle_control_event::session logon 1284::INFO::2016-10-18 06:39:54,046::VDAgent::handle_control_event::Control command 1 1284::INFO::2016-10-18 06:39:54,062::VDAgent::input_desktop_message_loop::Desktop: Default 1284::INFO::2016-10-18 06:39:54,062::VDAgent::input_desktop_message_loop::First display setting 1284::INFO::2016-10-18 06:39:54,062::DisplaySetting::load::loading display setting 1284::INFO::2016-10-18 06:39:54,062::DisplaySetting::get_user_process_id::explorer.exe not found 1284::INFO::2016-10-18 06:39:54,062::DisplaySetting::reload_from_registry::get_user_process_id failed 1284::INFO::2016-10-18 06:40:25,187::VDAgent::handle_clipboard_grab::grab type 1 1284::INFO::2016-10-18 06:40:29,937::VDAgent::handle_control_event::Control command 3 1284::INFO::2016-10-18 06:40:29,937::VDAgent::handle_clipboard_grab::grab type 1 1284::INFO::2016-10-18 06:40:35,578::VDAgent::handle_control_event::Control command 3 1284::INFO::2016-10-18 06:40:35,578::VDAgent::handle_clipboard_grab::grab type 1 Patch ============== From 2309f146f08c0d0c541ba3e8b392ee9ca072bd64 Mon Sep 17 00:00:00 2001 From: m4cr0v