Commit Graph

96 Commits

Author SHA1 Message Date
Riccardo Pittau 6a2590ec6a Fixes for tox4
- use generic test template
- remove autospec in power test as we don't use actual libvirt
module to test. The libvirt-python module is fully mocked.

Change-Id: Ied36a8afb818422c643edca8a2feeec977b53551
2023-01-03 09:48:18 +01:00
Zuul 944ca03d36 Merge "Remove mentions of the iSCSI deploy" 2021-04-29 11:31:57 +00:00
Brendan Shephard 594cb9ad98 Fix issues with byte encoded strings
If byte encoded strings are passed to the
ovirt SDK. We get the error outlined here:
https://bugzilla.redhat.com/show_bug.cgi?id=1924928

This change leaves the string validation in place,
but passes while raising a warning. Ultimately,
non-encoded strings are provided to ovirt SDK
to prevent the mentioned issue.

Change-Id: I8e62a650ebae974017e17342ec17aa61ba67eed9
2021-04-08 15:02:51 +10:00
Dmitry Tantsur ba72e8202b Remove mentions of the iSCSI deploy
Change-Id: I1a8a5719ab8bf6dc5cc4d2f41d23c3ea260ee307
2021-03-19 17:40:48 +01:00
Riccardo Pittau 118ac73ebc Use unittest.mock instead of mock
We support only Python 3.6 or higher so no need to use the
standalone mock anymore.

Change-Id: I2bd0582d40ea17e2299007ce99d62b38862944e5
2020-06-17 09:40:07 +02:00
Zuul 924d2ca9e6 Merge "oVirt driver: Close connection after each API call" 2020-05-15 15:10:52 +00:00
Steve Baker 343a57570e oVirt driver: Close connection after each API call
Currently a new connection is created for every API call which is
never closed. This results in open connections accumulating over time
due to periodic calls like power state polling, which is further
compounded by the number of ovirt nodes deployed.

This change converts _getvm into a generator based context manager so
that the connection can be closed after every call.

Change-Id: I30f9695c591f72dae21467b0b31f6f67fad7cc8a
2020-05-15 10:01:11 +12:00
Riccardo Pittau 40bed1ea88 Make flake8 tests more strict
Also increasing min version of flake8-import-order for some bug fixes.

Change-Id: I6cca85a87e2946998bb2e912aa44bd3d709562c4
2020-04-08 10:11:48 +02:00
Riccardo Pittau ec13cbad48 Bump hacking to 3.0.0
Change-Id: I6979eacbb9b4d062d7f0fb8228dbef6b97da416e
2020-03-31 10:15:18 +02:00
Riccardo Pittau 2f77c3095e Follow up of stop using six library
Change-Id: I5fcd5babbadfb075cbc85bf4f9e18fdeddbce44a
Follow-Up: https://review.opendev.org/697059
2019-12-05 00:59:19 +01:00
Riccardo Pittau a2c976077a Stop using six library
Since we've dropped support for Python 2.7, it's time to look at
the bright future that Python 3.x will bring and stop forcing
compatibility with older versions.
This patch removes the six library from requirements, not
looking back.

Change-Id: I41ef2d06dcdfe2fb3fd47fe877149ec9a29e37fb
2019-12-03 12:16:17 +01:00
Ilya Etingof 935ec1ac69 Fix pycurl args types in ovirt driver
Ensure passing text-typed parameters to `ovirtsdk4` calls. Otherwise
`ovirtsdk4` blows up Python 3.

This change prompts `six` version bump.

Change-Id: I3bbbb6b786d7007e0dd0a45de1b21be909ee588b
Story: 2006170
Task: 35681
2019-07-08 15:25:33 +02:00
Riccardo Pittau db90e457c5 Remove enabled_drivers from tests
The enabled_drivers option has been removed since a while, this
patch replace the latest 2 entries in a unit test with
enabled_hardware_types

Change-Id: I8432eb58c44ebbcaccffa801e3bc5b791e37c84b
2019-07-03 09:58:16 +02:00
Riccardo Pittau 8c4df14a88 Fixing typo in message format
Fixing a typo in an exception message.
Found during removal of Python 3.5 test in favor of
Python 3.7 in https://review.opendev.org/654641

