Commit Graph

12 Commits

Author SHA1 Message Date
Steve Baker 3f9151163e Introduce conductor touch while offline
This adds an `online` argument to the conductor touch methods so that
touch can be called with `online=False`. When called periodically this
allows the conductor `updated_at` to be within the threshold to avoid
locked nodes being failed as orphans by another conductor.

This will be used by drain shutdown (and graceful shutdown) so that
tasks can complete on existing locked nodes within the shutdown timeout,
while the conductor is also removed from the hash ring so new tasks are
not started on that conductor.

This change introduces the api but the existing behaviour won't change
until BaseConductorManager.del_host() no longer calls keepalive_halt().

Change-Id: Iedd62193fac1009137b9ee47a6ef5a9a8576f261
2023-10-06 10:42:53 +13:00
Dmitry Tantsur 929907d684 Bye-bye iSCSI deploy, you served us well
The iSCSI deploy was very easy to start with, but it has since become
apparently that it suffers from scalability and maintenance issues.
It was deprecated in the Victoria cycle and can now be removed.

Hide the guide to upgrade to hardware types since it's very outdated.

I had to remove the iBMC diagram since my SVG-fu is not enough to fix it.

Change-Id: I2cd6bf7b27fe0be2c08104b0cc37654b506b2e62
2021-05-04 14:28:25 +02:00
Derek Higgins 7d85b35c84 Register all hardware_interfaces together
Prevent each driver comming online one at a time. So that
/driver returns nothign until all interfaces are registered

Story: #2008423
Task: #41368

Change-Id: I6ef3e6e36b96106faf4581509d9219e5c535a6d8
2021-01-08 15:16:53 +00:00
Iury Gregory Melo Ferreira d6e7552457 Switch to unittest mock
Python3 have a standard library for mock in the unittest module,
let's drop the mock requirement and switch tests to unittest mock.

Change-Id: I4f1b3e25c8adbc24cdda51c73da3b66967f7ef23
2020-04-30 19:04:17 +02:00
Kaifeng Wang e2a768f0cd Expose conductors: db and rpc
This patch lays some ground work around db and rpc to provide
conductors information from the API.

Changes in the db api and Conductor object is used to support
the implementation of /v1/conductors. Adds an argument
"online" to Conductor.get_by_hostname, so that we can get
the conductor object from database even it's not online,
this is required for the implementation of /v1/conductors/{hostname}.

Adds a new interface get_conductor_for() to get the hostname
of the conductor which is servicing the given node, it will
be used for the implementation of /v1/nodes* endpoints, as well
as listing nodes by given conductor.

Story: 1724474
Task: 28064

Change-Id: I39a7a47c5ae649f6c3200e772a9357023f21a7c4
2018-11-29 10:25:16 +08:00
Jim Rollenhagen 7929361a0b Add conductor_group field to config, node and conductor objects
Adds the fields and bumps the objects versions. Excludes the field from
the node API for now.

Also adds the conductor_group config option, and populates the field in
the conductors table.

Also fixes a fundamentally broken test in ironic.tests.unit.db.test_api.

Change-Id: Ice2f90f7739b2927712ed45c969865136a216bd6
Story: 2001795
Task: 22640
Task: 22642
2018-07-18 21:50:29 +00:00
Ramamani Yeleswarapu 9036e1eb5f Add missing 'autospec' to unit tests - /unit/objects/
Proposing adding [H210] hacking check in tox.ini to require ‘autospec’,
‘spec’, or ‘spec_set’ in mock.patch/mock.patch.object calls.

This patch adds missing 'autospec' or 'spec_set' to unit tests in
/tests/unit/objects/.

By using autospec=True assert errors can be caught. [H210] requires that some
value for autospec, spec, or spec_set is defined. It could be autospec=False.

autospec=True doesn't work on staticmethods: https://bugs.python.org/issue23078
For those cases, using spec_set=types.FunctionType.

More patches to follow to cover all the unit tests to enable [H210] in
tox.ini.

Change-Id: I142b49b092520d453b85db25c2c5f197ff85f3eb
2017-11-09 09:28:10 -08:00
Ruby Loo 8a98228251 conductor saves version in db
For rolling upgrades, we added a 'version' column to all the
DB object tables. However, we forgot to save the version value
for conductor objects. This patch addresses that.

Change-Id: Ic366f771491774f9708c9a81ab76dc13757d852b
Partial-Bug: #1526283
2017-08-24 16:40:44 -04:00
Mark Goddard 937f380b6b Unit test consistency: DB base and utils prefix
Trivial rename to improve consistency within the unit tests. Typically
the base and utils modules imported by various tests are prefixed by
db_, obj_, etc.  to differentiate them. This change adds a db_ prefix to
the ironic.tests.unit.db.base and ironic.tests.unit.db.utils imports
outside of ironic.tests.unit.db and submodules.

Change-Id: I39803c592e32e58ce9657ae70bcd45f7b5d51809
2017-06-20 09:36:21 +01:00
Jim Rollenhagen b7e6b737d7 Register/unregister hardware interfaces for conductors
This registers the intersection of supported and enabled interfaces for
each hardware type enabled in the conductor at conductor startup, and
unregisters them at conductor shutdown. Validation is left as a todo for
now.

Change-Id: I14e88bfc304de9414de008d1cc8568dda9115ecc
Partial-Bug: #1524745
2017-01-19 11:28:30 +00:00
Lucas Alvares Gomes 6dd72d9426 Extend the Conductor RPC object
This patch is extending the conductor RPC object adding a method for
registering and unregistering conductors. The touch() method was also
update to make the context parameter optional (since it's not actually
needed).

The base_manager.py module have been updated to use the new methods.

Change-Id: Ifb74909bc2cd39ce4ad056f7174285497e35035c
2016-03-18 13:18:55 +00:00
John L. Villalovos f350d87af8 Prepare for functional testing
Prepare for functional testing by creating two new directories:
  * ironic/tests/unit
  * ironic/tests/functional

Move all files currently in ironic/tests/* to ironic/tests/unit/

Update imports from 'ironic.tests.YYY' to 'ironic.tests.unit.YYY'

Fix any PEP8 issues due to longer lines

Partial-Bug: #1491670
Change-Id: I1166f20adf8c84b2042b62e348926502a4851e08
2015-09-28 21:27:01 +00:00