Added a flow to complete automated failover for an amphora. Added new tasks
to retrieve ports, change port device ids for re-allocating to new amphora,
and added functionality to include existing ports on amphora creation.
Co-Authored-By: Brandon Logan <brandon.logan@rackspace.com>
Co-Authored-By: Michael Johnson <johnsomor@gmail.com>
Change-Id: Ic0d3f2b9a48ebf66df78e1ef98aef92ad7ee5057
There are common methods that all neutron based network drivers will most
likely implement the same way. To prevent duplicate code, a common base driver
for all neutron drivers has been created. In the process of splitting this out,
cleaning up of some existing code was done as well.
The network driver's plug_network and unplug_network methods took an
amphora_id as a parameter, but it was always assumed to be the compute_id.
This parameter has been changed to compute_id.
The octavia interface network model originally had just a single ip_address,
but to more accurately reflect what neutron and probably other networking
as a services will return, this has been changed to fixed_ips because
interfaces and ports can have multiple ip addresses.
Other cleanup includes calling the network drivers own get_network, get_subnet,
and get_port methods instead of calling the neutron client's show_network,
show_subnet, and show_port methods. Also, all of these changes required some
test changes as well.
Change-Id: Ie6ebc5bc8babe8562c280ba12a1feab21b4ff3f9
The network driver needs the ability to retrieve specific information about
subnets and ports and pass that information to other components. Having info
about the subnet gives us cidr and gateway data that is valuable when setting
up the amphora's routes for the separation of tenant data and management data.
Because of this need, methods to retrieve network, subnet, and port details
has been added.
This also adds a another data model AmphoraNetworkConfig that contains subnet
and port information for the vip, vrrp, and ha networks on an amphora. A
network task has been added that builds this data structure by calling the new
methods added to the network driver.
Change-Id: Ica912337c7d52659a9733096878664f734f27b00
Member has subnet_id and we need to compare with network_id.
In order to do this CalculateDelta task now takes in a load balancer
loops through the amphora, collects the plugged networks
and gathers the network_ids from member subnet_ids and
builds the list accordingly.
Updates network_tasks CalculateDelta
Updates network_tasks adding method to handle deltas
Updates driver adding method to get network
Updates tests, spec and other required code
Change-Id: I698625e4e2e7352cb3000e22de808c33fa7636ed
There needed to be a method to update the security group rules whenever
a listener is added or removed. The update_vip method will not update those
rules based on what listener's are present.
Also changed the allocate_vip method to take in a load_balancer instead of
port_id, network_id, and/or ip_address. The reason for this is some driver
implementations may just want the vip to be the IP directly on the amphora.
The previous signature did not allow this.
Closes-Bug: #1453609
Closes-Bug: #1453610
Change-Id: Ie5765c231c6f6ba45042db9b111e6814cf50c465
vrrp_ip will typically be the ip through which the amphora communicates with
its vrrp peer.
ha_ip will typically be the ip that is shared between the amphorae.
Since it is possible each amphora may have a different ha_ip and vrrp_ip,
it makes sense to add them to the model/table. Adding them now because the
network driver will be assigning the values.
Changed the network driver spec and base class to mention the plug_vip method
should return a list of amphoras.
Change-Id: I04a97caf00bc6fa25f94e6470d3ed7da48880ae6