[OpenStack-Infra] [shade] Get server public/private ip failed on VLAN environment

Monty Taylor mordred at inaugust.com
Thu Jun 21 22:49:32 UTC 2018


On 06/20/2018 11:16 PM, xudan (N) wrote:
> Hi all,
> 
> I am from OPNFV community and working on Dovetail project.

Hi!

> I have a question about shade getting server public ipv4 ip and private 
> ipv4 ip with VLAN environment.
> 
> The private ip I got is None and the public ip I got is not the floating 
> ip assigned to the server.
> 
> I guess this is because of shade filters the public ip with 
> ‘router:external = True’ or ‘provider:physical_network’ 
> https://github.com/openstack-infra/shade/blob/master/shade/openstackcloud.py#L2494
> 
> For vlan, all networks have the attribute ‘provider:physical_network’, 
> so all networks are regarded as public network.
> 
> Also it filters private ip with condition ‘not 
> network.get('router:external', False) and not 
> network.get(‘provider:physical_network')’ 
> https://github.com/openstack-infra/shade/blob/master/shade/openstackcloud.py#L2509
> 
> Then there is no private network for vlan. So the server’s private ip is 
> None.
> 
> I reached out you for some suggestions about how to use shade for VLAN 
> environment? Have you considered that or I just misunderstood something.

Well - first of all, sorry that this is strange. This is all to work 
around there being no neutron concept of a "public" or "private" network.

For scenarios such as yours, there are some config overrides you can use 
in clouds.yaml. An example can be seen here:

http://git.openstack.org/cgit/openstack-infra/system-config/tree/modules/openstack_project/templates/puppetmaster/all-clouds.yaml.erb#n2

In the Internap cloud, all accounts are assigned a dedicated WAN and LAN 
network - but from the code perspective they look identical and we can't 
properly discover what should be used for what. We mark the WAN network 
as "routes_externally: true" so that shade will pick it. We didn't do 
the same thing for the other network because we're not using it.

I think for your case, you could list both, and list one as true and one 
as false.

If you want to use the auto_ip feature, you might also need to mark the 
internal network as nat_destination: true.

The full docs are here:

https://docs.openstack.org/openstacksdk/latest/user/config/network-config.html

It's also possible there is some better way to detect the difference 
that could be added to the existing code. If we can do that and have it 
not break the existing discovery, I'd love to support more things.

Does this help?

Thanks!
Monty



More information about the OpenStack-Infra mailing list