summaryrefslogtreecommitdiff
path: root/ironic/objects/conductor.py
Commit message (Collapse)AuthorAgeFilesLines
* Bye-bye iSCSI deploy, you served us wellDmitry Tantsur2021-05-041-1/+1
| | | | | | | | | | | | 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
* Register all hardware_interfaces togetherDerek Higgins2021-01-081-12/+7
| | | | | | | | | | 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
* Expose conductors: db and rpcKaifeng Wang2018-11-291-2/+24
| | | | | | | | | | | | | | | | | | | | | 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
* Add conductor_group field to config, node and conductor objectsJim Rollenhagen2018-07-181-2/+10
| | | | | | | | | | | | | | | 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
* conductor saves version in dbRuby Loo2017-08-241-3/+5
| | | | | | | | | 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
* Add context to IronicObject._from_db_object()Ruby Loo2017-04-281-2/+6
| | | | | | | | | | | | | | There is code in oslo.versionedobjects that expects an object class to have this method: _from_db_object(context, item_cls(), db_item, **extra_args) To conform to this, this patch adds 'context' as the first parameter of base.IronicObject._from_db_object(). As a bonus, some docstrings were cleaned up. Change-Id: I09b02f47d47cec22d03460b693f9e5c488cf04c7 Closes-Bug: #1670778
* Register/unregister hardware interfaces for conductorsJim Rollenhagen2017-01-191-1/+24
| | | | | | | | | | 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
* Clean up object codeRuby Loo2016-12-061-4/+3
| | | | | | | | | | | | | This: 1. replaces hardcoded object names with the 'cls' variable where appropriate. 2. removes __class__ from calls to <an object>.__class__.<class method> since <an object>.<class method> works. This is a follow up to reviewers' comments in f766bbab451cd8a0b37b1085ee4d95bcda95a8b8. Change-Id: Iecd057ec9a166620b22a6d6c3f780eed3f60b655
* Extend the Conductor RPC objectLucas Alvares Gomes2016-03-181-1/+36
| | | | | | | | | | | 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
* Move _from_db_object() into base classJohn L. Villalovos2016-02-241-9/+0
| | | | | | | Had five copies of the def _from_db_object() function in various classes. Move this function into their common base class. Change-Id: I543386a708d80f7c89455e556e2abc6d532661b0
* Implement indirection_apiGrzegorz Grasza2015-09-241-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | During a rolling upgrade, ironic conductor and api services are running with different versions. When an object is received in an incompatible version, IncompatibleObjectVersion is raised. Implementation of the indirection API allows the object to be backported to a supported version by the conductor (conductor has to be the first service to be upgraded). This change enables backporting of objects from Mitaka. This lays the foundation to be able to do rolling upgrades from Liberty (or from this patch onwards) to Mitaka. There may still be other issues that will need fixing in Mitaka before we will be able to do a full rolling upgrade. Enabling the indirection_api causes all object methods decorated with the remotable or remotable_classmethod to do RPC from ironic-api to ironic-conductor service. To keep the current behavior, I'm removing all remotable decorators on object methods and thus not enabling object RPC calls in this patch. These calls caused random timeouts on the CI gates (probably due to a race in which Nova calls the ironic-api service before ironic-conductor is up). RPC calls made via the indirection_api should be enabled one-by-one, when the implications are fully understood. Change-Id: Ia381348da93f95d764c83f3ec2a2ed5a1db5ad6d Closes-Bug: 1493816 Depends-On: I81400305f166d62aa4612aab54602abb8178b64c
* Use oslo.versionedobjects remotable decoratorsLin Tan2015-09-171-3/+3
| | | | | | | | Use remotable decorators from oslo.versionedobjects. remotable() treats context as option parameter, so change some tests accordingly. Change-Id: I84aef23cfa13a6162120e048477228015defc7e6
* Base IronicObject on VersionedObjectLin Tan2015-09-171-1/+3
| | | | | | | | | | | | | | | Make IronicObject based on VersionedObject and introduce VersionedObjectDictCompat class from oslo library. This is only a temporary solution to support object['key']. Object should only be called like object.key Make all objects multiple inherit from these two classes can reduce the future work to remove the support of IronicObjectDictCompat. This will be addressed in next patches once finish the migration to oslo.versionedobject library. Partial-Bug: #1461239 Change-Id: Ieb2c406c10da75f9c42320085c563c166eda1703
* Replace metaclass registry with explicit opt-in registry from osloLin Tan2015-09-161-0/+1
| | | | | | | | | | | | | | | Previously, objects are registered through metaclass, which is complicate to understand. So oslo.versionedobjects move this to ObjectRegistry class. Each object is registered with a decorator. This also includes registering some test-only classes, which use the register_if(False) scheme to do the object-building step, but without actually inserting the class into the registry. This prevents those test classes from ever being registered at runtime by accident (and thus send/receive-able over RPC). Co-Author: Dan Smith <dms@danplanet.com> Partial-Bug: #1461239 Change-Id: Ice4d47185b888d1b33e761d7d1437bb20abb3d93
* Refactor refresh method in objects for reuseSinval Vieira2015-07-231-4/+1
| | | | | | | | | | | | This change refactors the "refresh" method in ironic.objects.chassis, ironic.objects.conductor, ironic.objects.node and ironic.objects.port to reuse a more generic method added to ironic.objects.base.IronicObject for identifying and applying changes of fields. It make the code in refresh method more simpler to understand by removing details of implementation, in addition decreases the code replication in four classes. Change-Id: I6171203690cfd282fa1250dbe0204151f5c665fb
* Migrate RPC objects to oslo.versionedobjects FieldsLucas Alvares Gomes2015-07-091-4/+4
| | | | | | | | | | This patch also makes the Field object able to be called like a function, which emulates the old interface that objects are expecting. This should be removed once objects/base.py is updated to stop using the old interface for the fields Partial-Bug: #1461239 Change-Id: I34c0203e40d249348626a65584baf2e68cb1b642
* Enforce flake8 E123/6/7/8 in ironicSam Betts2015-06-041-5/+5
| | | | | | | | | | | | | | | | | This patch enforces the rules E123, E126, E127, and E128 in the ironic code base: E123 - closing bracket does not match indentation of opening bracket’s line E126 - continuation line over-indented for hanging indent E127 - continuation line over-indented for visual indent E128 - continuation line under-indented for visual indent This fixes any parts of the current code which fails these rules and removes these rules from the tox.ini flake8 ignore list. Change-Id: Ia96582b5e9abc088d6c1694afc93c59be4a4065c Closes-Bug: 1421522
* Do not use the context parameter on refresh()Lucas Alvares Gomes2014-09-231-3/+16
| | | | | | | | | | | | | | | | | Now all RPC objects already have a context embedded within them so we can ignore the context parameter on the refresh() method (it was the last method using this parameter). This patch also: * Update the Docstrings from the @remotable methods to let the user know that the context parameter is not being used. The @remotable decorator still requires that the method it's decorating have a context as it's first argument, but that's going to change in the future. * All code and tests were updated to not pass the context to refresh(), save() and destroy() methods. Closes-Bug: #1314732 Change-Id: Ibb338b909d99862ae048d605e66b8831d8c2128d
* Do not set the context twice when forming RPC objectsLucas Alvares Gomes2014-09-221-3/+0
| | | | | | | | | The context is already being set once the object is instantiated so there's no need to set it again. This patch fixes that and update tests to validate if the right context has been added to the object. Change-Id: I7eb3d734a990eb70e4fbfce6c539b268900b5241 Partial-Bug: #1314732
* Make context mandatory when instantiating a RPC objectLucas Alvares Gomes2014-09-221-1/+1
| | | | | | | | | | RPC objects should have a context within it, this patch is making passing the context mandatory when instantiating the object and is a plumbing work to remove passing the context later for things like create(), refresh(), destroy() and save(). Partial-Bug: #1314732 Change-Id: If9b175fa874bcb96c77cf22d176f1111f450f796
* Remove gettextutils _ injectionVladyslav Drok2014-08-291-0/+1
| | | | | | | | | | Now that ironic supports oslo.i18n, using the install function to inject _ into the builtin has been deprecated. New i18n common module used instead. In one module _ was imported from gettextutils, now also changed to i18n import. Closes-bug: #1346406 Change-Id: I672a975d479991982c24031e834a26e2c2811890
* Remove objectify decorator from dbapi's {get, register}_conductor()Lucas Alvares Gomes2014-08-141-1/+5
| | | | | | | | | | | | | | | | This patch removes the objectify decorator from the get_conductor and register_conductor dbapi's methods. For get_condutor() method there's an objects interface to it so this patch make the code/tests use the object interface vs direct calls to dbapi. The problem with the objectify decorator is that dbapi methods doesn't get the context, so when forming the RPC object using the decorator we can't store the context within the object (which is what we want to do to have consistent object interfaces). Partial-Bug: 1314732 Change-Id: I1a955a59435b35277f3bbff2c02c07dd1a4c1d66
* Remove extraneous vim configuration comments for ironicHe Yongli2014-02-261-1/+0
| | | | | | | | | | | | Remove vim setting: comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4 at the top of source code files, except for files in openstack/common. Change-Id: Ie80f76f08e27b7f5f747227c4cca8d79ad98bec6 Partial-Bug: #1229324
* Conductors maintan driver list in the DBDevananda van der Veen2013-10-241-0/+69
To facilitate exposing a list of drivers in the API, and keep track of which ironic-conductor instance status, this patch ... * adds a new 'conductors' table in the DB * adds a Conductor object class (with intentionally limited functionality) * adds db/api methods for register/unregister/get/touch * adds periodic task to conductor to maintain its updated_at field * adds an additional db/api method to retrieve a list of drivers which are registered by active conductor instances Change-Id: I1ebdb92d5c2d6ad1a6d1717dd13ff51be181ccc0