330 Commits

Author SHA1 Message Date
Ghe Rivero
10a3a800e7 Use oslo_log lib
Module 'log' from oslo-incubator was removed after release of oslo_log
library.

Change-Id: Ia00e26071fc0cab4fd3f3334ca94860bc7b1c75c
2015-03-24 08:43:35 +01:00
Jenkins
173f86963a Merge "Add cleaning/zapping support to IPA" 2015-03-20 23:19:54 +00:00
Jay Faulkner
a17c824288 Add fallback secure erase using shred
This prevents devices from failing cleaning if they don't support ATA
security erase. Instead, the device will be erased by overwriting using
GNU shred.

Change-Id: Ie4f88b97c8c34efe2397538662622abd0b963aea
2015-03-18 14:57:28 -07:00
Josh Gachnang
5f4fa7f27e Add cleaning/zapping support to IPA
This will add support for in band cleaning operations to IPA and
replace the decom API that was unused.

Adds API support for get_clean_steps, which returns a list of
supported clean steps for the node, execute_clean_step, to execute
one of the steps returned by get_clean_steps.

Adds versioning and naming for hardware managers, so if a new hardware
manager version is deployed in the middle of cleaning/zapping, the
cleaning/zapping will be restarted to avoid incompatabilities.

blueprint implement-cleaning-states
blueprint inband-raid-configuration
blueprint implement-zaping-states
Depends-On: Ia2500ed5afb72058b4c5e8f41307169381cbce48
Change-Id: I750b80b9bf98b3ddc5643bb4c14a67d2052239af
2015-03-17 17:07:04 -07:00
Jenkins
1287b9ce4f Merge "Add dispatch to all managers" 2015-03-13 21:09:22 +00:00
Lucas Alvares Gomes
5a529ca489 Add support for root device hints
This patch add support for root device hints on IPA. Instead of picking
the first disk >= 4G, if the hints are specified IPA will look at it
to decide which device it should pick for the deployment. The initial
patch supports the following hints: Size, model, WWN, serial, vendor.

Implements: blueprint ipa-as-default-ramdisk
Implements: blueprint root-device-hints
Change-Id: I2b00b3fb3b61001033750dd8951f9353d6f2e361
2015-03-13 10:42:12 +00:00
Josh Gachnang
3e6b57a8bc Add dispatch to all managers
This allows the agent to call a method on all hardware managers
that support the hardware and return a list of their responses. This
will be useful for implementing get_clean_steps() in cleaning.

Also fixes a leaky test in dispatch_to_managers. The function
wrapper was holding global state, which leaked into other tests
if a function was called again later, messing up the call count.

Implements blueprint implement-cleaning-states
Change-Id: I76bf8ec18df1dc16c4b9d942800b8a1efcde9e65
2015-03-12 15:16:02 -07:00
Clif Houck
b4cc3050db Added support for secure erase enhanced
Added support for secure erase enhanced option when doing an ATA secure erase.

Also made it prefer the enhanced version if hdparm claims the device
supports it.

Change-Id: I2ce04d0b967d6c176acd40ea10a05bcab5dbf2d0
2015-02-06 17:27:51 -06:00
Jay Faulkner
2bbec5770c Allow use of multiple simultaneous HW managers
Currently we pick the most specific manager and use it. Instead, call
each method on each hardware manager in priority order, and consider the
call successful if the method exists and doesn't throw
IncompatibleHardwareMethodError.

This is an API breaking change for anyone with out-of-tree
HardwareManagers.

Closes-bug: 1408469
Change-Id: I30c65c9259acd4f200cb554e7d688344b7486a58
2015-01-08 15:15:13 -08:00
Jim Rollenhagen
bf0129d81b Remove /mnt/sys support
This code was here to allow IPA to be ran inside a docker container
with /sys bind-mounted in to /mnt/sys. IPA no longer can run inside
a docker container anyway, so remove this.

Change-Id: Ia6a9c2e49870b7a74087e3fed2fc42d5b8b6b81c
Closes-Bug: #1404362
2014-12-19 11:49:10 -08:00
Jay Faulkner
39819644e5 Add support for psutil v1 as well as v2
Openstack global requirements updated to specify version 1 only, and we
only supported version 2.

Change-Id: Iee97e4b14cae00238028ef936d2f96fbc8e2604c
2014-07-29 13:43:54 -07:00
Josh Gachnang
83782018f7 Improve Disk Detection
The previous implementation of list_block_devices used blockdev,
which would list partitions, software RAID and other devices as block devices.
By switching to lsblk, the agent can filter down to only physical block
devices, which is all the agent cares about for any of its operations.

This change adds two new fields to the BlockDevice class: model, a string of
the block devices reported model, and rotational, a boolean representing a
spinning disk (True) or a solid state disk (False). This data can be useful
for vendor hardware managers.

Change-Id: I385c3bb378c2c49385bca14a1d7efa074933becf
Closes-Bug: 1344351
2014-07-18 17:42:23 -07:00
Ellen Hui
5e1aa0a8f8 Fix no IP on interface error
Finding an IPv4 address to advertise fails and crashes if the
interface exists but has no valid IPs.  This can be fixed by
adding KeyError to the exceptions caught.

