Add config parameter instance_floating_ip_net to control
floating ip assignment for a multi-homed instances. This ensures
the floating ip can be correctly assigned to the instance port
that is connected to the preferred network for floating ip assignment.
This avoids the default first-returned selection method which may
choose a network to which floating ip's can't be assigned,
e.g. because that network is not reachable from the floating ip
network.
In cases where the OpenStack environment does not contain a v2 network, the
builder will error out. We only need the networkV2Client when using floating
IPs. This will allow packer to work in environments where a v2 network is not
available.
Update website documentation about "floating_ip_network" parameter.
Add new inline comment about alghoritm that is used for checking
floatingIP-related configuration parameters.
Only associate floating IPs if user provided "floating_ip_network" or
"floating_ip".
Remove FindExternalNetwork helper method because it won't be used.
Add support for the external network reference by it's name apart from
ID.
Include external network id in a log message of
the openstack/step_allocate_ip.
Rename "floating_network" to the "floating_ip_network".
Return old "floating_ip_pool" parameter for backward compatibility with
old configuration files. It's value will be passed to the
"floating_ip_network" parameter.
Remove usage of the deprecated OpenStack Compute service floating IP
management and add methods to work with the OpenStack Networking
service floating IPs API.
Remove usage of the deprecated OpenStack Compute service floating IP
pools and add methods to work with the OpenStack Networking service
external networks API.
Move reusable logic of working with the OpenStack Networking service API
to a separate methods in the networking.go file.
Pass error messages from the API services to the ui messages in the
allocate IP step.
Run now takes a context as well as a statebag. We'll assign the context
to the blank identifier to prevent namespace collisions. We'll let the
step authors opt-in to using the context.
`find . -iname "step_*.go" -exec gsed -i'' 's/func \(.*\)Run(/func \1Run(_ context.Context, /' {} \;`
add reuse_ips option and use it to control whether openstack builder
will attempt to reuse existing unassigned floating ips rather than
allocating a new one.
fix#4551
Rather than always creating a new floating IP, search the provided pool
for an unallocated address and use this instead. Only allocate a temporary
address if there is no spare address in the pool.
Closes#4215