The last section of this Neutron training module sheds some light on
how we can control connecting servers to their networks.
You know already that you connect a server to a network by providing
the network ID when you launch the server.
When you do this, Nova asks Neutron to create a port, which it does,
and it also sets an arbitrary IP address on that port, at least it's
arbitrary as far as the user is concerned.
Nova then performs the connection of the instance to that port.
Now what if we have more than one subnet on that network?
From which subnet will Neutron allocate the IP address?
Or perhaps we don't want this IP address, we want a different one,
124 instead of 123, for example. The answer to these questions is
create a port that has the required properties, and then launch a
server on it.
So how you do that, well you can, when you create a port,
provide the subnet name or the subnet ID.
You can also provide a specific IP address, of course only if it is
currently not in use on that network, and then you launch your server
on that port, rather than the network. An alternative would be
creating the server on that network, and providing an IP address.
Unfortunately this syntax here does not allow setting the subnet.
Let me finally mention that floating IP addresses can also be
associated with ports. For example, here we have an existing floating
IP, and we associate it with an existing port.
Or you can create a new floating IP, and at the same time,
associate it with an existing port. What you cannot do as a normal
user is ask for a specific floating IP, only the administrator can do that.
Remember the public network, the external network is normally owned by
the administrator and not shared, so you have no insight into those addresses.