文档信息变更记录目录什么是vdi (3)vdi实现方式 (4)2.1.vdi实现原理 (4)2.2.实现协议 (4)spice与vnc的区别 (6)开源spice协议支持的功能 (7)OpenStack VDI 测试 (8)5.1.测试目标 (9)5.2.测试方案 (9)5.2.1.拓扑结构 (9)5.3.测试环境安装配置 (9)5.3.1.配置nova.conf (9)5.3.2.安装spicehtml5 (10)5.3.3.使用openstack启动虚拟机 (10)5.3.4.启动openstack的spiceProxy (10)5.4.VDI测试 (11)5.4.1.访问页面 (11)5.4.2.使用spice client访问虚拟机 (11)5.5.测试结论 (13)待解决问题 (13)什么是vdiVDI,英文全称Virtual Desktop Infrastructure,即虚拟桌面基础架构,正迅速成为一个热门词语。
VDI的概念很简单。
它不是给每个用户都配置一台运行Windows XP 或Vista(后文统称为Windows XP)的桌面PC,而是通过在数据中心的服务器运行Windows XP,将你的桌面进行虚拟化。
用户通过来自客户端设备(客户机或是家用PC)的客户计算协议与虚拟桌面进行连接,用户访问他们的桌面就像是访问传统的本地安装桌面一样。
vdi 实现方式2.1. vdi 实现原理VM VM VMVM VM VMVM VM VMTablet PCSpice VDI proxyISP用户用户数据计算节点计算节点计算节点1.请求桌面2.寻找空闲桌面3.返回空闲桌面4.返回用户数据5.将用户数据与桌面连接6.将生成好的带数据的桌面返回给用户VDI 的实现方式,无非在虚拟机之前加了一层VDI Router 的机制,至于底层协议是什么样的,完全取决于Router 怎么写。
Router 主要是将用户连接桌面的请求进行拦截,根据一定的规则找到闲置的虚拟桌面,再将用户的私有数据进行还原,最后把双方连接起来,这就是VDI 的基本原理。
2.2. 实现协议1. RDP 协议远程桌面协议(RDP, Remote Desktop Protocol )是一个多通道(multi-channel)的协议,让用户(客户端或称“本地电脑”)连上提供微软终端机服务的电脑(服务器端或称“远程电脑”)。
大部分的Windows都有客户端所需软件。
其他操作系统也有这些客户端软件,例如Linux、FreeBSD、Mac OS X。
服务端电脑方面,则听取送到TCP3389端口的数据。
RDP也是windows流行的协议,但是随着目前的趋势来看还是使用spice更加有前途.2.vncVNC (Virtual Network Computing)是虚拟网络计算机的缩写。
VNC 是一款优秀的远程控制工具软件,由著名的AT&T 的欧洲研究实验室开发的。
VNC 是在基于UNIX 和Linux 操作系统的免费的开源软件,远程控制能力强大,高效实用,其性能可以和Windows 和MAC 中的任何远程控制软件媲美。
在Linux 中,VNC 包括以下四个命令:vncserver,vncviewer,vncpasswd,和vncconnect。
大多数情况下我只需要其中的两个命令:vncserver 和vncviewer。
3.spicespice包括3个组件:SPICE Driver :SPICE驱动器存在于每个虚拟桌面内的组件;SPICE Device:SPICE设备存在于红帽企业虚拟化Hypervisor内的组件;SPICE Client:SPICE客户端存在于终端设备上的组件,可以是瘦客户机或专用的PC,用于接入每个虚拟桌面。
spice实现架构:spice与vnc的区别SPICE VNC BIOS屏幕显示能能全彩支持能能更改分辨率能能多显示器多显示器支持(高达4画面)只有一个屏幕图像传输图像和图形传输图像传输视频播放支持GPU加速支持不能音频传输双向语音可以控制不能鼠标控制客户端服务器都可以控制服务器端控制USB传输USB可以通过网络传输不能加密通讯可以使用SSL进行加密不能开源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 connectionOpenStack VDI 测试openstack grizzly版本开始支持spice协议,但是在2.1章节说的实现原理中的proxy实现上还有不足的地方,就是没有能够实现.5.1. 测试目标5.2. 测试方案图15.3. 测试环境安装配置5.3.1. 配置nova.conf在nova.conf 中加入spice 支持,使得生成的虚拟机能够通过openstack 提供的proxy 访问到[spice]#(StrOpt) location of spice html5 console proxy, in the form "http://$nova-html5proxy_host:6082/spice_auto.html"html5proxy_base_url=http://172.21.2.111:6082/spice_auto.html#(BoolOpt) enable spice related featuresenabled=false#(BoolOpt) enable spice guest agent supportagent_enabled=true#(StrOpt) keymap for spicekeymap=en-us#(StrOpt) IP address on which instance spice servers should listenserver_listen=172.21.2.11#(StrOpt) Management IP Address on which instance spiceservers will listen on the compute host.server_proxyclient_address=172.21.2.115.3.2. 安装spicehtml5安装spice-html5-0.1.2-2.el6.noarch最新版本:rpm –ivh spice-html5-0.1.2-2.el6.noarch.rpm5.3.3. 使用openstack启动虚拟机配置好nova.conf后,openstack启动虚拟机后,以前使用vnc的参数将变成-spice port=5900,addr=172.21.2.111这样虚拟机将监听5900端口,以方便spice client连接虚拟机使用.5.3.4. 启动openstack的spiceProxyopenstack的spiceproxy只是简单的实现1对1的远程桌面,并没有2.1章中的其他功能.openstack的spiceproxy相当于提供一个基于web界面访问方式的web服务器,将spicehtml5安装好以后,使用该proxy当做服务器来访问指定host 上的虚拟机.[******************]#service openstack-nova-spicehtml5proxy startStarting openstack-nova-spicehtml5proxy: [ OK ]5.4. VDI测试5.4.1. 访问页面访问http://172.21.2.111:6082/spice_auto.html能够看到当前主机上所有的虚拟机进行选择连接5.4.2. 使用spice client访问虚拟机1.windows下的spice client连接桌面:输入主机ip和端口号,还有密码172.21.2.111:5900密码1111112.连接后:连接后就可以远程访问虚拟机,进行安装等操作.5.5. 测试结论现阶段可以通过远程访问openstack控制节点的spiceproxy,当控制节点寻找到可用的虚拟机,然后返回虚拟机桌面.能够实现视频音频等的远程访问,详细列表见第四章.usb需要另外通过软件实现转发.但是openstack的spice实现的vdi还不具备虚拟桌面池的概念,就是说根据一定的规则找到闲置的虚拟桌面,再将用户的私有数据进行还原.按照目前的研究来看还是一个集中管理虚拟机的功能.需要研发一个真正功能的proxy的vdi代理服务.待解决问题1. VDI连接协议的问题需要解决。