octavia.network package

octavia.network package

Submodules

octavia.network.base module

class AbstractNetworkDriver[source]

Bases: object

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.

allocate_vip(load_balancer)[source]

Allocates a virtual ip.

Reserves it for later use as the frontend connection of a load balancer.

Parameters:load_balancer – octavia.common.data_models.LoadBalancer instance
Returns:octavia.common.data_models.VIP
Raises:AllocateVIPException, PortNotFound, SubnetNotFound
deallocate_vip(vip)[source]

Removes any resources that reserved this virtual ip.

Parameters:vip – octavia.common.data_models.VIP instance
Returns:None
Raises:DeallocateVIPException, VIPInUseException, VIPConfiigurationNotFound
failover_preparation(amphora)[source]

Prepare an amphora for failover.

Parameters:amphora – amphora object to failover
Returns:None
Raises:PortNotFound
get_network(network_id)[source]

Retrieves network from network id.

Parameters:network_id – id of an network to retrieve
Returns:octavia.network.data_models.Network
Raises:NetworkException, NetworkNotFound
get_network_by_name(network_name)[source]

Retrieves network from network name.

Parameters:network_name – name of a network to retrieve
Returns:octavia.network.data_models.Network
Raises:NetworkException, NetworkNotFound
get_network_configs(load_balancer)[source]

Retrieve network configurations

This method assumes that a dictionary of AmphoraNetworkConfigs keyed off of the related amphora id are returned. The configs contain data pertaining to each amphora that is later used for finalization of the entire load balancer configuration. The data provided to these configs is left up to the driver, this means the driver is responsible for providing data that is appropriate for the amphora network configurations.

Example return: {<amphora.id>: <AmphoraNetworkConfig>}

Parameters:load_balancer – The load_balancer configuration
Returns:dict of octavia.network.data_models.AmphoraNetworkConfig keyed off of the amphora id the config is associated with.
Raises:NotFound, NetworkNotFound, SubnetNotFound, PortNotFound
get_plugged_networks(compute_id)[source]

Retrieves the current plugged networking configuration.

Parameters:compute_id – id of an amphora in the compute service
Returns:[octavia.network.data_models.Instance]
get_port(port_id)[source]

Retrieves port from port id.

Parameters:port_id – id of a port to retrieve
Returns:octavia.network.data_models.Port
Raises:NetworkException, PortNotFound
get_port_by_name(port_name)[source]

Retrieves port from port name.

Parameters:port_name – name of a port to retrieve
Returns:octavia.network.data_models.Port
Raises:NetworkException, PortNotFound
get_port_by_net_id_device_id(network_id, device_id)[source]

Retrieves port from network id and device id.

Parameters:
  • network_id – id of a network to filter by
  • device_id – id of a network device to filter by
Returns:

octavia.network.data_models.Port

Raises:

NetworkException, PortNotFound

get_subnet(subnet_id)[source]

Retrieves subnet from subnet id.

Parameters:subnet_id – id of a subnet to retrieve
Returns:octavia.network.data_models.Subnet
Raises:NetworkException, SubnetNotFound
get_subnet_by_name(subnet_name)[source]

Retrieves subnet from subnet name.

Parameters:subnet_name – name of a subnet to retrieve
Returns:octavia.network.data_models.Subnet
Raises:NetworkException, SubnetNotFound
plug_network(compute_id, network_id, ip_address=None)[source]

Connects an existing amphora to an existing network.

Parameters:
  • compute_id – id of an amphora in the compute service
  • network_id – id of a network
  • ip_address – ip address to attempt to be assigned to interface
Returns:

octavia.network.data_models.Interface instance

Raises:

PlugNetworkException, AmphoraNotFound, NetworkNotFound

plug_port(compute_id, port)[source]

Plug a neutron port in to a compute instance

Parameters:
  • compute_id – id of an amphora in the compute service
  • port – port to plug into the compute instance
Returns:

None

Raises:

PlugNetworkException, AmphoraNotFound, NetworkNotFound

plug_vip(load_balancer, vip)[source]

Plugs a virtual ip as the frontend connection of a load balancer.

Sets up the routing of traffic from the vip to the load balancer and its amphorae.

Parameters:
  • load_balancer – octavia.common.data_models.LoadBalancer instance
  • vip – octavia.common.data_models.VIP instance
Returns:

dict consisting of amphora_id as key and bind_ip as value. bind_ip is the ip that the amphora should listen on to receive traffic to load balance.

Raises:

PlugVIPException, PortNotFound

unplug_network(compute_id, network_id, ip_address=None)[source]

Disconnects an existing amphora from an existing network.

