Commit Graph

54 Commits (65e132a734f005f090a384bfa129482d195c6d6e)

Author SHA1 Message Date
Carlos Goncalves c4faac25de Add Python 3.7 support
In order to support Python 3.7, pylint has to be updated to 2.0.0
minimum. Newer versions of Pylint enforce additional checkers which can
be addressed with some code refactoring rather than silently ignoring
them in pylintrc; except useless-object-inheritance which is required to
be silented so that we stay compatible with Python 2.x.

Story: 2004073
Task: 27434

Change-Id: I52301d763797d619f195bd8a1c32bc47f1e68420
4 years ago
Erik Olof Gunnar Andersson 404600e0e2 Cleaning up logging
* Don't shadow LOG from outer scope.
* Always lazy-load logging.
* Fixed an invalid log line.

Change-Id: Ief40a3de554886c66f2063a0855b22ee1b5b758e
4 years ago
Michael Johnson 69f1753903 Add compute flavor support to the amphora driver
This patch adds a new flavor capability to the amphora driver called
'compute_flavor'. This allows an amphora flavor to specify a compute
(nova) flavor to be used for the load balancer instances.

Change-Id: I8626eebd906c935a47d3e3510d1dfefae307c4e9
4 years ago
Yang JianFeng ae8d6fb2de Add compute_flavor field for amphora api
Operators want to have the ability to see amphora flavor information.
But they haven't access permisson of octavia configuration file. So
it is necessary to show amphora flavor information as part of command
'openstack loadbalancer amphora list/show'.

Story: 2002896
Task: 22986

Change-Id: Ib3ca05d816747d08ef7055ec532b81746468cbf9
5 years ago
German Eichberger 79cd851548 Refactor the AAP driver to not depend on nova
Replace calls to the nova client with calls to the compute driver.
This will help non vm efforts (e.g. zune) and also make the code
easier to break up later.

Change-Id: I7ee175c5ecb98af0ca5e299c2ac10e43eb40ed30
5 years ago
Jacky Hu 649b33d247 Add license for empty __init__.py
This also fix build-openstack-sphinx-docs, there was a change introduced
in sphinx 1.6.6:
https://github.com/sphinx-doc/sphinx/pull/4335/files

If the size of __init__.py is less than 2, then the module would be
skipped which will cause the sphinx consistency checking failing later.

Change-Id: I9d8764b6e907aceed8bb8a9b04711145d0eb32ad
5 years ago
Adam Harwell 6ee20b272e Add image_id to amphora table
Story: 2001491
Task: 6215
Change-Id: I5ab6707591c856e43a0e0f49c84e1e721f01893c
5 years ago
Adam Harwell 9e4c30156f Update compute noop driver/tests (many were disabled/useless)
Change-Id: I96f9c963bb4c057be8951aee8aea89eb2e88ce14
6 years ago
Michael Johnson 562e6919b6 Fix extracting nova fault string on build error
There was an edge case where if we were not able to extract nova interface
information our code that extracts the nova fault information would be
bypassed. This patch moves the fault extraction to a point where it will
be able to capture the fault string even if it was network interface
related.

Change-Id: Ia46522524e80022cd528e4902585213b1de42a44
6 years ago
Adam Harwell b8ebbe9919 Add cached_zone to the amphora record
This will enable a number of possible features that need to select
amphorae based on their availability zone.

This would allow for quick-lookups on large lists and could be stale,
but it would be expected that future code that uses this would check
with nova for an update if it needs fully accurate data.

Having it be explicitly "cached" should take care of concerns about
users (operators, in this case) being confused about correctness.
Using simply the word "zone" should address concerns about commonality
between compute providers.

Change-Id: I8e26f99bca3496a454ba7bae2570f517e07d5fc2
Story: 2001221
Task: 5732
6 years ago
Michael Johnson 93c8e006ce Update Octavia docs for documentation migration
This patch updates the Octavia documentation in support of the
OpenStack documentation migration[1].

[1] https://specs.openstack.org/openstack/docs-specs/specs \
    /pike/os-manuals-migration.html

Change-Id: I97fd038b8050bfe776c3fca8336d9090f8236362
Depends-On: Ia750cb049c0f53a234ea70ce1f2bbbb7a2aa9454
6 years ago
Michael Johnson 32819ecc8d Provide better ComputeBuildExcpetion messages
Octavia was not exposing the underlying compute driver exception
information to the operator in the octavia logs.  This meant debugging
required examining the compute service logs.