Change-Id: I60204427ec5201696d02c5c26f4b43a00d794413
Closes-Bug: #1342448
2014-07-16 00:35:28 +00:00
Jenkins
102c86e45a Merge "Fix HardwareManager loading order bug" 2014-06-16 20:44:10 +00:00
Russell Haering
5d5d443d16 Fix HardwareManager loading order bug
The agent attempts to sort the HardwareManager implementations found
by stevedore in order of suitability. This patch fixes a bug in the
sorting order that caused the GenericHardwareManager to always be
loaded.

Fixes bug 1327923

Change-Id: I1cc20e5351a704325f0cf41dab205c9164799f6a
2014-06-16 11:14:32 -07:00
Ellen Hui
b4f1a0b2d3 Tries to advertise valid default IP
During the first heartbeat, the heartbeater asks the agent to check
its advertised address; if the advertised IP is still the default
(None), the agent tries to replace it with the IP of the first network
interface it finds.  If it fails to find either a network interface or
an IP address, the agent raises an exception.

Change-Id: I6d435d39e99ed0ff5c8b4883b6aa0b356f6cb4ae
Closes-Bug: #1309110
2014-06-10 20:54:34 +00:00
Russell Haering
dff46583d3 Add a HardwareManager method to erase devices
Add erase_devices method to the HardwareManager class. By default this
method iterates block devices, and calls a new abstract
erase_block_device method for each device. This patch includes a
simple implementation of erase_block_device on the
GenericHardwareManager which attempts to issue an ATA secure erase on
supported devices.

Change-Id: I81da065395b8785f636f1b0a0d60c9f1c045441e
2014-06-06 10:27:53 -07:00
Russell Haering
8fd76c877b Add missing methods to base HardwareManager class
The HardwareManager class was missing a few abstract method
declarations which it is expected to have. Add those.

Change-Id: I1d07b7f08a4fc23929bc09f65b897fdfa0da1770
2014-06-04 10:51:03 -07:00
Alexander Gordeev
ed4460990e Make encoding.serialize() more programmatical
Introduce `serializable_fields` to express which class attributes
to be serialized.

Get rid of OrderedDict. Just replacing it with regular dict.

Change-Id: I3f7639dab171d3d62e92d0d1bb6d7b071cf963ad
2014-05-06 18:02:45 +04:00
Jenkins
2ceb2f5886 Merge "Added metaclass statement" 2014-04-15 16:52:49 +00:00
Vladimir Kozhukalov
beb135f102 Added metaclass statement
Added metaclass statement in base
HardwareManager class. It is necessary
in order to make it really abstract.

Change-Id: I2fa68f8cb11920d85989ba3589b4a394f17d42ae
2014-04-15 12:32:55 +04:00
Jenkins
88f06e2831 Merge "Use # instead of """ for copyright blocks" 2014-04-11 23:47:09 +00:00
Jay Faulkner
1384d79d2c Implement version 2 payload with more hw info
Bumping the payload version to two, and adding CPU, Memory, and Block
Device information to the inventory.

Added dependency on psutil for available memory and cpu_count.
Requirements line copied from global requirements

Change-Id: Ia39c85c91b1d60468667787a7978020084dc6c2a
2014-04-10 17:37:54 -07:00
Jay Faulkner
6e619f0261 Deprecate hardware._cmd in favor of utils.execute
This removes the custom function that was in place before our move to
Openstack in favor of the utils method integrated with oslo.

Change-Id: If668e53ccc97743b00c4beae39d153ee63ed015a
2014-04-10 14:26:57 -07:00
Jay Faulkner
1653c558ef Close file handle after use
The file handle for addr_info was left open, meaning we were leaking
file handles when sending system information. This ensures the handle is
closed.

Change-Id: I4b117d4f9ec32ad3f16f43632ffe9dc96da5ab7f
2014-04-10 11:06:58 -07:00
Jim Rollenhagen
3c1d52cbb1 Use # instead of """ for copyright blocks
Reformats copyright messages to be comments rather than
docstring-style blocks.

Change-Id: I4d863f53b67bb49d03bda0952b9e6179b6d23c59
2014-04-10 07:14:06 -07:00
Jay Faulkner
c121bef9f0 Compatibility fixes for Python 3.3
1) Added a py33 environment to tox
2) Updated tests to mock the correctly named builtins.open based on
python version
3) Other minor compatibility fixes

Tests for Python 3.3 will not pass due to this bug:
https://github.com/eventlet/eventlet/issues/83 among possibly others in
eventlet.

Change-Id: Ie4b512a926fa690ee77a71a89851c871ea1f6be0
2014-04-07 11:39:23 -07:00
Alex Gaynor
a3cab12393 Added PyPy env to tox.ini
Also fixes tests that were broken on PyPy.

Co-Authored-By: Jim Rollenhagen <jim@jimrollenhagen.com>
Change-Id: I2554aa844b040c4c74cbf287dccb06d816a39dbe
2014-03-28 08:26:17 -07:00
Josh Gachnang
5914e36b30 Replacing teeth/overlord with ipa/ironic 2014-03-19 16:19:52 -07:00
Josh Gachnang
b30d345c2e Renaming to IPA 2014-03-19 15:50:43 -07:00