Closed ghost closed 8 years ago
We need to store which device each loadbalancer/vip is on. Break the indirect dependency
loadbalancer ---> tenant ---> device
| ^ hash of tenant id
^ neutron table
And replace it with
loadbalancer ---> device
^ new table
(The loadbalancer will still know which tenant it belongs to)
The plan is to make one polymorphic table for loadbalancers (A10_SLB
) and another one for devices (A10_DEVICES
). In the alembic migrations there'll be separate branches for tables that depend on lbaas v1 and lbaas v2. The SQL alchemy classes for the version specific models will only be defined if
there's support for that version.
A10_DEVICES
will need a new name; it's used in another one of our products.
To do:
device_key
to configuration_key
a10_slb_v1
when handling a v1 vip
creationa10_slb_v1
when handling a v1 vip
removala10_slb_v2
when handling a v2 loadbalancer
creationa10_slb_v2
when handling a v2 loadbalancer
removalvip
code is checking the hash to get the device to instead get it from the model (will still use the hash to pick devices for new vips)loadbalancer
code is checking the hash to get the device to instead get if from the model (will still use the hash to pick devices for new loadbalancers)A10ApplianceConfigured
model present the data from the configuration (might be a separate story)cli
To do the migration we need to load the real configuration. I tried hacking one together by making an A10OpenstackLBV1(None)
, but that doesn't get the provider name so we don't know which vips
are ours. We're going to have to figure out how to load the real deal, enumerate the providers, and check to see if they are the a10 provider we're working with.
The following demonstrates getting the (almost) real configuration for the drivers. It doesn't provide a plugin
and doesn't import all of the set up for oslo configuration that is set up when a driver loads for real.
import neutron.plugins.common.constants as constants
import neutron.services.service_base as service_base
from oslo_config import cfg
cfg.CONF(project='neutron')
lbv2 = service_base.load_drivers(constants.LOADBALANCERV2,None)
print lbv2
print lbv2[0][lbv2[1]].a10.hooks.select_device('012-345')
The migrations are going to use this mechanism to get the drivers and their provider names.
The cli unfortunately includes a workaround for alembic issue 336.
Blocked by #122
We need to know which device a tenant "lives on" for scaling purposes.