Commit Graph

651 Commits

Author SHA1 Message Date
Zhenguo Niu
bc1d71f086 Deprecate root_device_hint name for raid_device plugin
Change-Id: I4da2d156007ec320e3399d0bb2bb02d039b3724b
Closes-Bug: #1528830
2016-03-09 00:04:41 +08:00
Dmitry Tantsur
59e0f92ae3 [devstack] Improve virtual machines logs
Change the default introspection ramdisk kernel cmdline:
* Set ipa-debug=1 to enable IPA debug logging
* Set "vga=normal console=tty0 console=ttyS0" to get some actual logs saved
  and visible through virsh.

Change-Id: Ib049d99a096ad626d3fcf8094f5e358d5b91ff92
Closes-Bug: #1549836
2016-03-01 15:15:43 +00:00
Jenkins
e03cbe8c8b Merge "Add enroll_node_not_found hook" 2016-03-01 14:09:20 +00:00
Jenkins
53c35389bb Merge "Add invert option to rule conditions" 2016-03-01 12:51:10 +00:00
Jenkins
54f368ef97 Merge "Stop storing ramdisk logs with the introspection data" 2016-03-01 12:28:28 +00:00
Anton Arefiev
5086d93b41 Add enroll_node_not_found hook
Add new node_not_found_hook - enroll_node_not_found hook,
which allows to enroll unknown nodes to Ironic automatically.

Change-Id: If1528688504e4be4b2369b985bc576544d96868d
Related-Bug: #1524753
2016-03-01 14:00:31 +02:00
Anton Arefiev
8a0b5149f3 Logging configuration options at startup
This patch adds logging all configurations options on DEBUG level,
once at service startup.

Change-Id: Id700198284a4140850338d2722f434b3dd2baef8
2016-03-01 09:56:10 +00:00
Dmitry Tantsur
b5fd510db4 Add invert option to rule conditions
Some conditions do not have a native counterparts, so we need a way
to invert them (aka NOT operation). This patch adds a new generic
parameter "invert", defaulting to False.

Change-Id: I50342689ba52346a5a4fbf362536b629fc688986
2016-02-29 13:48:55 +01:00
OpenStack Proposal Bot
bbe44d2170 Updated from global requirements
Change-Id: Ibe7e77f18234a7266b155a41b68a9cb67a8c8a7f
2016-02-26 01:48:10 +00:00
OpenStack Proposal Bot
f6c60eb428 Updated from global requirements
Change-Id: I77f46a508cf2acc509acbe2a8ab49eabf24b6d7b
2016-02-24 08:32:23 +00:00
Jenkins
cc0c7bd77c Merge "Add new condition: is-empty" 2016-02-23 13:31:18 +00:00
Dmitry Tantsur
d8de403851 Fix gate broken by sudden remove of SERVICE_TENANT_NAME variable
Change-Id: If90a810a5fb96bac2a581fd57e9bff0b9e7911f6
Depends-On: Icd03119788d17de221293bce4c0d628df42fdb9b
2016-02-23 11:13:55 +01:00
Jenkins
03b690d48c Merge "Extend conditions and actions" 2016-02-22 12:44:29 +00:00
Anton Arefiev
061d839a26 Add new condition: is-empty
Now, if operators want to check some attribute isn't specified,
they should use 'eq' condition with None, '', etc values:

    {'op': 'eq', 'field': 'inventory.bmc_addres', 'value': ''}

It would be useful to have condition plugin witch verify this case,
'is-empty' checks that field is empty string, list, dict or None value:

    {'op': 'is-empty', 'field': 'inventory.bmc_addres'}

