[openstack-dev] [nova] Add tenant name to the local domain name with nova-network

Vishvananda Ishaya vishvananda at gmail.com
Thu Nov 22 18:07:38 UTC 2012


On Nov 22, 2012, at 1:46 AM, Édouard Thuleau <thuleau at gmail.com> wrote:

> Hi Vish,
> 
> I try to implement a solution to add the tenant name to the local domain name of a tenant with nova network. Like you propose in this code review: https://review.openstack.org/#/c/16153/6
> 
> But I got a problem. I don't know how to obtain the tenant name.
> I can get it from the context but this context is not often filled with the tenant name (when the network initiate the host for example).
> In the network DB entry, I can find the tenant ID. But I don't know how to obtain the tenant name from this ID, is it  possible ?

Ah, good point. The tenant name isn't really visible inside of nova except for logging purposes.
> 
> 
> If not, I must change the network DB entry to contain the tenant_name or a domain field built from the tenant name + CONF.dhcp_domain.

I guess we are stuck using the project_id (from the instance). I think adding project_name to the instances table is probably a bad idea. Another option would be to look up the name in keystone but that seems a bit risky and bad for performance.
> 
> Or perhaps, we can use the field 'label' in network DB entry. Instead of use the tenant name. We can append the network label with the flag 'dhcp_domain'.

The label field is the same across all tenants in flatdhcp. It could be different per tenant in vlan mode, although the networks are dynamically assigned, so in this case it would make sense to change the label when we set the project_id for the network, so I think you would run into the same issue. The only time it would really be helpful is if you are in vlan mode and you are preallocating networks to projects when you create them.

> 
> Another question not in relation with precedent, do you plan to backport your bp https://blueprints.launchpad.net/nova/+spec/shared-dhcp-ip to Folsom ? This patch is very small and hasn't a big impact to the nova network code.

I don't think it is appropriate for stable/folsom as it is a new feature. You will likely have to carry the patch (or convince your distro to carry it) if you want to use it.

Vish

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20121122/2466025e/attachment.html>


More information about the OpenStack-dev mailing list