Commit Graph

91 Commits

Author SHA1 Message Date
Zuul d5802f832f Merge "Expose conductor online boolean for accurate alive" 2024-04-07 17:38:51 +00:00
Steve Baker 161374f763 Expose conductor online boolean for accurate alive
Currently the online database column is not considered when displaying
the "baremetal conductor list" Alive status. This means that when a
conductor is stopped gracefully it will be shown as (inaccurately)
alive for the duration of [conductor]graceful_timeout.

This change adds the online field to the alive evaluation, so the
conductor must be online *and* have a recent heartbeat.

Change-Id: Ic5a8d56ec236faca1b9797bd0d3e42c956469fab
2024-03-22 15:07:12 +13:00
Dmitry Tantsur b7954ad720
Do not rely on predefined UUIDs in tests
Change-Id: I0e9d73351a92e133cd6c484b5fb415ae005314b0
2024-03-18 12:35:30 +01:00
Julia Kreger 2366a4b86e Adds service steps
A huge list of initial work for service steps

* Adds service_step verb
* Adds service_step db/object/API field on the node object for the
  status.
* Increments the API version to 1.87 for both changes.
* Increments the RPC API version to 1.57.
* Adds initial testing to facilitate ensurance that supplied steps
  are passed through and executed upon.

Does not:

* Have tests for starting the agent ramdisk, although this is
  relatively boiler plate.
* Have a collection of pre-decorated steps available for immediate
  consumption.

Change-Id: I5b9dd928f24dff7877a4ab8dc7b743058cace994
2023-08-16 06:34:08 -07:00
Iury Gregory Melo Ferreira dad6724292 Add DB API for Firmware and Object
Adds the following methods to DB API:

* create_firmware_component
* update_firmware_component
* get_firmware_component
* get_firmware_component_list

FirmwareComponent
* create | save | get

FirmwareComponentList
* get_by_node id | sync_firmware_components

Adds two exceptions:

* FirmwareComponentAlreadyExists
* FirmwareComponentNotFound

Tests for db and objects

Changes were required in models, the class name should match the
object name we will create

Story: 2010659
Task: 47977

Change-Id: Ie1e2a4150d4ee4521290737612780c02506f4a9e
2023-06-28 14:05:21 -03:00
Mahnoor Asghar fa2d6685f3 Handle duplicate node inventory entries per node
When a node is inspected more than one time and the database is
configured as a storage backend, a new entry is made in the database
for each inspection result (node inventory). This patch handles this
behaviour as follows:
By deleting previous inventory entries for the same node before adding
 a new entry in the database.
By retrieving the most recent node inventory from the database when the
database is queried.

Change-Id: Ic3df86f395601742d2fea2bcde62f7547067d8e4
2023-06-07 08:08:37 -04:00
Julia Kreger 3f5e25e182 DPU modeling - parent_node DB/Model/API
Adds the parent node support and tests in one change
including all DB/Model/API changes along with RBAC and
basic API tests.

* Updates the API version to 1.83
* Adds parent_node and related index to the nodes table.
* Adds new API parameters to list by parent node relationship.