This patch will pass through the fault message provided by the compute
driver in the exceptions raised and clarify in the logs when the
nova driver caused the failure.

Change-Id: If54656c635aac907d78b387a9b191320385d9852
Closes-Bug: #1658900
6 years ago
Adam Harwell 4fcbb833d5 Allow specifying empty amp_boot_network_list
Some nova deployments automatically select their networks on boot.
We can allow for this by assuming there will be some default network if
the amp_boot_network_list is empty.

Change-Id: I38ccfb45afb93795860c12efaf5a32f9bd1689fd
6 years ago
e dc882e9d27 Remove log translations from octavia
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

This patch also adds hacking rules for the translation tags.

See: http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Co-Authored-By: Michael Johnson <johnsomor@gmail.com>
Change-Id: Ic95111d09e38b3f44fd6c85d0bcf0355c21ef545
6 years ago
Jenkins 46252d0f5c Merge "Remove config option "amp_network"" 6 years ago
Adam Harwell e713f05b2a Add option to choose an availability_zone for amps
Change-Id: Id91c15da6caa656925184dda43d063aede89989e
6 years ago
ZhaoBo dc7c2967aa Remove config option "amp_network"
This option had been deprecated in N release. We could remove it from
master.

Change-Id: Ibd498f32a3c4f34621f3d814f1186a5bf9c5b75e
6 years ago
Adam Harwell f345b4273b Allow a configuration option for random Amphora name
Also do a minor config file cleanup (looks like a bad previous merge).

Change-Id: I66e71795a4910c91cc2af4107fc60cc5aae72c79
Closes-Bug: #1663037
6 years ago
Lubosz "diltram" Kosnik 867b350988 Remove CONF.import_group
Remove unneeded import_group lines which are not doing anything and just makes
code harder to understand.

Change-Id: I673dd04dd31ae9771e6af982d184eee0e9cbf2d4
7 years ago
Lubosz "diltram" Kosnik 076e016bb2 Backend Keystone authentication
Change methods used in backend to authenticate with keystone.
Use autodetection mechanizm for API version and refactor config
options specified in Octavia.

Change-Id: Id0deee2714040d271f43a537c27f410e2f4e3ef2
Closes-Bug: #1620668
Closes-Bug: #1618691
7 years ago
Michael Johnson d7d062a47a Option to restrict amp glance image owner
This patch adds an optional configuration setting that allows an
operator to restrict the amphora glance image selection to a specific
owner id.  This is a recommended security setting for clouds that
allow user uploadable images.

Change-Id: I73347b5b3e868d13974cd6ca6bada9cdf75773fe
Closes-Bug: #1620629
7 years ago
Nir Magnezi c4017ae413 _extract_amp_image_id_by_tag should return last created image
_extract_amp_image_id_by_tag should always return the last created
image_id, with the amp_image_tag ("amphora" by default), but it won't.

For the sort='created_at' to work, we should use 'desc' as sorting
direction and take the first element from the images list.

In addition, we now limit the length of the returned images list to 2.
The reason is that we don't need the whole list in order to warn the
system administrator that more than one image has the amp_image_tag.

Closes-Bug #1618921

Change-Id: Ic36213962cf38b032c2d1d8a2ee4abebab3dd82f
7 years ago
liyang 0857083175 No need to use getattr func to get a value
Change-Id: Icdc5c18e7592caa9d3b1d15d5e5c2cc0ecb8e17d
7 years ago
ptoohill1 4230e00a2c Update amp_network to allow multiple networks
Currently the amp_network is a stringOpt and in code it
translates that to a list for processing. It may
be required to deploy with multiple networks,
a listOpt for amp_network option allows this.

Change-Id: I4364c1d03d4c7b560f0d8030b7d66412583a31ae
7 years ago
Jenkins eb7a36565c Merge "Replace deprecated LOG.warn with LOG.warning" 7 years ago
Bharath M f4da51c27d Add CA Cert file config option to validate against SSL endpoints
Currently Octavia cannot validate against SSL service endpoints,
which would be keystone, neutron, nova and glance in this case.