Change-Id: I23feb09697229de74f6522a0d8cb9ab2a53428ca
2019-04-26 10:44:53 +02:00
Zuul 611b44863b Merge "WOL driver - include POWER_OFF in supported power states" 2019-03-25 12:54:34 +00:00
Oliver Walsh 88e85766c6 WOL driver - include POWER_OFF in supported power states
The WakeOnLanPower class is designed to POWER_ON using WOL and log
REBOOT/POWER_OFF operations as they require manual intervention.

However the POWER_OFF state was mistakenly omitted from
get_supported_power_states, which results in an error instead of a log entry.
Introspection on tripleo fails as a result of this.

Story: #2005292
Task: #30162
Change-Id: I34ee6da8600d6e6107f00732bf1c34c5b745b333
2019-03-25 11:45:18 +00:00
Dmitry Tantsur 58fe0fe457 Add noop management to iBOOT and WOL hardware types
The classic drivers had management=None, so no management actions
were tried. The hardware types have management=fake, which does not
support local boot. This ends up in a serious feature regression.

The intended behavior is to use static boot management, which is what
the noop management is about, so use it.

Change-Id: Id46e2747facabda922e1544fa59e90fb31a04a62
2018-10-24 15:30:59 +02:00
Dmitry Tantsur 15282776b1 Do not use deprecated async parameter for passthru
Change-Id: I3544b6b5bc56e4d27614397a98a7f17b72db6e00
2018-08-09 17:35:47 +02:00
Dmitry Tantsur f3c9cab07f Remove classic drivers
Support for them was removed from ironic, so we have to remove them.

Change-Id: I27c61a01184b1d5435e05efa3c65eae90c9d3b34
2018-07-23 15:34:12 +02:00
Zuul 09e4707b61 Merge "pep8 ovirt classes, added copyright statement to ovirt files" 2018-05-18 09:14:04 +00:00
Dmitry Tantsur 91601c9704 Stop using mgr_utils.mock_the_extension_manager
It is not needed in most cases, but was blindly cargo-culted everywhere.
It will be removed with the switch to hardware types.

Change-Id: I1de6be6ab8b0c210f457fa0c1cd685c42406b888
2018-05-17 17:56:22 +02:00
Zuul 0e1be8bb81 Merge "reboot stopped vms in ovirt" 2018-04-18 16:19:35 +00:00
Zuul 61daf427e5 Merge "Convert ovirt url to a str" 2018-04-17 11:32:31 +00:00
Derek Higgins b7a5234057 Convert ovirt url to a str
Older versions if pyculr.Curl.setopt don't accept unicode
string values.

Change-Id: I4fca91228435a1a652b98db69aa2a92ffbaa47e7
Closes-Bug: #1761724
2018-04-17 10:52:12 +01:00
Ilya Etingof 62c7c14f77 pep8 ovirt classes, added copyright statement to ovirt files
Change-Id: Ibc25a574e9f0572d62d86dc0df0cbeef6eb7e93c
2018-04-16 15:06:00 +02:00
karmab cd648ffd8e reboot stopped vms in ovirt
When using ovirt driver,
make sure reboot starts stopped vms

Closes-Bug: #1752575
Story: 1752575

Change-Id: I851935a042c3e69e7e4ce72d6338ce2f77baa566
Signed-off-by: karmab <karimboumedhel@gmail.com>
2018-04-16 15:02:40 +02:00
Ilya Etingof 3265d0002b fix pep8 w503 warning
This started to break the pep8 CI job lately.

Change-Id: I8bf22c4944d272ed31a3281fa6ef4ca087a13ae9
2018-04-16 13:47:58 +02:00
Julia Kreger 2ccc0475ba Fix ovirt property error logging
Change-Id: I9bbbc76854e30ccaac8674b737cde237729c7c1f
2018-03-12 23:09:00 +00:00
Ruby Loo e7d1bf3206 Handle 'timeout' parameter in power methods
The PowerInterface methods set_power_state() and reboot() were enhanced
to take a 'timeout' parameter [1].

In the Queens release [2] , the conductor assumes that all PowerInterfaces
can support this timeout parameter. This patch changes the PowerInterfaces
so that they accept a 'timeout' parameter for reboot() and set_power_state().
The PowerInterfaces log a warning if the parameter is specified when it isn't
supported.

