Commit Graph

13 Commits

Author SHA1 Message Date
Sergiy Markin d00eaf0303 Drydock focal related upgrades
This PS implements the following changes:
- switches freeze approach to requirements-direct.txt and
  requirements-frozen.txt files
- adjusts code tabulation style according to  yapf recommendations
- replaces deprecated usage of responce.body attribute with
  responce.text
- fixes integration tests in controlled by Makefile + tox
- uplifts Helm to v3.9.4

Change-Id: I751db72eb8f670825382f11a36657112faeb169a
2023-04-26 22:32:49 +00:00
Ruslan Aliev 389db640e4 Change MAAS api endpoints according to v3.0.0
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Change-Id: I9daa8b5b8d76f2da939ce0dffdb3471ba7cd8947
2023-03-10 01:44:09 -06:00
Phil Sphicas 611e98de3f Use OOB driver creds for MAAS
During MAAS enlistment (and commissioning), an IPMI account (named
"maas" by default) is created on each node, which MAAS then uses for
power management.

This change allows MAAS to use the same credentials as the ones used by
the OOB driver, by overwriting the power parameters for the discovered
nodes. This includes the power type, so if the node is configured to use
Redfish, then Drydock will update a MAAS node discovered as IPMI to use
Redfish instead.

It also provides an option to instruct MAAS not to recreate IPMI
credentials during commissioning, which is passed through to the MAAS
API. Setting this to true is only supported in MAAS 2.7 or later [0].

The two maasdriver configuration options are introduced in drydock.conf,
along with their default values:

    [maasdriver]
    use_node_oob_params = false
    skip_bmc_config = false

These options do not prevent MAAS from creating the IPMI account during
enlistment - this would require addition MAAS customization.

0: 8842d0bfd3

Change-Id: I24d3bc3b1cc94907d73bc247de3fc06dd4750ab1
2021-07-30 16:39:06 +00:00
Phil Sphicas 292e94ee2c Avoid expensive MAAS API calls
The MAAS API call "GET /MAAS/api/2.0/machines/" retrieves information
about every machine known to MAAS, which is very slow. The API supports
filtering based on hostname and mac_address (among others), and querying
for power parameters for all nodes at once.

This change modifies identify_baremetal_node to avoid calling refresh on
the full machine list.

Also, the refresh method of ResourceCollectionBase is updated to allow
passing of params, which can be used to take advantage of the filtering.
Note that a filtered call to refresh overwrites the resources collection
to only contain the returned values.

Most calls to Machines.refresh() aren't really needed at all - they are
replaced with a call to Machines.empty_refresh(), which will still make
sure that the API endpoint is accessible but return an empty collection.
(This may get removed entirely in the future.)

Change-Id: Ie58c45e1790c5c827d9d47f5582214ca519946de
2021-07-28 22:56:13 +00:00
Alexander Hughes 1755930331 Address PEP8 Failures in Drydock
Flake8 version recently updated to include new PEP8 rules. Some of
the codebase is not compliant with the new rules.

Change-Id: I0f5b3d41ee54ff0d9ffa05f733f98c7e34f0f258
Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
2020-05-12 18:27:06 +00:00
Scott Hussey 7504c2f907 (fix) Support non-present networks
- Drydock should support defined networks that MAAS cannot
  see. This fixes an issue that caused this use-case to fail
  by ensuring that the MAAS client models with no internal
  resource IDs work.

Change-Id: I1a20d4730e94eee7268ff0cc3451e4b459a1e62b
2019-02-19 11:26:08 -06:00
Zuul c39a4ede1a Merge "Add Redfish as OOB driver" 2018-12-21 14:36:22 +00:00
Scott Hussey 54ea0e1374 Workaround MAAS race condition
- If two threads concurrently update the power parameters
  of VMs on the same libvirt host, it seems to leave MAAS
  with broken state. Add locking in Drydock so that Drydock
  does not do this concurrently.

Change-Id: I85575f4ba48152b4dc79c646871f33b69f845ab9
2018-12-17 11:29:52 -06:00
Hemanth Nakkina da0c7e831e Add Redfish as OOB driver
This patch implements Refish as new OOB driver for Drydock.
All the existing Drydock Orchestrator actions are implemented.

Change-Id: I31d653fb41189a18c34cfafb0f490ca4f4d661b5
2018-12-08 21:19:30 +05:30
Roman Gorshunov d5c54eab68 Fix: pep8 airship-drydock-omni-test fix
Fixes for pep8 test.

Change-Id: Id2b7a187ffe56a47a184314d1a19507a78f7d88a
2018-11-05 18:35:36 +01:00
Scott Hussey 357cf7e455 Support multiple rack controllers
- Update the maasdriver to support two concurrent
  rack controllers when configuring networking.
- Identify a baremetal node from both the MAAS node and
  rack controller collections
- Relax validation to only require at least one healthy
  rack controller

Change-Id: I04beb56a8212b65061840021b13b412fbb37ae81
2018-10-18 17:04:00 -05:00
Scott Hussey 6ca7aa4bff Catchup YAPF formatting
Change-Id: Ic54f77b4b0bdd9199fbc10dfdfc43d3af8f0bfd1
2018-09-26 08:57:51 -05:00
Scott Hussey 0f39a55942 Refactor build to include Go
Adding the baclient code to Drydock requires a refactor
of the build automation to support multiple languages
and multiple artifacts included in a single Docker image

NOTE: the go source here is a placeholder 'hello world' sample

Change-Id: I1b4883f018b33b3d4fcd7cbcb6cba660fcdc93de
2018-09-04 13:13:21 -05:00