This patch adds a config option under nova, neutron and glance
sections to read the specified CA certificate files
for validation. It's slightly different in the case of glance,
because glance session method invocations depend on the endpoint
URL whether it starts with HTTP or HTTPS.

Also added is the "insecure" option for these services in case
the cert validation needs to be skipped.

For keystone, we read config params from keystone middleware. Thus,
instead of defining a new config option, we can make use of it's
pre-defined "cafile".

Barbican is not added because we do not yet have a barbican endpoint
override in it's config. This could be added in the future as a
separate patch, if needed.

Lastly, unrelated to the above, fixes the amphora REST api default
bind_port in octavia.conf

Change-Id: Id57672a3dc7c962b8ee07db0cb7a743041082c66
Closes-Bug: #1552987
7 years ago
zhang.lei de41db2755 Replace deprecated LOG.warn with LOG.warning
Python 3 deprecated the logger.warn method, see:
https://docs.python.org/3/library/logging.html#logging.warning
so we prefer to use warning to avoid DeprecationWarning.

Change-Id: I49544d1370e7fe083eb23752227567d8d6f24020
Closes-Bug: #1508442
7 years ago
Ihar Hrachyshka fb53fe2340 glance: support relying on tags to extract image id
Deprecated amp_image_id option with the new amp_image_tag option.

Also switched devstack plugin to rely on the tag to update the image
used for new load balancers.

Implements: blueprint use-glance-tags-to-manage-image
Change-Id: Ibc28b2220565667e15ca2b2674e55074d6126ec3
7 years ago
minwang 07a608f681 Implements: blueprint anti-affinity server group
https://blueprints.launchpad.net/octavia/+spec/anti-affinity
Added a new column in lb table for server group id;
Added a new task in compute tasks for creating server group;
Added a new task in dtabase tasks to update server
group id info for lb;
Add server group id in create method in nova driver to support
anti-affinity when creating compute instance

Change-Id: If0d3a9ba1012651937a2bda9bc95ab4f4c8852d5
7 years ago
German Eichberger 22097dc88f Adds a parameter to specify endpoint type
When getting a service catalog from keystone there might be
multiple endpoint types. Adds new parameters to specify
the endpoint type to use in each of the new neutron/nova
groups.

Nova config attributes are removed as the endpoint would be retrieved
from the service catalog with respective endpoint_type and corresponding
roles would define nova access.

CONFIG is added as needed and cfg being removed.

Change-Id: Ie01bd6967eb2003dbe4f7a11ffe8e20a16aa83f5
7 years ago
Jenkins 25bcbc1cc1 Merge "Add endpoint override conf option for neutron and nova" 7 years ago
Bharath M 2d87bdbf17 Replace depcrecated Nova networks with Nova interfaces
Nova network (os-networks) is depcrecated and thus its
usage should be replaced by Nova interface (os-interface).
Create corresponding test cases.

Added nova networks back in since RAX still needs it
Ref url: http://developer.openstack.org/api-ref-compute-v2.1.html#listAttachedInterfaces

Change-Id: Iccfd028055e1d3dc13a63d5e48a8c6e3275d42f2
7 years ago
Trevor Vardeman 240931610f Add endpoint override conf option for neutron and nova
In some implementations overriding the neutron and/or nova endpoint returned in
the keystone catalog will be necessary.  Adding this will allow that to happen.

Change-Id: I66a9ed82a895b9fe282ef7b2c4bdfb954af0cc0c
7 years ago
Brandon Logan 6d7bb98a50 Let drivers decide to use region or not
Passing region, or any other service lookup, authentication, authorization to
the drivers from the controller worker doesn't make much sense.  The driver
implementation should just pull it from the config if the driver needs it.
Otherwise it doesn't matter.  The controller technically should know nothing
about how the driver communicates out, or any setup information like that.
It should be up to the driver to decide that.

Change-Id: Ia6ffcbbe85b97b1ec278ed1ae2d48ca7cedf2834
Closes-Bug: 1539433
7 years ago
Michael Johnson 5a9835ccb7 Stop nova driver delete failure on already deleted
The nova compute driver currently raises an exception if the
instance has already been deleted.

This patch logs a warning, but does not raise an exception when
the instance being deleted is not found.