[1] f15d5b9a37260b3876f9dadeb030412e6e1053b2
[2] 9e87cebc12102cbb3ae47366836dcd7c3e439828

Change-Id: I0904958f1a7f981204ba41bfbdc0083182c5622e
2018-02-07 18:26:08 -05:00
Pavlo Shchelokovskyy 725b85484f Remove Ansible-deploy interface
it is now part of ironic itself, and version in ironic-staging-drivers
conflicts with version in ironic, blocking ironic-conductor from
starting when ironic-staging-drivers is installed.

Change-Id: I917b7399b3249143ba6cf75f61d96a1c64f94e7d
2017-12-18 14:55:35 +02:00
karimb 9a0935129d Ovirt support
This patch introduces new type of power and management drivers for ovirt vms.

Change-Id: Iebf31db70dfd800d47399c69d7b2255467a87a1d
Closes-Bug: #1564841
2017-11-15 12:20:04 +01:00
Zuul f43415c8fd Merge "[ansible] Fix grub install for Ansible 2.4" 2017-11-01 03:41:48 +00:00
Pavlo Shchelokovskyy 25ad8e6926 [ansible] Fix grub install for Ansible 2.4
this is a followup to Id2bfd1ed552ed566b14f6ac5b222c011ff918bee

while adapting playbooks for Ansible 2.4 compatibility,
this place was missed, and playbooks tried to install grub
to a wrong device.

This patch re-uses the "ironic_root_device" fact set during discovery
as grub install target.

Change-Id: Ibfd885b4702ff86c802a8d184ebb406aae9262b5
2017-10-18 06:15:14 +00:00
Pavlo Shchelokovskyy 0e21965a8f Do not monkey-patch in ansible unit tests
some unit tests for ansible deploy interface were using
dumb monkeypatch instead of proper mocking.

Change-Id: I317e1b8e9f0ec4cb792ee09ce592cbd83f956b75
2017-10-14 13:40:44 +03:00
Jenkins c1f3560a38 Merge "[ansible] fix wwn facts and root device hints" 2017-09-27 05:46:56 +00:00
Jenkins 3c4f3ccf17 Merge "[ansible] fixes for Anible 2.4 compat" 2017-09-26 19:16:54 +00:00
Pavlo Shchelokovskyy 6392125993 [ansible] fix wwn facts and root device hints
Apparently only checking that pyudev is importable is not enough,
as it can fail later if udev itself is not available on the system

Also bring the (empty) default between these two to be empty dict,
and fix logging invocations in WWN fact collecting module.

Change-Id: I137990280e90c9ca2687b38d98f6c5343e26e8d0
2017-09-26 08:54:21 +00:00
Pavlo Shchelokovskyy 0719dafc2f [ansible] fixes for Anible 2.4 compat
- fix callback plugin (add a new public methdod)
- ansible_devices fact now contains many more devices
  (at least with tinyipa ramdisk and virtual HW),
  so by default we now attempt to use only devices that
  have non-empty 'host' attribute, and thus are
  real block devices on some controller
  (not memory-mapped files, loop devices etc)

  + during provisioning, the default target for image
    when root device hints are absent will be the first such device
  + during cleaning, only such devices will be attempted to
    be cleaned

Change-Id: Id2bfd1ed552ed566b14f6ac5b222c011ff918bee
Closes-Bug: #1718361
2017-09-26 08:53:08 +00:00
Pavlo Shchelokovskyy 7cbb03074d Deprecate classic drivers
this patch deprecates classic drivers defined by ironic_staging_drivers
package in favor of hardware types.
A proper warning is shown on classic drivers init.
DevStack plugin no longer enables any classic driver from staging
drivers, and only hardware types are tested.

Change-Id: Ic53b71c94287804f3c66f5e9a6249f605c234211
2017-09-26 08:49:33 +00:00
Pavlo Shchelokovskyy 0cdc53948f [ansible] configure SSL validation
This patch adds a number of configration options and playbook variables
that govern SSL validation and authentication when accessing the image
store to download the image and configdrive from the deploy ramdisk.

Most of them are not yet used in the default set of playbooks provided
with the driver
(for example some of them require yet unreleased Ansible 2.4),
however they can be used by custom playbooks, for example to upload
and enable those custom CA bundle and cert files to the ramdisk at
deploy time.

