[ovs-dev] [PATCH v2] ovn: Add hostname to Chassis.
Russell Bryant
russell at ovn.org
Wed Mar 23 19:41:07 UTC 2016
On Tue, Mar 22, 2016 at 5:14 PM, Justin Pettit <jpettit at ovn.org> wrote:
>
> > On Mar 22, 2016, at 12:20 PM, Russell Bryant <russell at ovn.org> wrote:
> >
> > @@ -89,7 +91,16 @@ chassis_run(struct controller_ctx *ctx, const char
> *chassis_id)
> > }
> > free(tokstr);
> >
> > + char hostname[HOST_NAME_MAX + 1];
> > + if (gethostname(hostname, sizeof hostname)) {
> > + hostname[0] = '\0';
> > + }
>
> Another option is that we could treat this similar to system-id. We could
> update the system integration scripts of OVS to create a new
> "external-ids:hostname" key/value in the Open_vSwitch schema.
> ovn-controller could then try to use that value and then fallback to
> calling gethostname() if it's not set. I don't feel strongly about it, but
> it might be useful information to other users of OVS.
It's funny you should suggest that! I was talking to someone about putting
a new hostname external-id in the Open_vSwitch db. I went and looked and
saw that ovs-ctl already supported an "--external-id" option to let you
pass in additional external-ids. The system startup scripts for both
Fedora/RHEL and Debian/Ubuntu both seemed to have a way to provide custom
additional arguments to pass to ovs-ctl. So, it seemed doable without
changes.
However, it seems common, useful, and harmless enough that adding it
automatically would be nice, too. I'll look at doing that with a follow-up
patch.
>
> > diff --git a/ovn/ovn-sb.xml b/ovn/ovn-sb.xml
> > index d62f1e4..e1a5812 100644
> > --- a/ovn/ovn-sb.xml
> > +++ b/ovn/ovn-sb.xml
> > @@ -162,6 +162,12 @@
> > not prescribe a particular format for chassis names.
> > </column>
> >
> > + <column name="hostname">
> > + The hostname of the chassis, if applicable. ovn-controller will
> populate
> > + this column with the hostname of the host it is running on.
> > + ovn-controller-vtep will leave this column empty.
> > + </column>
>
> In the vtep schema, it looks like there is a "name" in the
> "Physical_Switch" table that should map to the hostname. We should
> probably have ovn-controller-vtep populate that field here. I can look
> into doing that if you want.
>
Thanks for the tip! I can add this. It sounds easy enough.
> Acked-by: Justin Pettit <jpettit at ovn.org>
>
Thanks! I applied this to master, but will also follow up with additional
changes for the things discussed above.
--
Russell Bryant
More information about the dev
mailing list