[openstack-dev] [Neutron][Heat] The Neutron API and orchestration

Zane Bitter zbitter at redhat.com
Thu Apr 10 00:16:15 UTC 2014


On 09/04/14 19:20, Kevin Benton wrote:
>  >is definitely broken as far as I can tell, because you have to give up
> dynamic allocation of IP addresses to use it
>
> What do you mean you have to give up dynamic allocation of IP addresses?
> A user is never required to enter an IP address for a port if they don't
> want a specific address.�Do you mean you want your instances IP
> addresses to change when they are rebooted?�The current model allows
> multiple DHCP servers from different subnets operate in the same
> broadcast domain because MAC addresses are bound to specific DHCP
> servers and they don't answer DHCP requests from arbitrary MAC addresses.�
>
>>As far as I can tell, you can create multiple Subnets each with DHCP
> enabled and their own allocation pools, but only allocation pools from
> the first subnet to be created will ever be used. To assign a port to a
> different subnet, you need to specify a static IP.
>
> No. I tried to point this out in my first email. When creating a port,
> use the subnet_id parameter after --fixed-ip to specify which subnet to
> connect to. For example:
> *neutron port-create some_network --fixed-ip
> subnet_id=a512cdd3-489d-4317-a06b-10cf894cff5d*
>
> That will dynamically allocate it an address from the specified subnet
> instead of the first one.

Oh! So you can assign the subnet by passing a fixed_ips section, even 
though you don't want a fixed IP, and just leaving out the ip_address:

   "fixed_ips": [
     {
       "subnet_id":"a512cdd3-489d-4317-a06b-10cf894cff5d",
     }
   ],

Thanks for pointing this out. I don't know what kind of historical 
process produced that API, but I hope it's obvious to everyone how 
completely bizarre this is - that passing the --fixed-ip option not only 
has this side effect but actually doesn't even necessarily allocate a 
fixed IP.

Something like this would make a lot more sense:

   "subnets": [
     {
       "subnet_id": "a512cdd3-489d-4317-a06b-10cf894cff5d",
     },
     {
       "subnet_id": "08eae331-0402-425a-923c-34f7cfe39c1b",
       "fixed_address": "10.0.0.3"
     }
   ],

I rechecked the documentation, and afaict there is not a single example 
of anywhere that "ip_address" doesn't appear in a "fixed_ips" entry. So 
Nachi was right, I guess that a docs fix could help here.

Putting 2+2 together (finally!) I realise now that there is probably no 
issue assigning multiple IP addresses (e.g. IPv4 + IPv6) to a port by 
assigning a single Port to multiple Subnets... that's not a phrase I 
could have wrapped my brain around at the beginning of the week :D

cheers,
Zane.



More information about the OpenStack-dev mailing list