This patch also sets DevStack to disable validation of image store SSL
certificate by ansible deploy interface (similar to how IPA is currently
confugured).

This patch also caps Anisble < 2.4, since our custom callback plugin
has troubles with the newest Ansible 2.4 version (to be fixed later).

Change-Id: Id40f1067361cc32e98973c70fc5cd3d4242308d0
Closes-Bug: #1717858
2017-09-25 10:48:24 +00:00
Yuriy Zveryanskyy c1d9f44dbd Add hardware types
Classic drivers will be deprecated, add hardware types for
staging drivers. "staging-" prefix used for entrypoints.

The DevStack plugin is amended to enable all hardware types and
interfaces registered by the ironic-staging-driver package
to test that they do not break ironic-conductor start when enabled
For this a new script is added to read entrypoints registered by a Python
package.
As previousely, by default `iboot` drivers are not enabled
as they require a client library not available on PyPI.

Change-Id: I26541adc9b99f7a436be0e3f8ef31c0ff64ff5d4
2017-08-31 11:34:40 +00:00
Pavlo Shchelokovskyy 47d5e7a7b9 [ansible] add journald and syslog loggers
since DevStack is now using systemd, we can leverage that when setting
up callback_plugin used by Ansible started by ansble-deploy driver.

This patch adds two more options to the ironic_log callback plugin
configuration file - use_journal and use_syslog.
When set, they will override respective values from ironic config.

The callback plugin config is set to force usage of journald by default
in the devstack plugin.

Change-Id: I5c788dd6621c95a28aecc727a3988ad4f101b2a8
2017-07-10 12:26:12 +00:00
Pavlo Shchelokovskyy 6e415c3284 Remove pxe_ssh_ansible driver
SSH-based power and management interfaces are unsupported and about to
be removed from ironic.

Change-Id: I0d00fbabb7402ef96bb26a68b64d04ae3231a5d5
Related-Bug: #1570301
2017-07-08 19:39:26 +03:00
Jenkins 090ce16c79 Merge "Remove usage of parameter enforce_type" 2017-07-03 17:48:32 +00:00
Jenkins 65f1f87040 Merge "Remove translation of log messages" 2017-07-03 17:48:27 +00:00
Ngo Quoc Cuong 722459abb3 Remove translation of log messages
The i18n team has decided not to translate the logs because it
seems like it not very useful; operators prefer to have them in
English so that they can search for those strings on the internet.

Change-Id: Ifcb4c4331440d94322a56a1e3bed04cff453cbad
Related-Bug: #1674374
2017-06-27 23:07:31 -04:00
Pavlo Shchelokovskyy f6736f563e [ansible] Fix nits in ironic_parted module
this is a followup to I4d6d7619c6f3ba25c29263ffe5d778698e598429
([ansible] Improve partition images support)

fixes some typos and removes commented/unused code.

Change-Id: Iafda13a657956bc04b591c0911cf3338705f33c4
2017-06-23 08:18:46 +00:00
Pavlo Shchelokovskyy b4fc5fae01 [ansible] re-write grub install as ansible tasks
remove install-grub.sh script in favor of proper ansible tasks

Change-Id: I74ef330bcefdf0a88df7572cb0cbcf2ba07d3dc8
2017-06-23 08:18:46 +00:00
Pavlo Shchelokovskyy 0800a24d5f [ansible] Add more thorough disk metadata cleanup
If disks are not being shred completely, some partitioning metadata
that was stored in the headers of partitions themselves can still
survive partition table data cleanup, and later can interfere with new
partitioning scheme on nodes when new partition sizes are the same but
their metadata (for example boot flag) is changed.

This patch adds a set of tasks that will wipe a small amount of blocks
(1024 by default) before and after partition boundatries to make sure
those will not be re-read.

Change-Id: I251d77be24ab6052d3f1f8cb5af68d477cf1f270
Co-Authored-By: Ihor Pukha <ipukha@mirantis.com>
2017-06-23 08:18:46 +00:00
Yuriy Zveryanskyy 84b1b0d34e [ansible] Add basic root device hints support
This patch adds support for Ironic root hints to ansible deploy driver.

The advanced root hints based on oslo.utils operators are not supported yet,
only exact matches.

Change-Id: I6fd468cfa9a7792fa0e55aa58c337396e13d76ee
2017-06-16 19:25:58 +00:00