Change-Id: I6596a067e769530092c3db34405e0f0917d2f052
2016-02-22 14:21:09 +02:00
OpenStack Proposal Bot
a181378acf Updated from global requirements
Change-Id: Ia82539cbf3321739a7e151bedd3450b5e8a3b802
2016-02-20 21:55:41 +00:00
Jenkins
ec4ee41754 Merge "Small ValidateInterfacesHook cleanup" 2016-02-19 16:12:27 +00:00
Jenkins
b90c49de5d Merge "Drop rollback actions for set-XX and extend-XX rules actions" 2016-02-19 10:43:25 +00:00
Anton Arefiev
bf86545ca4 Extend conditions and actions
Conditions: ``field`` supports new format, it allow to comparison
data both from inspection and node info:

     {'field': 'node://ironic/style/path', 'op': 'eq', 'value': 'val'}
     {'field': 'data://introspection/path', 'op': 'eq', 'value': 'val'}

Actions: ``value`` supports fetching data from introspection, it's
using python string formatting notation:

     {'action': 'set-attribute', 'path': '/driver_info/ipmi_address',
      'value': '{data[inventory][bmc_address]}'}

Related-Bug: #1524753
Change-Id: Ie05f82e7a29fba2f743217f0893c085fd843cd5b
2016-02-17 19:07:30 +02:00
Anton Arefiev
ea93510cef Small ValidateInterfacesHook cleanup
- move all interface validation  checks to _validate_interfaces
  method;
- remove redundant args.

Change-Id: I06a269c1694cdc91bf3a85a78037dfea094c5187
2016-02-17 11:53:51 +02:00
Jenkins
458610547d Merge "Expand instructions for DNS on Ubuntu" 2016-02-16 17:57:35 +00:00
Dmitry Tantsur
31f7a5ada6 Drop rollback actions for set-XX and extend-XX rules actions
Rollback actions were designed to help with rerunning introspection
on the same node. However, rollback actions for these actions proved
to be confusing and were never properly documented at all.
Even worse, the rollback action for set-attribute actually makes
this command impossible to use with non-removable attributes
(e.g. /driver).

This change removes rollback actions from all rules.
We need to rethink how we handle rollback in rules later on.

Change-Id: I2260f4b463c5dc804edac642c86e0da153e163f6
2016-02-16 11:12:23 +01:00
Dmitry Tantsur
f56bf0c8c2 Do not set Swift parameters defaults in keyword arguments
The configuration values are not initialized at the moment of import,
so it has no effect. The only reason we didn't hit it is due to helper
functions overriding the arguments. But extra_hardware plugin does not work.

Change-Id: If23bbdc4162589707cd63e6446a92036436b7f2a
Closes-Bug: #1544613
2016-02-12 10:11:49 +01:00
Dmitry Tantsur
e86cec3b07 Stop storing ramdisk logs with the introspection data
Ramdisk logs are huge (and may potentially be VERY huge) and clutter the output
for 'introspection data save'. They might even potentially expose unwanted
information to a user.

Change-Id: I0e7f1f647e60711f84d7883caab5ce8b14d6184f
2016-02-11 16:18:57 +01:00
Pavlo Shchelokovskyy
b49021bc14 Expand instructions for DNS on Ubuntu
Add paragraph on how to set resolvconf on Ubuntu 14.04 to not break when
installing ironic-inspector.

Change-Id: I9549700c6cfdfb31cc348d6502741a927f60814a
2016-02-11 17:04:35 +02:00
dparalen
61d0b85ed6 Always generate fresh uuid in test cases
not doing so introduces implicit (ordering) dependency issues between test
cases. For instance, in python client functional test[1] renaming
`TestSimplePythonAPI.test_introspect_get_status` to
`TestSimplePythonAPI.test_01_introspect_get_status` makes
`TestSimplePythonAPI.test_api_version` fail.

Notes:
I use this command to check for the cases where fixed uuids are being used:
  `git grep -En "\<[^\s,\.(]*uuid[^\s,\.]*\s*=\s*['\"]"`

Links:
[1] https://github.com/openstack/python-ironic-inspector-client/blob/
            master/ironic_inspector_client/test/functional.py#L137

