104 Commits

Author SHA1 Message Date
Jenkins
0f7604690a Merge "[devstack] Remove bridge only if it's not OVB_PHYSICAL_BRIDGE" 2017-01-26 14:11:47 +00:00
Dmitry Tantsur
d429cd76da [devstack] Stop installing jq, we're not using it in tests any more
Change-Id: Ib040ef018b91495fd8a739d2c61b02caf7d4285d
2017-01-26 13:55:29 +01:00
Dmitry Tantsur
2de54194a0 Deprecated log_bmc_address option
We already have too many options to my taste, and this does not seem too useful:
we anyway don't log BMC address if it's empty.

I think we should provide consistent logging experience.

Change-Id: I8ae8856bdc1ff26065c626837df9edc3016737e4
2017-01-26 12:54:46 +01:00
Noam Angel
c4cbfa7723 [devstack] Remove bridge only if it's not OVB_PHYSICAL_BRIDGE
In a scenario we want to deploy DevStack with ironic inspector for real
hardware and use OVS_PHYSICAL_BRIDGE for IRONIC_INSPECTOR_INTERFACE as
well we dont need to issue interface delete.

Change-Id: I45271ddc34b5e9d542b6a1499d698503717f5f03
2017-01-25 13:00:03 +00:00
Anton Arefiev
b95c4c1f4a Devstack: don't rely on Ironic local vars
Ironic kernel/ramdisk path variables are local, so checking whether
kernel/ramdisk are downloaded by Ironic or not always fails.

As result Inspector always forced to download inspection kernel/ramdisk
even when it could use Ironic one.

Depends-On: Idf5f61eb922480af2220d6e12c7668b0c756d813
Change-Id: Ie16595bef2bbee7b2ca29b2f4582b4a94a683315
2017-01-24 11:45:28 +00:00
Noam Angel
db2402b6ff Skip brbm-inspector veth if IRONIC_IS_HARDWARE == True
In a scenario when using DevStack and ironic-inspector for real hardware
we dont need to following lines to run in "prepare_environment" function.

Change-Id: I1c1d09364db87f922b047c7fb1c50c047f1377fb
2017-01-22 06:41:08 +00:00
Anton Arefiev
2401f0cb10 Allow to configure cache clean up period
Add new option "IRONIC_INSPECTOR_CLEAN_UP_PERIOD" to devstack
plugin, which allow to configure clean up time of node cache.

The periodics.periodic_task decorator application on
main.py:periodic_clean_up and main.py:periodic_update is postponed
until after the inspector.conf file is read.

Change-Id: Ic6563990c789b1d1c3b72088860a4d13a3d57f29
Closes-Bug: #1639286
2016-11-04 17:49:41 +01:00
Anton Arefiev
31906bfec7 Tempest: add auto-discovery test
Add test, which delete pre-created baremetal vms, and discovers it
via 'enroll' not_found_hook with default configuration.

Note, test contains workaround for working on infra, as infra 'tempest'
user doesn't have access to virsh, for running node and whitelisting
firewall rules on existing node, inspector's inspect api is used.

Change-Id: Ib0ec63295a496229b27552cd1bcf7e763c0c3e03
2016-09-16 14:37:39 +03:00
Szymon Borkowski
e686892739 Add PCI devices plugin to inspector
Adds a new plugin to distinguish PCI devices returned by Ironic
Python Agent. Recognized PCI devices are then registered in node
capabilities and later can be used by nova flavors.

Change-Id: I6565b8c4aa76de240a6c4d795635300ff2d0c30b
Partial-Bug: #1580893
2016-09-01 10:55:02 +02:00
Jenkins
fb4faaad01 Merge "[devstack]Switch to pip_install_gr for inspector client" 2016-07-15 09:35:19 +00:00
Zhenguo Niu
5fcb4da558 [devstack]Switch to pip_install_gr for inspector client
Currently python-ironic-inspector-client is already in
global-requirements

Change-Id: I651ccbd22f57f0229f4137607ebf6b93fb96fdad
2016-07-15 15:23:41 +08:00
Zhenguo Niu
53f9534ece [devstack]Only cleanup tftp directory if ipxe disabled
There's no need to cleanup ironic-inspector.* if ipxe enabled

Change-Id: I07f981773441914105e006ef2133ae4cc05b1df9
2016-07-15 11:40:26 +08:00
Dmitry Tantsur
ba0075e0ea [devstack] Do not hardcode coreos ramdisk when building from source
Change-Id: Ic0b9abd58a21ff60f486da2c4d1194406ad47813
2016-07-07 12:56:51 +02:00
Dmitry Tantsur
a8cb6bf838 Use run_process in the devstack plugin
Old commands we use give us problems with grenade.

Change-Id: I12ad693870ea013d7da9ffa5e772ddd6630e7895
2016-06-29 08:15:30 +02:00
dparalen
33dea6b381 devstack/plugin.sh: use screen_stop
A custom, direct screen call is being used to stop inspector
processes.  This breaks grenade testing for me as no screen is used in
that environment.

