2014-11-18 21:38:45 -06:00
|
|
|
..
|
|
|
|
This work is licensed under a Creative Commons Attribution 3.0 Unported
|
|
|
|
License.
|
|
|
|
|
|
|
|
http://creativecommons.org/licenses/by/3.0/legalcode
|
|
|
|
|
|
|
|
========================
|
|
|
|
Network Driver Interface
|
|
|
|
========================
|
|
|
|
|
|
|
|
Include the URL of your launchpad blueprint:
|
|
|
|
|
|
|
|
https://blueprints.launchpad.net/octavia/+spec/network-driver-interface
|
|
|
|
|
|
|
|
We need a generic interface in which to create networking resources. This is
|
|
|
|
to allow implementations that can support different networking infrastructures
|
|
|
|
that accomplish frontend and backend connectivity.
|
|
|
|
|
|
|
|
Problem description
|
|
|
|
===================
|
|
|
|
|
|
|
|
There is a need to define a generic interface for a networking service. An
|
|
|
|
Octavia controller should not know what networking infrastucture is being used
|
|
|
|
underneath. It should only know an interface. This interface is needed to
|
|
|
|
support differing networking infrastructures.
|
|
|
|
|
|
|
|
|
|
|
|
Proposed change
|
|
|
|
===============
|
|
|
|
In order to make the network driver as genericly functional as possible, it is
|
|
|
|
broken down into methods that Octavia will need at a high level to accomplish
|
|
|
|
frontend and backend connectivity. The idea is that to implement these methods
|
|
|
|
it may require multiple requests to the networking service to accomplish the
|
|
|
|
end result. The interface is meant to promote stateless implementations and
|
|
|
|
suffer no issues being run in parallel.
|
|
|
|
|
|
|
|
In the future we would like to create a common module that implementations of
|
|
|
|
this interface can call to setup a taskflow engine to promote using a common
|
|
|
|
taskflow configuration. That however, can be left once this has had time
|
|
|
|
to mature.
|
|
|
|
|
|
|
|
Existing data model:
|
|
|
|
|
|
|
|
* class VIP
|
|
|
|
* load_balancer_id
|
|
|
|
* ip_address
|
|
|
|
* network_id - (neutron subnet)
|
|
|
|
* port_id - (neutron port)
|
|
|
|
|
2015-04-10 14:51:20 -05:00
|
|
|
* class Amphora
|
|
|
|
* load_balancer_id
|
|
|
|
* compute_id
|
|
|
|
* lb_network_ip
|
|
|
|
* status
|
|
|
|
* vrrp_ip - if an active/passive topology, this is the ip where the vrrp
|
|
|
|
communication between peers happens
|
|
|
|
* ha_ip - this is the highly available IP. In an active/passive topology
|
|
|
|
it most likely exists on the MASTER amphora and on failure
|
|
|
|
it will be raised on the SLAVE amphora. In an active/active
|
|
|
|
topology it may exist on both amphorae. In the end, it is up
|
|
|
|
to the amphora driver to decide how to use this.
|
|
|
|
|
2015-05-08 21:56:19 -05:00
|
|
|
New data models:
|
2014-11-18 21:38:45 -06:00
|
|
|
|
|
|
|
* class Interface
|
|
|
|
* id
|
|
|
|
* network_id - (neutron subnet)
|
|
|
|
* amphora_id
|
Setup base neutron network driver
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
2015-08-03 23:02:29 -05:00
|
|
|
* fixed_ips
|
2014-11-18 21:38:45 -06:00
|
|
|
|
2015-05-08 21:56:19 -05:00
|
|
|
* class Delta
|
|
|
|
* amphora_id
|
|
|
|
* compute_id
|
|
|
|
* add_nics
|
|
|
|
* delete_nics
|
|
|
|
|
|
|
|
* class Network
|
|
|
|
* id
|
|
|
|
* name
|
|
|
|
* subnets - (list of subnet ids)
|
|
|
|
* tenant_id
|
|
|
|
* admin_state_up
|
|
|
|
* provider_network_type
|
|
|
|
* provider_physical_network
|
|
|
|
* provider_segmentation_id
|
|
|
|
* router_external
|
2015-07-22 21:16:29 -05:00
|
|
|
* mtu
|
|
|
|
|
|
|
|
* class Subnet
|
|
|
|
* id
|
|
|
|
* name
|
|
|
|
* network_id
|
|
|
|
* tenant_id
|
|
|
|
* gateway_ip
|
|
|
|
* cidr
|
|
|
|
* ip_version
|
|
|
|
|
|
|
|
* class Port
|
|
|
|
* id
|
|
|
|
* name
|
|
|
|
* device_id
|
|
|
|
* device_owner
|
|
|
|
* mac_address
|
|
|
|
* network_id
|
|
|
|
* status
|
|
|
|
* tenant_id
|
|
|
|
* admin_state_up
|
|
|
|
* fixed_ips - list of FixedIP objects
|
|
|
|
|
|
|
|
* FixedIP
|
|
|
|
* subnet_id
|
|
|
|
* ip_address
|
|
|
|
|
|
|
|
* AmphoraNetworkConfig
|
|
|
|
* amphora - Amphora object
|
|
|
|
* vip_subnet - Subnet object
|
|
|
|
* vip_port - Port object
|
|
|
|
* vrrp_subnet - Subnet object
|
|
|
|
* vrrp_port - Port object
|
|
|
|
* ha_subnet - Subnet object
|
|
|
|
* ha_port - Port object
|
2015-05-08 21:56:19 -05:00
|
|
|
|
2014-11-18 21:38:45 -06:00
|
|
|
New Exceptions defined in the octavia.network package:
|
|
|
|
|
|
|
|
* NetworkException - Base Exception
|
|
|
|
* PlugVIPException
|
|
|
|
* UnplugVIPException
|
|
|
|
* PluggedVIPNotFound
|
|
|
|
* AllocateVIPException
|
|
|
|
* DeallocateVIPException
|
|
|
|
* PlugNetworkException
|
|
|
|
* UnplugNetworkException
|
|
|
|
* VIPInUse
|
|
|
|
* PortNotFound
|
2015-07-22 21:16:29 -05:00
|
|
|
* SubnetNotFound
|
2014-11-18 21:38:45 -06:00
|
|
|
* NetworkNotFound
|
|
|
|
* VIPConfigurationNotFound
|
|
|
|
* AmphoraNotFound
|
|
|
|
|
|
|
|
|
|
|
|
This class defines the methods for a fully functional network driver.
|
|
|
|
Implementations of this interface can expect a rollback to occur if any of
|
|
|
|
the non-nullipotent methods raise an exception.
|
|
|
|
|
|
|
|
class AbstractNetworkDriver
|
|
|
|
|
|
|
|
* plug_vip(loadbalancer, vip)
|
|
|
|
|
|
|
|
* Sets up the routing of traffic from the vip to the load balancer and its
|
|
|
|
amphorae.
|
|
|
|
* loadbalancer - instance of data_models.LoadBalancer
|
|
|
|
|
|
|
|
* this is to keep the parameters as generic as possible so different
|
|
|
|
implementations can use different properties of a load balancer. In
|
|
|
|
the future we may want to just take in a list of amphora compute
|
|
|
|
ids and the vip data model.
|
|
|
|
|
|
|
|
* vip = instance of a VIP
|
2015-04-10 14:51:20 -05:00
|
|
|
* returns list of Amphora
|
Setup base neutron network driver
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
2015-08-03 23:02:29 -05:00
|
|
|
* raises PlugVIPException, PortNotFound
|
2014-11-18 21:38:45 -06:00
|
|
|
|
|
|
|
* unplug_vip(loadbalancer, vip)
|
|
|
|
|
|
|
|
* Removes the routing of traffic from the vip to the load balancer and its
|
|
|
|
amphorae.
|
|
|
|
* loadbalancer = instance of a data_models.LoadBalancer
|
|
|
|
* vip = instance of a VIP
|
|
|
|
* returns None
|
|
|
|
* raises UnplugVIPException, PluggedVIPNotFound
|
|
|
|
|
2015-05-12 20:46:42 -05:00
|
|
|
* allocate_vip(loadbalancer)
|
2014-11-18 21:38:45 -06:00
|
|
|
|
|
|
|
* Allocates a virtual ip and reserves it for later use as the frontend
|
|
|
|
connection of a load balancer.
|
2015-05-12 20:46:42 -05:00
|
|
|
* loadbalancer = instance of a data_models.LoadBalancer
|
2014-11-18 21:38:45 -06:00
|
|
|
* returns VIP instance
|
Setup base neutron network driver
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
2015-08-03 23:02:29 -05:00
|
|
|
* raises AllocateVIPException, PortNotFound, SubnetNotFound
|
2014-11-18 21:38:45 -06:00
|
|
|
|
|
|
|
* deallocate_vip(vip)
|
|
|
|
|
|
|
|
* Removes any resources that reserved this virtual ip.
|
|
|
|
* vip = VIP instance
|
|
|
|
* returns None
|
|
|
|
* raises DeallocateVIPException, VIPInUse, VIPConfigurationNotFound
|
|
|
|
|
Setup base neutron network driver
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
2015-08-03 23:02:29 -05:00
|
|
|
* plug_network(compute_id, network_id, ip_address=None)
|
2014-11-18 21:38:45 -06:00
|
|
|
|
|
|
|
* Connects an existing amphora to an existing network.
|
Setup base neutron network driver
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
2015-08-03 23:02:29 -05:00
|
|
|
* compute_id = id of an amphora in the compute service
|
2014-11-18 21:38:45 -06:00
|
|
|
* network_id = id of the network to attach
|
|
|
|
* ip_address = ip address to attempt to be assigned to interface
|
|
|
|
* returns Interface instance
|
|
|
|
* raises PlugNetworkException, AmphoraNotFound, NetworkNotFound
|
|
|
|
|
Setup base neutron network driver
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
2015-08-03 23:02:29 -05:00
|
|
|
* unplug_network(compute_id, network_id, ip_address=None)
|
2014-11-18 21:38:45 -06:00
|
|
|
|
2015-04-10 14:51:20 -05:00
|
|
|
* Disconnects an existing amphora from an existing network. If ip_address
|
|
|
|
is not specified then all interfaces on that network will be unplugged.
|
Setup base neutron network driver
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
2015-08-03 23:02:29 -05:00
|
|
|
* compute_id = id of an amphora in the compute service to unplug
|
2014-11-18 21:38:45 -06:00
|
|
|
* network_id = id of network to unplug amphora
|
2015-04-10 14:51:20 -05:00
|
|
|
* ip_address = ip address of interface to unplug
|
2014-11-18 21:38:45 -06:00
|
|
|
* returns None
|
Setup base neutron network driver
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
2015-08-03 23:02:29 -05:00
|
|
|
* raises UnplugNetworkException, AmphoraNotFound, NetworkNotFound,
|
|
|
|
NetworkException
|
2014-11-18 21:38:45 -06:00
|
|
|
|
Setup base neutron network driver
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
2015-08-03 23:02:29 -05:00
|
|
|
* get_plugged_networks(compute_id):
|
2014-11-18 21:38:45 -06:00
|
|
|
|
|
|
|
* Retrieves the current plugged networking configuration
|
Setup base neutron network driver
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
2015-08-03 23:02:29 -05:00
|
|
|
* compute_id = id of an amphora in the compute service
|
2014-11-18 21:38:45 -06:00
|
|
|
* returns = list of Instance instances
|
|
|
|
|
2015-05-12 20:46:42 -05:00
|
|
|
* update_vip(loadbalancer):
|
|
|
|
|
|
|
|
* Hook for the driver to update the VIP information based on the state
|
|
|
|
of the passed in loadbalancer
|
|
|
|
* loadbalancer: instance of a data_models.LoadBalancer
|
|
|
|
|
2015-07-22 21:16:29 -05:00
|
|
|
* get_network(network_id):
|
2015-05-08 21:56:19 -05:00
|
|
|
|
2015-07-22 21:16:29 -05:00
|
|
|
* Retrieves the network from network_id
|
2015-05-08 21:56:19 -05:00
|
|
|
* network_id = id of an network to retrieve
|
|
|
|
* returns = Network data model
|
|
|
|
* raises NetworkException, NetworkNotFound
|
|
|
|
|
2015-07-22 21:16:29 -05:00
|
|
|
* get_subnet(subnet_id):
|
|
|
|
|
|
|
|
* Retrieves the subnet from subnet_id
|
|
|
|
* subnet_id = id of a subnet to retrieve
|
|
|
|
* returns = Subnet data model
|
|
|
|
* raises NetworkException, SubnetNotFound
|
|
|
|
|
|
|
|
* get_port(port_id):
|
|
|
|
|
|
|
|
* Retrieves the port from port_id
|
|
|
|
* port_id = id of a port to retrieve
|
|
|
|
* returns = Port data model
|
|
|
|
* raises NetworkException, PortNotFound
|
|
|
|
|
2015-07-15 16:52:12 -07:00
|
|
|
* failover_preparation(amphora):
|
|
|
|
|
|
|
|
* Prepare an amphora for failover
|
|
|
|
* amphora = amphora data model
|
|
|
|
* returns = None
|
|
|
|
* raises PortNotFound
|
|
|
|
|
2014-11-18 21:38:45 -06:00
|
|
|
Alternatives
|
|
|
|
------------
|
|
|
|
|
|
|
|
* Straight Neutron Interface (networks, subnets, ports, floatingips)
|
|
|
|
* Straight Nova-Network Interface (network, fixed_ips, floatingips)
|
|
|
|
|
|
|
|
Data model impact
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
* The Interface data model defined above will just be a class. We may later
|
|
|
|
decide that it needs to be stored in the database, but we can optimize on
|
|
|
|
that in a later review if needed.
|
|
|
|
|
|
|
|
REST API impact
|
|
|
|
---------------
|
|
|
|
|
2015-07-22 21:16:29 -05:00
|
|
|
None
|
2014-11-18 21:38:45 -06:00
|
|
|
|
|
|
|
Security impact
|
|
|
|
---------------
|
|
|
|
|
|
|
|
None
|
|
|
|
|
|
|
|
Notifications impact
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
None
|
|
|
|
|
|
|
|
Other end user impact
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
None
|
|
|
|
|
|
|
|
Performance Impact
|
|
|
|
------------------
|
|
|
|
|
|
|
|
None
|
|
|
|
|
|
|
|
Other deployer impact
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
Need a service account to own the resources these methods create.
|
|
|
|
|
|
|
|
Developer impact
|
|
|
|
----------------
|
|
|
|
|
|
|
|
This will be creating an interface in which other code will be creating
|
|
|
|
network resources.
|
|
|
|
|
|
|
|
|
|
|
|
Implementation
|
|
|
|
==============
|
|
|
|
|
|
|
|
Assignee(s)
|
|
|
|
-----------
|
|
|
|
|
|
|
|
brandon-logan
|
|
|
|
|
|
|
|
Work Items
|
|
|
|
----------
|
|
|
|
|
|
|
|
Define interface
|
|
|
|
|
|
|
|
|
|
|
|
Dependencies
|
|
|
|
============
|
|
|
|
|
|
|
|
None
|
|
|
|
|
|
|
|
|
|
|
|
Testing
|
|
|
|
=======
|
|
|
|
|
|
|
|
None
|
|
|
|
|
|
|
|
|
|
|
|
Documentation Impact
|
|
|
|
====================
|
|
|
|
|
|
|
|
Just docstrings on methods.
|
|
|
|
|
|
|
|
|
|
|
|
References
|
|
|
|
==========
|
|
|
|
|
|
|
|
None
|