Change-Id: Icd4a2a25824c6372d10fc40d67d8f275016b201c
2016-02-11 13:05:53 +01:00
Jenkins
003a321566 Merge "Clean up documentation on introspection rules conditions" 2016-02-11 10:29:19 +00:00
Jenkins
8a6936773a Merge "Remove deprecated support for passing patches lists into hooks" 2016-02-11 10:29:14 +00:00
Jenkins
43907d4b4c Merge "Do not update firewall rules if list of MAC's did not change" 2016-02-11 10:27:51 +00:00
OpenStack Proposal Bot
11899a191f Updated from global requirements
Change-Id: I7bc1b750a3b8de42704df9e46515767239ee80eb
2016-02-11 07:39:50 +00:00
Jenkins
e2eb6bed5e Merge "Add forward slash for node path patch" 2016-02-10 16:08:28 +00:00
Jenkins
f225627ff1 Merge "Update example.conf" 2016-02-10 10:06:08 +00:00
Anton Arefiev
17274a613f Add forward slash for node path patch
Ironic cli allow to patch attributes w/o forward slash
at the beginning:
    ironic node-update <node_id> add 'driver_info/attr'='my_attr'
Inspector fails if driver info in rules provided in same manner,
this change add head forward slash to path if it's missing.

Closes-Bug: #1529809
Change-Id: I4423184e15d5779c59a903b50554db0550ba3d83
2016-02-10 10:59:02 +02:00
Jenkins
c519254291 Merge "Remove "ramdisk" mentioning in func test contrib" 2016-02-09 18:07:04 +00:00
Anton Arefiev
7cbbd2d1fd Remove "ramdisk" mentioning in func test contrib
Functional tests don't rely on ramdisk anymore, so remove it's
mentioning from contribution guide.

Change-Id: I22d7574cc43080dbdb99315565c6bd316cd04f85
2016-02-09 18:44:24 +02:00
dparalen
7a3d93700e Introduce API for aborting introspection
It is not currently possible to stop a running introspection.  This
may be annoying for the operator, considering the amount of time it
takes for the bare metal node to call the continue API request,
especially knowing the introspection will fail/time-out eventually
(such as when debugging).

This patch introduces a REST API endpoint "POST
/v1/introspection/<node-UUID>/abort" in order to fill the gap.  Upon the
abort method call, following preconditions are checked:

* there's a bare metal node matching the UUID
* introspection was not finished for the node
* introspection process is waiting for the node to give the continue call

Following Responses are returned to the caller in case the
preconditions were not met:

* 404 Response in case node wasn't found
* 409 Response (resource busy) in case the introspection process is not
      waiting for the Continue call

Otherwise, a 202 Response is returned.

When the abort method is processed, the node is powered off and it is
black-listed in inspector's firewall to prevent it from booting the
introspection image. This happens asynchronously.

To prevent interference with the continue call processing, the
processing method was updated to give a 400 Response to the
introspection client in case continuing a finished or canceled
introspection.

Limitations:
* IMPI credentials are never updated in case introspection was canceled
* 202 response is returned even if the introspection was already finished
* the endpoint differs from requested "DELETE
  /v1/introspection/<node-UUID>"

Links:
[1] https://bugs.launchpad.net/ironic-inspector/+bug/1525235

Change-Id: If043171f0d292ae2775dc1f26233dd4911599247
Closes-Bug: #1525235
2016-02-09 15:30:46 +01:00
Dmitry Tantsur
daa20e21fb Do not update firewall rules if list of MAC's did not change
Currently we issue a lot of iptables requests in vain. Change firewall
handling logic to cache last known set of MAC's to black list.
If the current list matches the previous one, do not update rules.

