openstack中 novnc配置相关选项 VNC配置

来源:互联网 发布:python交换两个值 编辑:程序博客网 时间:2024/06/04 18:47
--vnc_enabled=true

--novnc_enabled=true

--vncserver_listen=127.0.0.1
generally set to the hosts management ip, rather than the public ip or 0.0.0.0, for security reasons.
read by nova-compute to instantiate VMs

--vncserver_proxyclient_address=127.0.0.1
read by libvirt driver to compute vnc-console URL
needs to be one of the compute nodes ips though.

--novncproxy_base_url=http://192.168.0.202:6080/vnc_auto.html
read by nova-compute to compose vnc-console URL for novnc

--xvpvncproxy_base_url=http://192.168.0.202:6081/console

--xvpvncproxy_port=6081

--novncproxy_port=65535


开源的东西,有时候会让人生不如死!!

只是因为没能在合适的时间,碰到合适的文档!!

今天终于让我得了个正着!!

真的是相逢很晚呀!!

http://www.pubyun.com/blog/openstack/openstack%E4%B8%8Bvnc%E7%9A%84%E9%85%8D%E7%BD%AE/

由于云主机instance所在的compute一般在内网运行,而instance的VNC端口,是绑定在compute的IP地址上。外网的客户,需要访问instance的VNC,就需要使用Proxy代理。客户访问VNC,一般有两种方式的客户端,分别对应两种Proxy:

1、支持web socket的浏览器,比如 Chrome, FireFox等,使用 NoVNC
2、java客户端代理,使用xvpvncproxy

为了客户方便,一般使用第一种方式,这里就讲讲第一种方式下的VNC配置。

1、安装软件
1)在控制节点 controller上,需要安装:
nova-consoleauth
novnc
python-novnc

第一个软件包,直接apt安装,后面两个软件包,目前ubuntu下有问题,不能正常启动,请使用我编译的最新版本:

http://openstack.pubyun.com/ubuntu/

注:
也可以将控制节点放在内网,专门设置一个api节点,这时,nova-consoleauth就需要安装在控制节点上,另外两个软件包安装在api节点上。

2)计算节点compute上,不需要特别安装什么软件,只要正确设置

2、配置

假定网络接入如下:

控制节点或者api节点: 公网地址 192.168.28.4 管理口内网地址:10.0.0.4计算节点: 管理口内网地址: 10.0.0.6实例VM的IP地址段:10.9.0.0/24

1)控制节点或 api 节点配置

vncserver_proxyclient_address=10.0.0.6novncproxy_base_url=http://192.168.28.4:6080/vnc_auto.htmlxvpvncproxy_base_url=http://192.168.28.4:6081/console

2)计算节点配置

vncserver_proxyclient_address=10.0.0.6novncproxy_base_url=http://192.168.28.4:6080/vnc_auto.htmlxvpvncproxy_base_url=http://192.168.28.4:6081/console#设定 compute上,vnc绑定的IPvncserver_listen=10.0.0.6

3、测试

1) 在控制节点上,要能够连接计算节点的 vnc,比如第一个vnc端口是5900

# telnet 10.0.0.6 5900Trying 10.0.0.6...Connected to 10.0.0.6.Escape character is '^]'.RFB 003.008

2) 外网用户,要能够连接控制节点的6800端口

3)使用浏览器测试

注意,请使用 chrome 和 firefox 等支持 HTML5 和 websocket 的浏览器测试。IE至少需要 IE9 ,而且还可能有问题。

# nova get-vnc-console t1 novnc

+-------+-----------------------------------------------------------------------------------+| Type | Url |+-------+-----------------------------------------------------------------------------------+| novnc | http://192.168.28.4:6080/vnc_auto.html?token=f5abd84d-708f-4486-af61-40c6e5a876c0 |+-------+-----------------------------------------------------------------------------------+