Depends-On: https://review.opendev.org/c/openstack/ironic/+/883967
Change-Id: I8d64fee7105718199986db4994e13352d639f04f
2023-05-23 18:23:25 +00:00
Dmitry Tantsur 3e21560bf7 Remove all references to the "cpus" property
Unused by Nova and unlike memory_mb/local_gb also by Ironic (actually,
our usage of local_gb is worth double-checking as well, but at the very
least it's referenced by inspection implementations).

Change-Id: Ie8b0d9f58f4dcd102c183c30ae7f5acf68a5e4c3
2023-03-28 11:53:26 +02:00
Zuul c130d063b6 Merge "Use association_proxy for port groups node_uuid" 2023-02-19 13:54:58 +00:00
Jay Faulkner 36ef217fdb DB & Object layer for node.shard
DB and object implementations for new node.shard key.

Story: 2010768
Task: 46624
Change-Id: Ia7ef3cffc321c93501b1cc5185972a4ac1dcb212
2023-02-13 11:46:21 -08:00
Harald Jensås 1f8a0a21de Use association_proxy for port groups node_uuid
This change adds 'node_uuid' to:
  ironic.objects.portgroup.Portgroup

'node_uuid' is a relationship using association_proxy in
models.Portgroup. Using the association_proxy removes the
need to do the node lookup to populate node uuid for
portgroups in the api controller.

NOTE:
 On portgroup create a read is added to read the port from
 the database, this ensures node_uuid is loaded and solves
 the DetachedInstanceError which is otherwise raised.

The test test_list_with_deleted_port_group was deleted, if
the portgroup does not exist porgroup_uuid on the port will
be None, no need for extra handling of that case.

Bumps Portgroup object version to 1.5

Change-Id: I4317d034b6661da4248935cb0b9cb095982cc052
2022-12-14 09:14:23 +01:00
Harald Jensås 8b00932e48 Use association_proxy for ports node_uuid
This change adds 'node_uuid' to ironic.objects.port.Port
and adds a relationship using association_proxy in
models.Port. Using the association_proxy removes the need
to do the node lookup to populate node uuid for ports in
the api controller.

NOTE:
 On port create a read is added to read the port from the
 database, this ensures node_uuid is loaded and solves the
 DetachedInstanceError which is otherwise raised.

Bumps Port object version to 1.11

With patch:
  1. Returned 20000 ports in python 2.7768702507019043
     seconds from the DB.
  2. Took 0.433107852935791 seconds to iterate through
     20000 port objects.
     Ports table is roughly 12800000 bytes of JSON.
  3. Took 5.662816762924194 seconds to return all 20000
     ports via ports API call pattern.

Without patch:
  1. Returned 20000 ports in python 1.0273635387420654
     seconds from the DB.
  2. Took 0.4772777557373047 seconds to iterate through
     20000 port objects.
     Ports table is roughly 12800000 bytes of JSON.
  3. Took 147.8800814151764 seconds to return all 20000
     ports via ports API call pattern.

Conclusion:
  Test #1 plain dbapi.get_port_list() test is ~3 times
  slower, but Test #3 doing the API call pattern test
  is ~2500% better.

Story: 2007789
Task: 40035
Change-Id: Iff204b3056f3058f795f05dc1d240f494d60672a
2022-12-14 09:14:14 +01:00
Jakub Jelinek 59b0dc4599 Implements node inventory: database
Prepare the ironic database to accommodate node inventory received from
the inspector once the API is implemented.

Story: 2010275
Task: 46204
Change-Id: I6b830e5cc30f1fa1f1900e7c45e6f246fa1ec51c
2022-11-15 16:55:36 +00:00
Zhou Hao fc24275ba3 [iRMC] Convert the type of irmc_port to int
When using the node managed by the `irmc` hardware type,
if the port number of the bmc address is manually specified,
the following error will occur:

```
Value '443' is not supported for 'irmc_port'
```

However iRMC supports 80 and 443 ports, and default to 443.
The reason for this error is that the type of irmc_port is not converted to int.

Story: #2009671
Task: #43915

Signed-off-by: Zhou Hao <zhouhao@fujitsu.com>
Change-Id: I4e9274de09758fdb468382a7f88298a279f43e92
2021-11-10 14:51:57 +08:00
Kaifeng Wang fbaad948d8 Implements node history: database
This patch provides basic data model change to support node history.
Batch removal is not included in this patch.

Change-Id: I5c7cebd585ee84b5b57bd4690d4074baf0d05699
Story: 2002980
Task: 22989
2021-09-09 09:35:09 -07:00
Cenne 46ff51487a Add `boot_mode` and `secure_boot` to node object and expose in api
* add fields to Node object
  * expose them at endpoint `/v1/nodes/{node_ident}/states`
  * update states on powersync / entering managed state.
  * tests
  * update api endpoint info in api-ref

Story: 2008567
Task: 41709

Change-Id: Iddd1421a6fa37d69da56658a2fefa5bc8cfd15e4
2021-07-08 15:04:15 +02:00
Bob Fournier e15440370c Include bios registry fields in bios API
Provide the fields in the BIOS setting API -
``/v1/nodes/{node}/bios/{setting}``, and in the BIOS setting list API
when details are requested - ``/v1/nodes/<node>/bios?detail=True``.

Story: #2008571
Task: #42483
Change-Id: Ie86ec57e428e2bb2efd099a839105e51a94824ab
2021-05-27 12:15:20 -04:00
Aija Jauntēva 952695be33 Add Redfish RAID interface to idrac HW type
Adds MVP support for idrac-redfish to RAID interface. Based on
generic redfish implementation, but requires OEM extension
to check when `Immediate` time becomes available shortly
after IPA starts executing steps.

Does not support foreign disks, convert from non-RAID mode.

Story: 2008602
Task: 41778
Depends-On: https://review.opendev.org/c/x/sushy-oem-idrac/+/776224
Change-Id: Iefb7f882c97e33a176962e4e907163d9e4809445
2021-03-19 12:11:50 -04:00
Kaifeng Wang b7ddeb314d Support port name
MAC address is not user friendly for port management, having
a name field is also a feature parity with other resources.
This patch implements db related change.

Change-Id: Ibad9a1b6bbfddc0af1950def4e27db3757904cb1
Story: 2003091
Task: 23180
2020-11-29 13:37:55 +08:00
Ilya Etingof 653d4e4ef5 Add `network_data` field to ironic node object
A new dictionary field `network_data` is added to the node object.
This new field can be populated by the operator with node static
network configuration.

Ironic API now performs formal JSON document validation of node
`network_data` field content against user-supplied JSON schema at
driver validation step.

As of this commit, the new `network_data` field is not actually
used by ironic, otherwise it should be perfectly functional. In
the following commits, network static configuration will be taken
from this field and handed over to ironic ramdisk bootstrapping
utilities.

Change-Id: I868b3b56a17f59e5aa1494b2e0ebc9c4e34ef173
Story: 2006691
Task: 36991
2020-05-05 15:57:36 +02:00
Aeva Black 9f75bbd938 Add my new address to .mailmap
This commit updates the mailmap file and changes my alias
in a few places within old comments.

Change-Id: Ica0e184109d794b8e129d567b5606d7fe84ff384
2020-04-13 07:29:37 -07:00
Tzu-Mainn Chen 602a467a04 Add node lessee field
This change adds a `lessee` field to nodes, and exposes it
to policy. It also updates the non-admin node list API
to match for both owner and lessee; and updates the
allocation conductor to match owner allocations with nodes
with the appropriate lessee.

Change-Id: Ib31b49c7143ec8fd6cb486fc24038215b197c418
Story: 2006506
Task: 37930
2020-04-07 15:33:42 +00:00
Arne Wiebalck 3ecaadbb35 Support node retirement
This change adds support for node retirement: nodes can
have additional properties 'retired' and 'retired_reason'
which change the way the nodes (can) traverse the FSM
and which operations are allowed. In particular:
- retired nodes cannot move from manageable to available;
- upon instance deletion, retired nodes move to manageable
  (rather than available).

Story: #2005425
Task: #38142

Change-Id: I8113a44c28f62bf83f8e213aeb6704f96055d52b
2020-01-28 11:01:32 +01:00
Tzu-Mainn Chen 3fbb560af1 Add owner to allocations and create relevant policies
Add an owner to allocations. Depending on policy, a non-admin
can then create an allocation and have the owner set to their
project. Allocation processing then respects the owner.

Change-Id: I2965a4a601b9fa2c0212097da37b104a3e5514df
Story: #2006506
Task: #37540
2019-12-10 19:00:33 +00:00
Julia Kreger 5f18e52b64 Remove CIMC/UCS drivers
Cisco's Third-Party CI was taken down as a result of the
CTO's office being restructured. Numerous attempts to
re-engage with Cisco directly and address the various
known issues in their drivers have not proven to be
fruitful.

Additionally, the drivers are not Python3 compatible,
and some reports have indicated that the CIMC driver is
no longer compatible with newer versions.

As such, the ironic community has little choice but to
to remove the Cisco UCS/CIMC hardware types and driver
interface code.

Story: 2005033
Task: 29522
Change-Id: Ie12eaf7572ce4d66f6a68025b7fe2d294185ce28
2019-06-25 23:44:19 -07:00
ZhongShengping a280696a03 Replace git.openstack.org URLs with opendev.org URLs
Thorough replacement of git.openstack.org URLs with their opendev.org
counterparts.

Change-Id: Ic19e45986e9f650c1deb297f463e679fd268ad97
2019-04-24 16:13:58 +08:00
Qianbiao NG f1f4f892fe Add Huawei iBMC driver support
This patch proposes to adding iBMC driver for deploying the
Huawei 2288H V5, CH121 V5 series servers.
The driver aims to add management and power interfaces using
Huawei iBMC RESTful APIs for those series servers.

Change-Id: Ic5e920e4e58811c6a6dfe927732595950aea64e7
Story: 2004635
Task: 28566
2019-03-14 11:04:29 +08:00
Zuul 6afb2906bd Merge "Deploy Templates: add 'extra' field to DB & object" 2019-02-27 05:57:57 +00:00
Mark Goddard a105ee0943 Deploy Templates: add 'extra' field to DB & object
The original patch [1] to add DB & object support for deploy templates
did not include an 'extra' field for metadata. This patch adds the
field, and bumps the object version.

Change-Id: I95b4beae217704defc9eab851780fd9c42847c40
Story: 1722275
Task: 29698
2019-02-26 15:54:51 +00:00
Mark Goddard a094aa7e94 Deploy Templates: Fix DB & object nits
Fix nits raised in https://review.openstack.org/#/c/627663.

Change-Id: I87492119ff0b7df8bf899a175f9fa57638e6c314
Story: 1722275
Task: 28674
2019-02-21 12:21:11 +00:00
Mark Goddard b137af30b9 Deploy templates: data model, DB API & objects
Adds deploy_templates and deploy_template_steps tables to the database,
provides a DB API for these tables, and a DeployTemplate versioned
object.

Change-Id: I5b8b59bbea1594b1220438050b80f1c603dbc346
Story: 1722275
Task: 28674
2019-02-13 19:26:21 +00:00
Kaifeng Wang d30d814956 Add description field to node
This patch implements the feature of storing informational free-form text
into ironic node, via the "description" field.

Operators can do simple queries on the context of description.

Change-Id: I787fb0df34566aff30dea4c4a3ba0e1ec820d044
Story: 2003089
Task: 23178
2019-02-01 10:25:58 +08:00
Hamdy Khader 86e31bff41 Add is_smartnic to Port data model
To allow the use of Smart NICs on baremetal nodes it is required to mark
an ironic port as a Smart NIC, this change implement the changes required
for adding port attribute 'is_smartnic' in Port object and data model
alongside with migration scripts and unit tests.

Story: #2003346
Change-Id: Ic2ffbd6f1035907ea5a18bda6d2b21e617194195
2019-01-29 11:17:08 +02:00
Dmitry Tantsur a4717d9958 Allocation API: database and RPC
This change adds the database models and API, as well as RPC objects
for the allocation API. Also the node database API is extended with
query by power state and list of UUIDs.

There is one discrepancy from the initially approved spec: since we
do not have to separately update traits in an allocation, the planned
allocation_traits table was replaced by a simple field.

Change-Id: I6af132e2bfa6e4f7b93bd20f22a668790a22a30e
Story: #2004341
Task: #28367
2019-01-07 12:51:10 +01:00
Julia Kreger 052d90506f Add "owner" information field
Adds "owner" field on the node object and exposes it for updates
via the API.

Additionally, fixed a couple minor items related to the prior
where we missed updating version numbers in rebases.

Change-Id: Iaaf3db97d21de9b11236cf2d18ffcc3f73f6e50c
Story: #2001814
Task: #12550
2018-12-10 14:27:31 -08:00
Kaifeng Wang 7c7744dfb3 Expose conductors: api
This patch implements API part to the feature of exposing conductors
information.

A new API object Conductor is added to provide endpoints below:

* GET /v1/conductors for listing conductor resources
* GET /v1/conductors/{hostname} for showing a conductor

V1 endpoint discovery and default policy are updated.

A conductor field is added to Node API object, which returns in
/v1/nodes* related endpoints.

Considering patch size and microversion conflicting with other api
patches, api-ref would go in another patch if no strong opinions.

Story: 1724474
Task: 28064

Change-Id: Iec6aaabc46442a60e2d27e02c21e67234b84d77b
2018-12-04 09:13:24 +08:00
Dmitry Tantsur 68d62f2bee Support for protecting nodes from undeploying and rebuilding
When handling the "pet" case, some nodes may be critical for the deployment.
For example, in an OpenStack installer like TripleO you may want to make
sure your controllers are not removed by an incorrect operation.

This changes introduces a new field "protected" on nodes. When it is
set to True, the "deleted" and "rebuild" provisioning actions fail with
HTTP 403.  Deleting such nodes is also not possible.

Also adds "protected_reason" for the operators to specify the reason
a node is protected.

Story: #2003869
Task: #26706
Change-Id: I1950bf6dd65b6596cae69d431ef288e578a89d6e
2018-11-27 10:07:30 +01:00
Julia Kreger abb0865771 Remove oneview drivers
In accordance with the deprecation of oneview,
It is time to remove the oneview drivers.

This patch oneview interfaces and documentation.

Change-Id: Ided79fa788411f839614813ff033c42a13b88c75
Story: #2001924
Task: #24943
2018-10-15 16:32:15 -07:00
Yolanda Robla 869b86e0c3 Add functionality for individual cleaning on nodes
Create the object for automated clean and add the logic
in the conductor to be able to enable clean for specific
nodes, when general automated clean is disabled.

Story: #2002161
Task: #24579

Change-Id: If0130082e16d1205fdf65d083854ef9849754f8b
2018-10-05 09:21:58 +02: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
Mark Goddard f5a5af32a3 Deploy steps - DB model
Adds a 'deploy_step' column to the nodes table.

Co-Authored-By: Ruby Loo <rloo@oath.com>

Change-Id: I31286266f28b1fdcdfeb6002992f4eece25c6ac1
Story: #1753128
Task: #22592
2018-07-10 13:10:24 -07:00
Ilya Etingof 876b22095d Add read&write SNMP community names to `snmp` driver
SNMP agents are sometimes configured to use different SNMP community
names for read and write operations. With ironic `snmp` driver it
is currently impossible to configure its SNMP manager to use
different SNMP community names for SNMP GET and SET commands.

This patch fixes that by introducing new optional node
properties: `snmp_community_read` and `snmp_community_write`.

Change-Id: Idb726f072f031a819b48fdd1ae66369cffb73841
Story: 1751748
Task: 10663
2018-07-05 16:26:49 +00:00
Zenghui Shi 6acb6d9cce BIOS Settings: update default BIOS setting version in db utils
Change-Id: I290f23778893cdbbd13e267b7bab990d6c4de325
2018-06-21 15:01:58 +08:00
Zuul 94526fd977 Merge "SNMPv3 security features added to the `snmp` driver" 2018-06-19 07:14:47 +00:00
Dmitry Tantsur 7fcca34de6 Completely stop using the "fake" classic driver in unit tests
This change makes "fake-hardware" the default driver for test nodes
and makes enabled_drivers empty in the base test class.

Note that some unit test coverage for classic drivers is lost because
of this change. It is fine, because the classic drivers themselves
are deprecated and will be removed soon.

Change-Id: I06acb5aed24ef952db3f9e6987e5a90c81e96401
2018-06-06 16:10:43 +02:00
Ilya Etingof 635f4a9e17 SNMPv3 security features added to the `snmp` driver
SNMPv3 message authentication and encryption features
added to Ironic ``snmp`` driver.

Added support for the ``context_engine_id`` and
``context_name`` parameters of the SNMPv3 message
at Ironic's ``snmp`` driver.

The ``snmp_security`` parameter of Ironic ``snmp``
driver is obsoleted by the ``snmp_user`` parameter.
Though ``snmp_security`` parameter remains supported.

For the sake of patch reviewability, it does not touch
similar SNMP features in the `iLO` and `irmc` drivers.
A followup patch might converge these similar SNMP uses
onto the core ``snmp`` driver's functionality this patch
introduces.

Change-Id: Ic8a4fc37a42377c4ec50ffae421b3f47922ef982
Story: 1710850
Task: 10611
2018-05-25 14:43:18 +02:00
Zuul 5f7d60a6c6 Merge "Power fault recovery: db and rpc implementation" 2018-05-23 11:03:37 +00:00
Kaifeng Wang 6b44f269c1 Power fault recovery: db and rpc implementation
This adds a fault field to the node table of database, and necessary rpc
object change and version bumping.

Story: #1596107
Task: #10469

Change-Id: I5539aa0406dbfbde25bc9aa91d5c1e615875e50e
2018-05-20 15:30:08 +08:00
Zuul d25f478fe7 Merge "Fix XClarity parameters discrepancy" 2018-05-13 15:03:34 +00:00
jiapei f6dd50d78b Fix XClarity parameters discrepancy
The XClarity parameters required by driver_info are changed, so
that the code is consistent with the document. Besides, we add
driver information parse code to verify if it has all the required
parameters. And unit tests pass.

Add releasenotes for deprecate-xclarity-config.

Change-Id: I4412c550ae4d1f506db0c1289920e5bd62f8f724
Story: 2001841
Task: 12607
2018-05-11 07:24:00 +00:00