[ovs-dev] [PATCH v2] ovn: Add hostname to Chassis.

Justin Pettit jpettit at ovn.org
Tue Mar 22 21:14:43 UTC 2016


> 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.

> 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.

Acked-by: Justin Pettit <jpettit at ovn.org>

--Justin





More information about the dev mailing list