This patch suggests adopting screen_stop instead.  See also project
devstack/functions-common:screen_stop

Change-Id: I63d0c7400ecdff4333ffc31b6607d94f8cf20e18
2016-06-21 16:11:43 +02:00
Dmitry Tantsur
0b58e31e3e Remove support for the old bash ramdisk
From now on only rely on the IPA inventory and 2 additional fields:
boot_interface and root_device.

Also updated unit tests to use one inventory example.
Also removed duplicating unit tests and checks in test_process.
Also removed devstack support for the old ramdisk.

Change-Id: Ib382328295fc2c1b9143171b1047304febadcaca
2016-06-06 13:36:05 +02:00
Pavlo Shchelokovskyy
3aebf1f3b0 Set config options for keystoneauth.
Change-Id: I671fbc666dcfc836b162addb9a77174ba279ba48
2016-03-25 13:08:22 +02:00
Jenkins
d41ca2beda Merge "[devstack] add support for using iPXE instead of plain PXE" 2016-03-17 11:25:18 +00:00
Jenkins
b14fc0f890 Merge "Add discover nodes exercise" 2016-03-16 11:07:06 +00:00
Anton Arefiev
bee7f3850f Add discover nodes exercise
Related-Bug: #1524753
Change-Id: Id6373e3a986c343b1e6786753034b19860612117
2016-03-14 15:11:50 +01:00
Dmitry Tantsur
be14aae263 [devstack] add support for using iPXE instead of plain PXE
Makes our devstack plugin respect the IRONIC_IPXE_ENABLED variable.

Partial-Bug: #1416371
Change-Id: I16c6454ba5e1339acfe302baa68e69b9a81f9a18
2016-03-10 13:11:07 +01:00
Dmitry Tantsur
2f8e105b4b Recommend using dhcp-sequential-ip in the dnsmasq configuration
Introspection naturally happens in large bulks, after which it's inactive.
Small pool for DHCP addresses means that we'll have conflicts due to how
dnsmasq distributes them by default - using hashing. This option tells dnsmasq
to allocate IP addresses sequentially instead to avoid these conflicts.
See https://bugzilla.redhat.com/show_bug.cgi?id=1301659 for detailed analysis.

The drawback of this option is that long-running clients may switch IP
addresses if their lease expires. This is not a concern for short introspection
process.

This change may obsolete the need in the delay between 2 introspections.

Change-Id: Id277f3d31902bee16d3b048dbde5c34af905f0bc
2016-03-07 13:21:42 +01: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
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
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
7477959fe1 Set timeout in gate to 10 minutes
There is no reason for it to be the default 1 hour, as working introspection
ends within 2-3 minutes on the virtual environment.

Change-Id: I9b9b868f7c30e15c0f5131d53958db28d287ca7d
2016-01-27 14:08:45 +01:00
Jenkins
b7c61dee01 Merge "Check whether agent tarball exists" 2016-01-25 16:20:46 +00:00
Yuiko Takada
cdf22878d8 Check whether agent tarball exists
Currently, when execute devstack/stack.sh,
agent tarball is downloaded every time even if
it exists already.
This patch set
* checks whether kernel/ramdisk exists
and if there are, doesn't down load them.
* checks whether ironic agent kernel/ramdisk exists
and if there are, copy them.

Change-Id: Ic546ba8fc0cc14dc7cf13433e09db35a0854d115
Closes-Bug: #1533491
2016-01-21 16:47:52 +09:00
Dmitry Tantsur
f7329d7563 Revert "Block broken diskimage-builder versions to unblock the gate"
This should land as soon as DIB 1.7.2 hits the gate.

This reverts commit 357bbcbb1f471cbeca5e9d8ba6d9731591f1290b.

Change-Id: Id9560c67f2339eb6a812c5c28b428a68b4138a79
2016-01-19 13:08:14 +00:00
Dmitry Tantsur
357bbcbb1f Block broken diskimage-builder versions to unblock the gate
Revert as soon as DIB 1.7.2 is released.

Change-Id: I02d7ff2c1c126787a0d91ac0cfa70871ee8014c6
2016-01-19 12:04:50 +01:00
Dmitry Tantsur
0423d93736 Track node identification during the whole processing
Currently our logging in processing is very inconsistent:
some log strings mention node UUID, some - node BMC IP, some nothing.
This change introduces a common prefix for all processing logs
based on as much information as possible.
Only code that actually have some context about the node (either
NodeInfo or introspection data) is updated.

Also logging BMC addresses can be disabled now.

Updates example.conf (a lot of updated comments from oslo).

Change-Id: Ib20f2acdc60bfaceed7a33467557b92857c32798
2016-01-13 12:23:15 +01:00
Dmitry Tantsur
5a5f885e3e Enable ramdisk log collection in devstack plugin and improve logging
Add info logging to actually see the resulting file name, make other
logging improvement.

Also set ironic-inspector to always store logs.