Change-Id: I135d7f3b18dd6ea17058fe23a7fa7e58a45c2270
Closes-Bug: #1543516
2016-02-09 15:04:53 +01:00
Anton Arefiev
88bac30992 Update example.conf
Change-Id: I478f1a63a84de2ece34a5d5f391e5017226b93e6
2016-02-09 14:47:30 +02:00
Dmitry Tantsur
cc422c0a5e Remove deprecated support for passing patches lists into hooks
Long time ago we had an idea of batching node updates. However,
it fails miserably when a plugin or an introspection rule has to inspect
existing node properties, because it receives possibly stale values.
We've deprecated support for batching patches back in Liberty, this
patch removes the associated bits from the hook interface.

Change-Id: Ia482ff50ca276ce1ffec631f016c6a6b54d5a4ab
Closes-Bug: #1506348
2016-02-09 12:36:07 +01:00
Jenkins
dd369ead89 Merge "[devstack] Use the coreos builder for the source build of the ramdisk" 2016-02-04 15:19:33 +00:00
Jenkins
b925717b06 Merge "Register the keystone service and endpoint in the devstack plugin" 2016-02-03 16:41:06 +00:00
Jenkins
ade97c9700 Merge "Enable Keystone v3 endpoints for Inspector" 2016-02-03 12:01:43 +00:00
Dmitry Tantsur
c926e1e36f [devstack] Use the coreos builder for the source build of the ramdisk
The source builder in DIB has been broken for a while now, and anyway
we have to use the CoreOS builder to create an IPA+inspector gate:
I5631866edee42d5358f692e4fbcd82f1a6a1d4db.

We can provide DIB as an option again as soon as it's fixed.

Change-Id: I9a53c3bedd4106a4b03647209ea2a49efa4b2a47
2016-02-03 12:47:23 +01:00
Sam Betts
40c17e30fc Enable Keystone v3 endpoints for Inspector
Change-Id: Iaa6d1b9dcca401987ac5f8ccc37e337736905b92
Closes-Bug: #1531236
2016-02-02 16:11:27 +00:00
Dmitry Tantsur
7ee29da29c Register the keystone service and endpoint in the devstack plugin
The name is "baremetal-introspection", the same as in puppet-ironic:
https://github.com/openstack/puppet-ironic/blob/master/manifests/keystone/auth_inspector.pp

Change-Id: Ib22c758f70cf6403e5d8b400af4df62caba9dece
Related-Bug: #1391865
2016-02-02 16:52:39 +01:00
Dmitry Tantsur
800dedc142 Clean up documentation on introspection rules conditions
A follow-up to commit d6ff54faf7.

Change-Id: Iff1a9b342b9c34debff5465e6f27500a20809f54
2016-02-02 14:42:58 +01:00
Jenkins
5e84b68ce5 Merge "Add new conditions: matches and contains" 2016-02-02 13:36:15 +00:00
Jenkins
45986b2dbe Merge "Use new introspection data save command in exercise.sh" 2016-02-02 11:01:29 +00:00
Jenkins
bd007ab6a3 Merge "Set timeout in gate to 10 minutes" 2016-02-02 10:21:12 +00:00
OpenStack Proposal Bot
c5a2dd6478 Updated from global requirements
Change-Id: I52f9690051f2e08557993bf844772599d7e6e8ec
2016-02-01 22:42:53 +00:00
Andreas Jaeger
b28f1a75b7 Update translation setup
Follow new infra setup for translations, see spec
http://specs.openstack.org/openstack-infra/infra-specs/specs/translation_setup.html
for full details.

This basically renames
ironic-inspector/locale/ironic-inspector.pot to
ironic_inspector/locale/ironic_inspector.pot. For this we need to update
setup.cfg. Also fix some errors for translation setup in setup.cfg

Update also domain name in i18n.py.

The project has no translations currently, let's remove the outdated
pot file, the updated scripts work without them. So, we can just
delete the file and once there are translations, an updated pot file
together with translations can be imported automatically.

Change-Id: I1f9e3777a68d09406eeee836d03f15cbfe568470
2016-01-29 09:34:46 +01:00