[Ovirt-devel] Re: [PATCH server] allow admin to setup iptables port forwarding on server for a vm's vnc port
Daniel P. Berrange
berrange at redhat.com
Tue Feb 3 16:16:10 UTC 2009
On Mon, Feb 02, 2009 at 11:00:30PM +0000, David Lutterkort wrote:
> On Mon, 2009-02-02 at 17:48 -0500, Mohammed Morsi wrote:
> > David Lutterkort wrote:
> > > On Wed, 2009-01-28 at 20:16 -0500, Mohammed Morsi wrote:
> > >
> > > To address the race condition, the simplest solution is to take an
> > > exclusive table lock on the vms table (before listing the assigned vnc
> > > ports !) and hold that until the vm is saved in the DB, i.e. the end of
> > > the current transaction.
> > >
> > >
> > This is not done as I'm a little concerned about locking the table (what
> > if the user doesn't submit the form and walks away, will it stay
> > locked?).
>
> I must have misunderstood the logic: I thought the port-assignment logic
> was happening as part of saving the VM, not when the form is presented
> to the user.
I rather think both options are wrong. Automatic port assignment should
be just done when starting a VM, so you don't have to reserve a tonne
of ports for inactive VMs.
> > I changed the additions to the server such that the
> > autogenerated port isn't displayed in the form, eg the user is prompted
> > to set the port or leave it at '0' after which the server will
> > autogenerate it immediately before saving.
>
> Yes, that's the flow that makes sense.
Does the user really need the ability to choose a specific port ? If there
is a non-trivial number of VMs, any port they might wish to reserve for
their own VM is probably already taken by another. With the ovirt-viewer
client app, they should never need to know what port is used for a VM,
since ovirt-viewer will automatically lookup the port for them.
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
More information about the ovirt-devel
mailing list