If ip_address is not specificed, all the interfaces plugged on network_id should be unplugged.

Parameters:
  • compute_id – id of an amphora in the compute service
  • network_id – id of a network
  • ip_address – specific ip_address to unplug
Returns:

None

Raises:

UnplugNetworkException, AmphoraNotFound, NetworkNotFound, NetworkException

unplug_vip(load_balancer, vip)[source]

Unplugs a virtual ip as the frontend connection of a load balancer.

Removes the routing of traffic from the vip to the load balancer and its amphorae.

Parameters:
  • load_balancer – octavia.common.data_models.LoadBalancer instance
  • vip – octavia.common.data_models.VIP instance
Returns:

octavia.common.data_models.VIP instance

Raises:

UnplugVIPException, PluggedVIPNotFound

update_vip(load_balancer)[source]

Hook for the driver to update the VIP information.

This method will be called upon the change of a load_balancer configuration. It is an optional method to be implemented by drivers. It allows the driver to update any VIP information based on the state of the passed in load_balancer.

Parameters:load_balancer – octavia.common.data_models.LoadBalancer instance
Returns:None
wait_for_port_detach(amphora)[source]

Waits for the amphora ports device_id to be unset.

This method waits for the ports on an amphora device_id parameter to be ‘’ or None which signifies that nova has finished detaching the port from the instance.

Parameters:

amphora – Amphora to wait for ports to detach.

Returns:

None

Raises:
exception AllocateVIPException(*args, **kwargs)[source]

Bases: octavia.network.base.NetworkException

exception AmphoraNotFound(*args, **kwargs)[source]

Bases: octavia.network.base.NetworkException

exception DeallocateVIPException(*args, **kwargs)[source]

Bases: octavia.network.base.NetworkException

exception NetworkException(*args, **kwargs)[source]

Bases: octavia.common.exceptions.OctaviaException

exception NetworkNotFound(*args, **kwargs)[source]

Bases: octavia.network.base.NetworkException

exception PlugNetworkException(*args, **kwargs)[source]

Bases: octavia.network.base.NetworkException

exception PlugVIPException(*args, **kwargs)[source]

Bases: octavia.network.base.NetworkException

exception PluggedVIPNotFound(*args, **kwargs)[source]

Bases: octavia.network.base.NetworkException

exception PortNotFound(*args, **kwargs)[source]

Bases: octavia.network.base.NetworkException

exception SubnetNotFound(*args, **kwargs)[source]

Bases: octavia.network.base.NetworkException

exception TimeoutException(*args, **kwargs)[source]

Bases: octavia.network.base.NetworkException

exception UnplugNetworkException(*args, **kwargs)[source]

Bases: octavia.network.base.NetworkException

exception UnplugVIPException(*args, **kwargs)[source]

Bases: octavia.network.base.NetworkException

exception VIPConfigurationNotFound(*args, **kwargs)[source]

Bases: octavia.network.base.NetworkException

exception VIPInUseException(*args, **kwargs)[source]

Bases: octavia.network.base.NetworkException

octavia.network.data_models module

class AmphoraNetworkConfig(amphora=None, vip_subnet=None, vip_port=None, vrrp_subnet=None, vrrp_port=None, ha_subnet=None, ha_port=None)[source]

Bases: octavia.common.data_models.BaseDataModel

class Delta(amphora_id=None, compute_id=None, add_nics=None, delete_nics=None)[source]

Bases: octavia.common.data_models.BaseDataModel

class FixedIP(subnet_id=None, ip_address=None, subnet=None)[source]

Bases: octavia.common.data_models.BaseDataModel

class HostRoute(nexthop=None, destination=None)[source]

Bases: octavia.common.data_models.BaseDataModel

class Interface(id=None, compute_id=None, network_id=None, fixed_ips=None, port_id=None)[source]

Bases: octavia.common.data_models.BaseDataModel

class Network(id=None, name=None, subnets=None, project_id=None, admin_state_up=None, mtu=None, provider_network_type=None, provider_physical_network=None, provider_segmentation_id=None, router_external=None)[source]

Bases: octavia.common.data_models.BaseDataModel

class Port(id=None, name=None, device_id=None, device_owner=None, mac_address=None, network_id=None, status=None, project_id=None, admin_state_up=None, fixed_ips=None, network=None)[source]

Bases: octavia.common.data_models.BaseDataModel

get_subnet_id(fixed_ip_address)[source]
class Subnet(id=None, name=None, network_id=None, project_id=None, gateway_ip=None, cidr=None, ip_version=None, host_routes=None)[source]

Bases: octavia.common.data_models.BaseDataModel

Module contents

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.