[openstack-dev] [Nova] Why Nova should fail to boot if there are only one private network and one public network ?
philip.day at hp.com
Fri Jan 24 17:12:38 UTC 2014
Thanks for the clarification, I'd missed that it was where the public network belonged to the same tenant (it's not a use case we run with).
So I can see that option  would make the validation work by (presumably) not including the shared network in the list of networks, but looking further into the code allocate_for_instance() uses the same call to decide which networks it needs to create ports for, and from what I can see it would attach the instance to both networks.
However that feels like the same problem that the patch was originally trying to fix, in that the network order isn't controlled by the user, and many Guest OS's will only configure the first NIC they are presented with. The idea was that in this case the user needs to explicitly specify the networks in the order that they want them to be attached to.
Am I still missing something ?
From: Sylvain Bauza [mailto:sylvain.bauza at bull.net]
Sent: 24 January 2014 14:02
To: OpenStack Development Mailing List (not for usage questions)
Cc: Day, Phil
Subject: Re: [openstack-dev] [Nova] Why Nova should fail to boot if there are only one private network and one public network ?
Le 24/01/2014 14:13, Day, Phil a écrit :
The change only makes the user have to supply a network ID if there is more than one private network available (and the issue there is that otherwise the assignment order in the Guest is random, which normally leads to all sorts of routing problems).
I'm sorry, but the query also includes shared (so, public) networks from the same tenant. See .
I'm running a standard Devstack with Neuron (built from trunk a couple of days ago), can see both a private and public network, and can boot VMs without having to supply any network info:
Indeed, that does work because Devstack is smart enough for creating the two networks with distinct tenant_ids. See  as a proof :-)
If someone is building a private and a public network *on the same tenant*, it will fail to boot. Apologies if I was unclear.
So, the question is : what shall I do for changing this ? There are 2 options for me:
1. Add an extra param to _get_available_networks : shared=True and only return shared networks if the param is set to True (so we keep compatibility with all the calls)
2. Parse the nets dict here  to expurge the shared networks when len(nets) > 1. That's simple but potentially a performance issue, as it's O(N).
I would personnally vote for #1 and I'm ready to patch. By the way, the test case needs also to be updated .
 : http://paste.openstack.org/show/61819/
 : https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L528
 : https://github.com/openstack/nova/blob/master/nova/tests/network/test_neutronv2.py#L1028
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OpenStack-dev