mitaka版本openstack虚拟化云桌面的实现(spice)

来源:互联网 发布:传奇霸业宝石数据 编辑:程序博客网 时间:2024/05/17 21:43

作者:【吴业亮】云计算开发工程师
博客:http://blog.csdn.net/wylfengyujiancheng

  1. 什么是vdi
    VDI,英文全称Virtual Desktop Infrastructure,即虚拟桌面基础架构,正迅速成为一个热门词语。
    VDI的概念很简单。它不是给每个用户都配置一台运行Windows XP 或Vista(后文统称为Windows XP)的桌面PC,而是通过在数据中心的服务器运行Windows XP,将你的桌面进行虚拟化。用户通过来自客户端设备(客户机或是家用PC)的客户计算协议与虚拟桌面进行连接,用户访问他们的桌面就像是访问传统的本地安装桌面一样。
  2. vdi实现方式
    2.1. vdi实现原理
    这里写图片描述
    VDI的实现方式,无非在虚拟机之前加了一层VDI Router的机制,至于底层协议是什么样的,完全取决于Router怎么写。Router主要是将用户连接桌面的请求进行拦截,根据一定的规则找到闲置的虚拟桌面,再将用户的私有数据进行还原,最后把双方连接起来,这就是VDI的基本原理。

2.2. 实现协议

RDP协议
远程桌面协议(RDP, Remote Desktop Protocol)是一个多通道(multi-channel)的协议,让用户(客户端或称“本地电脑”)连上提供微软终端机服务的电脑(服务器端或称“远程电脑”)。大部分的Windows都有客户端所需软件。其他操作系统也有这些客户端软件,例如Linux、FreeBSD、Mac OS X。服务端电脑方面,则听取送到TCP3389端口的数据。
RDP也是windows流行的协议,但是随着目前的趋势来看还是使用spice更加有前途.

vnc
VNC (Virtual Network Computing)是虚拟网络计算机的缩写。VNC 是一款优秀的远程控制工具软件,由著名的 AT&T 的欧洲研究实验室开发的。VNC 是在基于 UNIX 和 Linux 操作系统的免费的开源软件,远程控制能力强大,高效实用,其性能可以和 Windows 和 MAC 中的任何远程控制软件媲美。 在 Linux 中,VNC 包括以下四个命令:vncserver,vncviewer,vncpasswd,和 vncconnect。大多数情况下我只需要其中的两个命令:vncserver 和 vncviewer。

spice
spice包括3个组件:
SPICE Driver :SPICE驱动器 存在于每个虚拟桌面内的组件;
SPICE Device:SPICE设备 存在于红帽企业虚拟化Hypervisor内的组件;
SPICE Client:SPICE客户端 存在于终端设备上的组件,可以是瘦客户机或专用的PC,用于接入每个虚拟桌面。
这里写图片描述
spice实现架构:
这里写图片描述
3. spice与vnc的区别
这里写图片描述
4. 开源spice协议支持的功能
当前支持功能:
图形界面 - processes and transmits 2D graphic commands
视频流 - heuristically identifies video streams and transmits M-JPEG video streams
图片压缩 - offers verios compression algorithm that were built specifically for Spice, including QUIC (based on SFALIC), LZ, GLZ (history-based global dictionary), and auto (heuristic compression choice per image)
硬件鼠标- processes and transmits cursor-specific commands
图像,颜色,鼠标缓存 - manages client caches to reduce bandwidth requirements
在线切换 - supports clients while migrating Spice servers to new hosts, thus avoiding interruptions
Windows 驱动 - Windows drivers for QXL display device and VDI-port
多监视器
客户端支持linux和windows - can be easily ported to additional platforms.
立体声音频 - supports audio playback and captures; audio data stream is optionally compressed using CELT
加密 - using OpenSSL
两种鼠标模式- provides client (more user-friendly) and server (increased accuracy and fully synchronized) modes
音频视频同步 - synchronizes video streams with audio clocks
Spice 代理 - running on the guest and performs tasks for the client
剪切板共享 - allows copy paste between clients and the virtual machine
未来将支持的新功能:
网络隧道 (in progress) - using virtual network interface to enable sharing of network resources. Currently the focus is on printer sharing but is not limited to that.
Off-screen surfaces (in progress) - supports off-screen surfaces as infrastructure for future DirectDraw, video acceleration and 3D acceleration. GDI and X11 will also benefit from this feature. It will also lay foundation for multi-head support
共享usb (in progress) - allows clients to share their USB devices with Spice servers
Direct Draw
客户端GUI - Enables user-friendly configuration
屏幕管理 - add support for enabling selection of the screen used by the client
配置文件 - enables persistent user and administrative settings
共享光驱 - share your CD with Spice server
视频加速
3D加速
支持Aero
Linux features parity
OSX client
Simultaneous clients connection
5. 官方文档参数介绍
这里写图片描述
6. 安装配置
6.1. 修改控制节点
安装源:

# yum install epel* centos-openstack-mitaka –y# yum install centos-release-openstack-mitaka -y

安装软件

# yum install spice-server spice-protocol openstack-nova-spicehtml5proxy spice-html5

修改配置文件,注释掉原vnc相关配置,添加以下配置信息。
这里需要明确指定vnc_enabled=false,否则即使配置了spice,系统也仍然使用vnc(参考官方文档说明)

# vim /etc/nova/nova.conf  [default]vnc_enabled=false[spice]html5proxy_host=172.16.8.100html5proxy_port=6082keymap=en-us  

停止novncproxy并取消自启动

# systemctl stop openstack-nova-novncproxy.service# systemctl disable openstack-nova-novncproxy.service

启用spicehtml5proxy开机自启动并启动它

# systemctl enable openstack-nova-spicehtml5proxy.service# systemctl start openstack-nova-spicehtml5proxy.service  

6.2. 修改计算节点
安装源:

# yum install epel* centos-openstack-mitaka –y

安装软件包

# yum install spice-server spice-protocol spice-html5  

修改配置文件,注释掉原vnc相关配置,添加以下配置信息

# vim /etc/nova/nova.conf  [default]vnc_enabled=false[spice]html5proxy_base_url=http://172.16.8.100:6082/spice_auto.htmlserver_listen=0.0.0.0server_proxyclient_address=172.16.8.100enabled=truekeymap=en-us  

重启启动nova-compute

# systemctl restart openstack-nova-compute.service  

在dashboard上创建虚拟机,打开控制台
这里写图片描述

7、其他说明:
基于ubuntu的spice

# apt-get install qemu-kvm-spice

安装完毕后在创建虚拟机时,qemu-kvm-spice自动替代原有虚拟化kvm功能

也可直接用spice专业客户端直接连接计算节点
客户端可直接从http://www.spice-space.org/download.html下载

参考:

http://wenku.baidu.com/view/e50de608a8114431b90dd811.html
0 0
原创粉丝点击