Thank you for your friends to support this blog, welcome to discuss the exchange, due to the limited ability and time, error is unavoidable, welcome correction.
If reproduced, please keep the source author blog information.
Better Me Blog: Blog.csdn.net/tantexian
If you need to communicate, welcome to blog message. 1. Environment:
CentOS 6.5 min version: OpenStack Ice Edition: 192.168.1.210 Controller 192.168.1.211 Network 192.168.1.213 compute1 |
2, post the official website configuration:
SPICE Console OpenStack Compute supports VNC consoles to guests. The VNC protocol is fairly limited, lacking support for multiple monitors, bi-directional audio, reliable Cut-and-paste, V Ideo Streaming and more. SPICE is a new protocol, this aims to address the limitations in VNC and provide good Remote Desktop support. SPICE support in OpenStack Compute shares a similar architecture to the VNC implementation. The OpenStack Dashboard uses a SPICE-HTML5 widget in its console tab, communicates to Thenova-spicehtml5proxy service By using Spice-over-websockets. The Nova-spicehtml5proxy service communicates directly with the hypervisor process by using SPICE. VNC must is explicitly disabled to get access to the SPICE console. Set the vnc_enabled option to False on the [DEFAULT] section to disable the VNC console. Use the following options to configure SPICE as the console for OpenStack Compute:
Table 4.8. Description of configuration options for Spice
Configuration option = Default value |
Description |
[Spice] |
agent_enabled = True |
(boolopt) Enable Spice Guest Agent Support |
Enabled = False |
(boolopt) Enable Spice Related Features |
Html5proxy_base_url = http://127.0.0.1:6082/spice_auto.html |
(stropt) Location of spice HTML5 console proxies, in the form "http://127.0.0.1:6082/spice_auto.html" |
Keymap = en-US |
(stropt) Keymap for Spice |
Server_listen = 127.0.0.1 |
(stropt) IP address on which instance spice server should listen |
Server_proxyclient_address = 127.0.0.1 |
(stropt) The address to which proxy clients (like Nova-spicehtml5proxy) should connect |
Questions? Discuss on ask.openstack.org |
Configuration explanation:
Agent_enabled = False Enabled = True to configure the action source code:
You can see that enabled = True must first be turned on to support adding spice ports to the corresponding instance XML file. When Agent_enabled is set to False, the Tablet.type = "tablet" option is added to the XML (Note: This option synchronizes the mouse in the virtual machine with the outside) (This code: CONF.spice.enabled and not CONF.spice.agent_enabled)
Html5proxy_base_url = http://192.168.1.210:6082/spice_auto.html address is a node with Spice-html5.noarch spice-server installed, Here is the control node Server_listen = 0.0.0.0 Monitor all addresses server_proxyclient_address = 192.168.1.213 The IP address of the compute node that generated the virtual machine Note where the IP address can not be configured with 127.0.0.1, so that in the page access will request to the 127.0.0.1IP address (of course, if the host local login will be possible), the actual need to access the host control node address. |
3. First install the following packages on the control node:
Yum install-y spice-html5.noarch spice-server spice-client spice-protocol
4. Turn off the VNC Proxy service and turn on the Spice Proxy service
Chkconfig Openstack-nova-novncproxy off
Chkconfig Openstack-nova-spicehtml5proxy on
Service Openstack-nova-novncproxy Stop
Service Openstack-nova-spicehtml5proxy Restart
If startup Openstack-nova-spicehtml5proxy fails, execute the nova-spicehtml5proxy command directly and look at the error log.
The Log report cannot find the JS, CSS file, then the Spice-html5.noarch did not install successfully. Spice-html5.noarch can be found in the Epel source of the CentOS website.
To modify the control node configuration:
Vim/etc/nova/nova.conf
vnc_enabled = False [Spice]
# # Options defined in Nova.spice #
# Location of spice HTML5 console proxies, in the form # "Http://127.0.0.1:6082/spice_auto.html" (String value) Html5proxy_base_url=http://192.168.1.210:6082/spice_auto.html
# IP address on which instance spice server should listen # (String value) server_listen=0.0.0.1
# The address to which proxies clients (like nova- # Spicehtml5proxy) should connect (string value) server_proxyclient_address=192.168.1.210
# Enable Spice Related Features (Boolean value) Enabled=true
# Enable Spice Guest Agent Support (Boolean value) Agent_enabled=false
# Keymap for Spice (string value) Keymap=en-us |
Here's a screenshot: |
4. Modify the compute node nova.conf file
Vim/etc/nova/nova.conf vnc_enabled = False [Spice]
# # Options defined in Nova.spice #
# Location of spice HTML5 console proxies, in the form # "Http://127.0.0.1:6082/spice_auto.html" (String value) Html5proxy_base_url=http://192.168.1.210:6082/spice_auto.html
# IP address on which instance spice server should listen # (String value) server_listen=0.0.0.0
# The address to which proxies clients (like nova- # Spicehtml5proxy) should connect (string value) server_proxyclient_address=192.168.1.213
# Enable Spice Related Features (Boolean value) Enabled=true
# Enable Spice Guest Agent Support (Boolean value) Agent_enabled=false
# Keymap for Spice (string value) Keymap=en-us
|
5. Restart the service configuration file to take effect:
Control node: Service OPENSTACK-NOVA-API Restart service openstack-nova-cert Restart service Openstack-nova-consoleauth restart Service Openstack-nova-scheduler Restart Service openstack-nova-conductor Restart service Openstack-nova-novncproxy Stop service Openstack-nova-spicehtml5proxy Restart Note: This control node does not use its compute node function and therefore does not start the compute service. Please do it yourself according to the actual environment. View service Status: Nova-manage Service list |
COMPUTE nodes: Service Openstack-nova-compute Restart
View service Status: Nova-manage Service list |
6. Create a virtual machine in dashboard:
Click to enter the Test_spice_win7_2 console:
This completes the OpenStack Icehouse version of
Supplement 1: If Dashboard visits the spice console of the page, there is no connection. And the bottom of the nova-compute hanging off. If there is an error in Message Queuing, the debug feature may be causing the thread=false setting.
In this practice, if you modify the code to the following, this problem occurs:
if (' Eventlet ' in Sys.modules and Os.environ.get (' Eventlet_no_greendns ', '). LOWER ()! = ' yes '): Raise Importer Ror (' Eventlet imported before nova/cmd/__init__ ' (env var set to%s) '% OS.E Nviron.get (' Eventlet_no_greendns ')) os.environ[' eventlet_no_greendns '] = ' yes ' import Eventlet from Nova Import Debugger if debugger.enabled (): |