Mohammed Morsi
2009-Mar-06 01:30 UTC
[Ovirt-devel] [PATCH server] fixed static ip address of management port in taskomatic vnc module
--- src/task-omatic/vnc.rb | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/task-omatic/vnc.rb b/src/task-omatic/vnc.rb index 0fd3afd..b0a800a 100644 --- a/src/task-omatic/vnc.rb +++ b/src/task-omatic/vnc.rb @@ -27,11 +27,6 @@ class VmVnc VNC_DEBUG = false - # FIXME can this be retreived in any way - # since machine will have both external - # and internal network interface - LOCAL_IP = '192.168.50.2' - def self.debug(msg) puts "\n" + msg + "\n" if VNC_DEBUG end @@ -81,8 +76,10 @@ class VmVnc def self.get_nat_rules(vm) ip = find_host_ip(vm.host.hostname) + server,port = get_srv('ovirt', 'tcp') + local_ip = find_host_ip(server) return " -p tcp --dport " + vm.forward_vnc_port.to_s + " -j DNAT --to " + ip + ":" + vm.vnc_port.to_s, - " -d " + ip + " -p tcp --dport " + vm.vnc_port.to_s + " -j SNAT --to " + LOCAL_IP + " -d " + ip + " -p tcp --dport " + vm.vnc_port.to_s + " -j SNAT --to " + local_ip end def self.run_command(cmd) -- 1.6.0.6
Ian Main
2009-Mar-06 03:19 UTC
[Ovirt-devel] Re: [PATCH server] fixed static ip address of management port in taskomatic vnc module
HOLY ACK BATMAN!! IT WORKS AWESOME! :) Ian On Thu, 05 Mar 2009 20:30:33 -0500 Mohammed Morsi <mmorsi at redhat.com> wrote:> --- > src/task-omatic/vnc.rb | 9 +++------ > 1 files changed, 3 insertions(+), 6 deletions(-) > > diff --git a/src/task-omatic/vnc.rb b/src/task-omatic/vnc.rb > index 0fd3afd..b0a800a 100644 > --- a/src/task-omatic/vnc.rb > +++ b/src/task-omatic/vnc.rb > @@ -27,11 +27,6 @@ class VmVnc > > VNC_DEBUG = false > > - # FIXME can this be retreived in any way > - # since machine will have both external > - # and internal network interface > - LOCAL_IP = '192.168.50.2' > - > def self.debug(msg) > puts "\n" + msg + "\n" if VNC_DEBUG > end > @@ -81,8 +76,10 @@ class VmVnc > def self.get_nat_rules(vm) > ip = find_host_ip(vm.host.hostname) > > + server,port = get_srv('ovirt', 'tcp') > + local_ip = find_host_ip(server) > return " -p tcp --dport " + vm.forward_vnc_port.to_s + " -j DNAT --to " + ip + ":" + vm.vnc_port.to_s, > - " -d " + ip + " -p tcp --dport " + vm.vnc_port.to_s + " -j SNAT --to " + LOCAL_IP > + " -d " + ip + " -p tcp --dport " + vm.vnc_port.to_s + " -j SNAT --to " + local_ip > end > > def self.run_command(cmd) > -- > 1.6.0.6 >
Ian Main
2009-Mar-06 03:20 UTC
[Ovirt-devel] Re: [PATCH server] fixed static ip address of management port in taskomatic vnc module
On Thu, 05 Mar 2009 20:30:33 -0500 Mohammed Morsi <mmorsi at redhat.com> wrote: Just a note that in the WUI the uri for vnc viewer shows up as http://whatever:1234, I don't think that's right.. Ian