Ask Your Question

How does neutron choose subnet [closed]

asked 2017-04-26 07:22:28 -0600

pquigs gravatar image

I have Mitaka installed, running classic Open vSwitch implementation with core components plus Horizon and Heat. I have a private network defined with 2 subnets. I've read that you cannot control which subnet an instance is deployed to, though it would be a nice "feature" to add ;-)

My question is this - how does neutron choose a subnet? In my case, it seems to pick the most recent one that I defined, but I'm guessing that's just due to the names. Is there an algorithm that explains the subnet selection process?


edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by pquigs
close date 2017-10-13 11:46:34.174690

1 answer

Sort by » oldest newest most voted

answered 2017-05-07 11:59:25 -0600

mlschuler gravatar image

updated 2017-05-16 14:34:37 -0600

If you have defined several subnets in a single network you may choose the subnet a port is created in. The syntax is: openstack port create --network <network> --fixed-ip subnet=<subnet> <port-name>. If you do not choose a subnet, I do not know what subnet Neutron chooses. (Newton release)

edit flag offensive delete link more


Of course! I guess my question really was to see if I could influence which subnet was used to deploy the instance. I did find references to: openstack sever create ... --nic net-id=net-uuid,subnet-id=nnnnnnn... BUT, that doesn't seem to work.

pquigs gravatar imagepquigs ( 2017-05-08 13:05:16 -0600 )edit

Bottom line - I am trying to specify which subnet to use when deploying a VM. I have 1 net with 2 subnets. Would like to say "deploy to subnet2" for example. I found some discussion of a subnet-id parm under net-id on the openstack server create, but that doesn't seem to be implemented.

pquigs gravatar imagepquigs ( 2017-05-09 14:01:12 -0600 )edit

OK, suppose the better approach is 1 subnet with multiple pools. THX!

pquigs gravatar imagepquigs ( 2017-05-09 14:02:13 -0600 )edit

You create a port as mschuler shows above, then launch the instance using openstack server create --nic port-id=....

Bernd Bausch gravatar imageBernd Bausch ( 2017-05-16 14:52:22 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools


Asked: 2017-04-26 07:22:28 -0600

Seen: 338 times

Last updated: May 16 '17