Allow config of vncserver_proxyclient_address.

* Improves deployment flexibility by allowing deployers to choose which address proxies like nova-xvpvncserver should use to to connect to instance proxies.  For xenserver, this will generally be the management ip of dom0.  For libvirt, this will be the management ip of the host.
 * Fixes bug 918451
 * Renames vncserver_host to vncserver_listen for slightly better usage clarity
 * Updates docs

Change-Id: I85c9850c57ffac3dfecaec4510eb808a6a2af79c
This commit is contained in:
Anthony Young 2012-01-18 14:54:22 -08:00
parent 2ff3e0eca2
commit a444e8ff39
5 changed files with 24 additions and 11 deletions

View File

@ -126,6 +126,16 @@ Important Options
-----------------
* :option:`--vnc_enabled=[True|False]` - defaults to True. If this flag is
not set your instances will launch without vnc support.
* :option:`--vncserver_host=[instance vncserver host]` - defaults to 127.0.0.1
* :option:`--vncserver_listen` - defaults to 127.0.0.1
This is the address that vncservers will bind, and should be overridden in
production deployments as a private address. Applies to libvirt only.
For multi-host libvirt deployments this should be set to a host
management ip on the same network as the proxies.
* :option:`--vncserver_proxyclient_address` - defaults to 127.0.0.1
This is the address that nova will instruct proxies to use when connecting to
to instance vncservers.
For all-in-one xen server domU deployments this can be set to 169.254.0.1.
For multi-host xen server domU deployments this can be set to a dom0
management ip on the same network as the proxies.
For multi-host libvirt deployments this can be set to a host
management ip on the same network as the proxies.

View File

@ -166,8 +166,8 @@
<target port='0'/>
</serial>
#if $getVar('vncserver_host', False)
<graphics type='vnc' port='-1' autoport='yes' keymap='${vnc_keymap}' listen='${vncserver_host}'/>
#if $getVar('vncserver_listen', False)
<graphics type='vnc' port='-1' autoport='yes' keymap='${vnc_keymap}' listen='${vncserver_listen}'/>
#end if
</devices>
</domain>

View File

@ -78,6 +78,7 @@ LOG = logging.getLogger('nova.virt.libvirt_conn')
FLAGS = flags.FLAGS
flags.DECLARE('live_migration_retry_count', 'nova.compute.manager')
flags.DECLARE('vncserver_proxyclient_address', 'nova.vnc')
# TODO(vish): These flags should probably go into a shared location
flags.DEFINE_string('rescue_image_id', None, 'Rescue ami image')
flags.DEFINE_string('rescue_kernel_id', None, 'Rescue aki image')
@ -782,7 +783,7 @@ class LibvirtConnection(driver.ComputeDriver):
return graphic.getAttribute('port')
port = get_vnc_port_for_instance(instance['name'])
host = instance['host']
host = FLAGS.vncserver_proxyclient_address
return {'host': host, 'port': port, 'internal_access_path': None}
@ -1186,7 +1187,7 @@ class LibvirtConnection(driver.ComputeDriver):
xml_info['config_drive'] = xml_info['basepath'] + "/disk.config"
if FLAGS.vnc_enabled and FLAGS.libvirt_type not in ('lxc', 'uml'):
xml_info['vncserver_host'] = FLAGS.vncserver_host
xml_info['vncserver_listen'] = FLAGS.vncserver_listen
xml_info['vnc_keymap'] = FLAGS.vnc_keymap
if not rescue:
if instance['kernel_id']:

View File

@ -50,6 +50,7 @@ XenAPI = None
LOG = logging.getLogger("nova.virt.xenapi.vmops")
FLAGS = flags.FLAGS
flags.DECLARE('vncserver_proxyclient_address', 'nova.vnc')
flags.DEFINE_integer('agent_version_timeout', 300,
'number of seconds to wait for agent to be fully '
'operational')
@ -59,9 +60,6 @@ flags.DEFINE_integer('xenapi_running_timeout', 60,
flags.DEFINE_string('xenapi_vif_driver',
'nova.virt.xenapi.vif.XenAPIBridgeDriver',
'The XenAPI VIF driver using XenServer Network APIs.')
flags.DEFINE_string('dom0_address',
'169.254.0.1',
'Ip address of dom0. Override for multi-host vnc.')
flags.DEFINE_bool('xenapi_generate_swap',
False,
'Whether to generate swap (False means fetching it'
@ -1392,7 +1390,7 @@ class VMOps(object):
% (str(vm_ref), session_id)
# NOTE: XS5.6sp2+ use http over port 80 for xenapi com
return {'host': FLAGS.dom0_address, 'port': 80,
return {'host': FLAGS.vncserver_proxyclient_address, 'port': 80,
'internal_access_path': path}
def host_power_action(self, host, action):

View File

@ -30,8 +30,12 @@ flags.DEFINE_string('xvpvncproxy_base_url',
'http://127.0.0.1:6081/console',
'location of nova xvp vnc console proxy, \
in the form "http://127.0.0.1:6081/console"')
flags.DEFINE_string('vncserver_host', '127.0.0.1',
'the host interface on which vnc server should listen')
flags.DEFINE_string('vncserver_listen', '127.0.0.1',
'Ip address on which instance vncservers\
should listen')
flags.DEFINE_string('vncserver_proxyclient_address', '127.0.0.1',
'the address to which proxy clients \
(like nova-xvpvncproxy) should connect')
flags.DEFINE_bool('vnc_enabled', True,
'enable vnc related features')
flags.DEFINE_string('vnc_keymap', 'en-us',