Change-Id: I72e54297b925c5c6ce0dd711a33e19afc74ba37d
Partial-Bug: #1509706
8 years ago
Brandon Logan 6f7c635661 Change amphora_id to compute_id in compute drivers
Change-Id: I5105eb3fc432d0866a5a106534d6d63b4f315835
8 years ago
Jenkins cc67be5e5f Merge "Replace wrong Nova references to Compute ones" 8 years ago
Bertrand Lallau dd1e3c0797 Replace wrong Nova references to Compute ones
Octavia code base should be more generic, because containers
can be used in a near future.
This patch corrects naming methods and fix some docstrings.

Change-Id: I5157ebaf8a044daf6b0cee5bada5591b7ef50bf1
8 years ago
Brandon Logan 0c80a3bff1 Get noop drivers to function within flows
The noop drivers suffered from not being updated and just not being tested
with being called within flows like normal real op drivers.  This gets the noop
drivers to succeed when called liked other drivers.  They do not do anything
and will return fake information whenever it is required they return data.
This can be improved later so that they actually do their own data store, but
that would require a much larger update and I'm not sure there's much value
in it.

Change-Id: I2627ed35c0f576f8cfa258b542e5bdb4be03dac8
Closes-Bug: #1501190
8 years ago
Carlos D. Garza ccd7865350 Implement UDP heartbeat sender and receiver
Used binary compressed encoding of json dumped object. To reduce
the size needed to send heart beats incase some stats objects
start getting sent later on. Also used sha256 instead of sha1
with hmac.

Co-Authored-By: Michael Johnson <johnsomor@gmail.com>
Co-Authored-By: German Eichberger <german.eichbeger@hp.com>
Co-Authored-By: Carlos Garza <carlos.garza@rackspace.com>
Partially implements: health-manager
Change-Id: I932c693101b94c9132e1741291610508876eab43
8 years ago
Trevor Vardeman 2cfcf3eff1 Adding amphora failover flows
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
8 years ago
Bertrand Lallau 0ab265ff41 Added support of multi-region environment
Octavia does not support keystone regions and can choose an incorrect
endpoint url when multiple regions provides same services.

Change-Id: I5ea9de380419592920555a2c2fe7ac6f6935e700
Closes-Bug: #1487359
8 years ago
Michael Johnson b03a4d08b2 Fixed a parameter issue for config drive files
The parameters passed to novaclient create for config drive
files and user data were incorrect.

Change-Id: Ic7e2a1a32600194959d0c02179bbb0986bfe1413
8 years ago
Brandon Logan 0837da18a7 Fixed various issues with create lb and amphora flow
Closes-Bug: #1450520
Closes-Bug: #1450524
Closes-Bug: #1450621

Change-Id: Ibc347dec4bebe10e0c7603bfa6b09833c84f181f
8 years ago
ptoohill1 7cd76047e6 Update nova_driver to use amp_network
Updates transform method to use amp_network id instead of name

Change-Id: I0a04b93d66b87d92adaa80bf5ec9953c5fc10b97
8 years ago
minwang 321bc765ae Fix Octavia complexity issues
This is for fixing the octavia issue.
We ran the Octavia code base through a static code analyser and several issues got flagged.
As an exercise we looked at each issue and are now proposing fixes to the complexity/code style issues.

Change-Id: I2fc0cf213a9f7488e7cf1dff789d98ca2deeb81f
8 years ago
Michael Johnson 8c9ee6d230 Corrected some __init__() parameters
Removed log from __init__() parameters
Removed get_logger methods
Updated specs for above
Added optional region parameter to noop compute driver

Change-Id: Ie3ed4ebb5d0407cb18f7cf957334dab4bb821bf7
8 years ago
minwang 0a49aa4b31 Add compute noop driver and test case
1. implement methods in noop_driver/driver.py
2. add unit test class in test_compute_noop_driver

Change-Id: Ifc31c7d819ededd7f350cd1d4207ffd48c49a8bb
8 years ago
Brandon Logan 98792dd462 DRY'ed keystone session creation and retrieval
Also corrected importing of keystone config options

Change-Id: Icf4ea584bb199d36f848104254a529e19a6cf8ef
8 years ago
Doug Wiegley ccecb6ea26 Sync with oslo-incubator, tweak as needed
Change-Id: Ice3cfd55ebdfc0b1355ecbb48d42c123cdb743bb
8 years ago