Change-Id: I75fe35a9ce564b0fd23fbe6f5027e0b576195bcd
2015-12-14 14:24:49 +01:00
Dmitry Tantsur
0533f463fd Improve debug logging
* Update default log levels
* Make iptables logging more compact by removing newlines
* Enable debug logging in devstack plugin by default

Change-Id: I2af558078cb27edb5f162372d52c048f0e659079
2015-12-14 14:19:06 +01:00
Pavlo Shchelokovskyy
8c234e3965 Auto-fill keystone_authtoken config section
Use DevStack function for that. Also create a signing cache dir
for tokens and clean it on teardown of DevStack.

Change-Id: I4890f4a31883afdfd8d5eb00f2457a7c5c211f88
Closes-Bug: #1484014
2015-12-02 18:07:18 +00:00
Jenkins
11dd9451ef Merge "Support IPA for devstack-plugin" 2015-11-05 18:01:51 +00:00
Yuiko Takada
29f29eab70 Support IPA for devstack-plugin
Change-Id: Idff4374aad1609ebfce8e9affe0b4692155012b6
2015-11-04 16:33:29 +09:00
Dmitry Tantsur
05b3a6ec6b Fix gate broken by the devstack trueorfalse change
Seems like we were using this function in a wrong way, now change
Icc0eb3808a2b6583828d8c47f0af4181e7e2c75a broke us.

Depends-On: I19bb8ada9a6f42d375838cc88a376715918c2a3e
Closes-Bug: #1506436
Change-Id: I6fd6d6ebc9a8057eb3ec90f989c709cbac86b572
2015-10-15 14:32:24 +02:00
Dmitry Tantsur
6631b8ffab Fix database schema for mysql and switch the gate to testing it
MySQL can't use TEXT fields for primary keys. This change switches all them
to VARCHAR(255). This change should not be breaking for SQLite, as it
does not distinguish between these two data types.

README is updated with up-to-date information about the connection option.

Change-Id: I0153855c1827b55067a7c04310bfad7eb71f35fe
Closes-Bug: #1501746
2015-10-01 15:53:35 +02:00
Sam Betts
aa3b8ba777 Add alembic migrations for the inspector database
This patch adds a new command ironic-inspector-dbsync which can be used
to sync the ironic inspector database using alembic migrations. It adds
a migration to match the current required db schema.

Change-Id: I21188b3f5003c8ab43d82903473e2a6ef7f755a0
Closes-Bug: #1495620
2015-09-23 14:44:46 +01:00
Yuiko Takada
52ef561c9f Use rootwrap to execute iptables instead of requiring root
This patch set adds support for rootwrap in order to execute iptables.

Co-Authored-By: Dmitry Tantsur <dtantsur@redhat.com>
Change-Id: I7c424c17222f119730b8c5ac0daafd9906282e4d
Closes-bug: #1495844
2015-09-23 13:27:15 +02:00
Dmitry Tantsur
4aedc4558f Enable colorized logging in devstack plugin
Change-Id: Idc8e25a4ee71e1876bceb83528ca335d35faff7a
2015-09-08 15:23:40 +02:00
John Trowbridge
6eb9f58c87 Store and expose introspection data
This adds the ability to store all of the data collected
during introspection. The configuration option
"[processing] store_data" (defaults to 'none'), determines
this behavior. Initially, only 'none' and 'swift' are
supported. If 'swift' is used, the data is stored in Swift
with the object name of "inspector_data-<UUID>".

Adds an endpoint /v1/introspection/<UUID>/data which
retrieves the data according to the method in
"[processing] store_data". Returns 404 if this option
is disabled.

There is a further option to store the location of the data
in the Ironic Node.extra column. For 'swift', this will be
the name of the swift object. The option,
"[processing] store_data_location" determines the key
name in the Node.extra column. (defaults to not storing
the location).

Change-Id: Ibc38064f7ea56f85b9f5a77ef6f62a50f0381ff4
Implements: blueprint store-introspection-data
2015-08-27 20:18:54 -04:00
Yuiko Takada
e195b4780a Migrate to oslo_db
Currently, Ironic-inspector uses SQLite as database.
We should migrate to oslo.db.
In this patch, make database connect operations to oslo_db.

Change-Id: Ibd0f787b570bc101eab9fbd0b59d8a775a95e2e0
Implements: blueprint migrate-to-oslodb
2015-07-08 08:33:23 -04:00
Dmitry Tantsur
14454ad9d7 Fix and enhance devstack test script
* Put nodes in a proper provision state
* Use Ironic API instead of Inspector one for starting introspection
* Insert sleeps between sending nodes on introspection
* Add check on provision state
* Update devstack/plugin.sh to default to network not overlapping
  with devstack-gate default one

Closes-Bug: #1470346
Change-Id: Ib7c8fd32cca792c82030e2235166f05d6a40d747
2015-07-01 14:54:51 +02:00
Dmitry Tantsur
a7788a7a9a Move client out of tree
New home is https://github.com/openstack/python-ironic-inspector-client

Change-Id: I9b252f7007f568bfd19906662d7fb8b2e53574f6
Closes-Bug: #1464707
2015-06-18 16:50:03 +02:00