333 Commits

Author SHA1 Message Date
Dmitry Tantsur
9805d94b18 Sync ironic-lib.filters from ironic-lib
For now we have to carry both in both trees, and they have gone out
of sync. This changes updates the copy here with two new commands.

Change-Id: Ife131cf825518012a3b04d2c7d713beeb4f8f770
2016-09-21 15:21:05 +02:00
Jenkins
20e0b6fa1b Merge "Grub2 by default for PXE + UEFI" 2016-09-20 11:20:22 +00:00
Ruby Loo
230b330583 Adds a missing space in a help string
This adds a missing space int he default_boot_mode configuration
option's help string.

Change-Id: I08cbbc04b7ee636e6a62ed28dd355303d2ae525f
2016-09-19 18:00:41 -04:00
Jenkins
f41c26d4f2 Merge "Allow using TempURLs for deploy images" 2016-09-19 16:48:28 +00:00
Lucas Alvares Gomes
5110a65581 Grub2 by default for PXE + UEFI
This patch is changing the default bootloader for PXE + UEFI to Grub2.
Prior to this patch Elilo was the default but, Elilo is no longer
maintained with the last release dating 2014.

Ironic should have sane defaults therefore we should not rely on an
unmaintained project.

Change-Id: Ib34fcbd37e4698bf272582c96b1540b511b5a892
2016-09-19 11:39:33 +00:00
Lucas Alvares Gomes
f1b58b7dae Update ironic/ironic.conf.sample
Change-Id: I641136fcd8cb565663654a44a8e7a776495af81c
2016-09-08 13:41:38 +01:00
Pavlo Shchelokovskyy
497be96d4a Allow using TempURLs for deploy images
when iPXE is enabled, it is possible for the bootloader to download
the deploy kernel and ramdisk directly from Swift TempURL instead of
downloading them to conductor and serving from local HTTP server.

This patch adds the required logic and a new config option
`ipxe_use_swift` (default False), setting which to True enables
using Swift TempURLs for deploy ramdisk and kernel.

Note that local caching and serving for kernel and ramdisk of user image
is still performed for partition images that require non-local boot,
as moving those to use TempURLs will make it impossible for the user
to reboot the instance when TempURLs time out or image is deleted from
Glance/Swift.

Change-Id: I106cc6148c329e784bfbb5019fdfeb0509a9de09
Closes-Bug: #1526404
Co-Authored-By: Andrey Shestakov <ashestakov@mirantis.com>
2016-09-07 20:40:53 +03:00
Jenkins
3b97d53921 Merge "DRAC RAID configuration" 2016-08-30 14:16:52 +00:00
Imre Farkas
f358c7d85d DRAC RAID configuration
Implements out-of-band RAID management in the DRAC driver using generic
RAID interface.

Closes-Bug: #1572529

Change-Id: Ie357dfb68e663880d9806853f8f4a1954c50a877
2016-08-30 10:23:03 +02:00
Jenkins
1d73c10cad Merge "Mask instance secrets in API responses" 2016-08-29 14:05:41 +00:00
Jenkins
9110e07a5f Merge "Fix typo in policy.json.sample" 2016-08-26 16:44:16 +00:00
Jenkins
4ad6f79687 Merge "Switch Inspector interface to pass keystoneauth sessions" 2016-08-26 16:42:50 +00:00
Devananda van der Veen
dc0dad9773 Mask instance secrets in API responses
This change adds a new policy setting, "show_instance_secrets", whose
behavior mirrors that of the existing "show_passwords" policy setting.

Whereas "show_passwords" has historically blocked all sensitive
information from the node's driver_info field, the new setting blocks
all sensitive information from the node's instance_info field, including
image_url.

The name of the old setting, "show_passwords", is not being changed at
this time because such a change is not backwards-compatible. Instead,
the documentation string for this setting has been changed to clarify
what it does. Note that the behavior has not actually changed.

Note that this change moves the policy.check("show_password") call from
the Pecan hook into the API's Nodes() class, where the
policy.check("show_instance_secrets") is also added. This makes the code
a little cleaner and more maintainable, especially if we want to add any
more checks like this in the future.

As a result of this cleanup, the ironic-specific
RequestContext.show_password property is removed.

Partial-bug: #1530972
Partial-bug: #1526752
Related-bug: #1613903

Change-Id: I48493c53971cdab3b9122897e51322e19ce2f600
2016-08-26 08:31:17 -07:00
Vasyl Saienko
9570a491b8 Fix typo in policy.json.sample
This patch fixes a type in policy.json.sample file.
Change role:is_admin to rule:is_admin

Change-Id: Ie2429fa8f73c2423fd396a54e2af86ef880f7dd4
2016-08-26 10:29:17 +03:00
Jenkins
1d9675fa66 Merge "Fix iLO drivers inconsistent boot mode default value" 2016-08-26 01:37:41 +00:00
Mario Villaplana
2cc70ea93a Add notification base classes and docs
This adds base classes and documentation for creating notifications.

Partial-Bug: 1526408

Change-Id: Ib1b1fa819e8ff0b93afacd0b3de6e6762168e230
2016-08-23 21:46:16 +00:00
Dmitry Tantsur
08e66ef8ec Switch Inspector interface to pass keystoneauth sessions
This enables fetching the service URL from keystone catalog.

Change-Id: If862481533cf121bc6e829f0f39893134578ec30
2016-08-22 18:04:29 +02:00
lukasz
ae05492d16 Fix typo: interations -> iterations.
Change-Id: I042d3f5a94a0291cfd9c38027e2c1ae289f31168
Signed-off-by: Lukasz <lleszczuk@gmail.com>
2016-08-18 21:42:55 +02:00
Shivanand Tendulker
8b2ec52e42 Fix iLO drivers inconsistent boot mode default value
When no boot mode is explicitly passed to iLO drivers, it picks
default boot mode based on series of factors like, pending boot
mode setting, UEFI boot mode support on the node. This causes
confusion to the users as these factors are node specific and
beyond user's control. User expects a predictable behavior when
no boot mode is explicitly passed.
A new configuration parameter '[ilo]/default_boot_mode' has
been added to specify default boot mode. It would be used if no
boot mode is explicitly passed to iLO drivers.

Change-Id: I4efd28985674bedabe42fe786135255698425321
Closes-Bug: #1604002
2016-08-16 20:47:57 -07:00
Lucas Alvares Gomes
79c2d134b1 Add "erase_devices_metadata_priority" config option
This patch is adding a new configuration option called
"erase_devices_metadata_priority" to allow users to configure the priority
(and enabling/disabling) of the "erase_devices_metadata" cleaning step.

The documentation will be done in a subsequent patch.

Partial-Bug: #1603411
Change-Id: I110008b3d738de0b5d2add68c9d54a4a147fc007
2016-08-12 09:59:39 +01:00
Vladyslav Drok
d23b9c0515 Remove unused [pxe]disk_devices option
It became unused with the deprecation of the bash ramdisk.

Change-Id: I26aaf3a7252a8e693dc13d71c24776ff8bb42642
2016-08-11 21:17:36 +03:00
Jenkins
e95aa99f0f Merge "Collect deployment logs from IPA" 2016-08-06 00:33:12 +00:00
Lucas Alvares Gomes
cd7507f04b Collect deployment logs from IPA
This patch adds the code to collect the deployment logs from the IPA
ramdisk. The logs can be collect for every deployment, upon a failure or
never. By default, logs are collected upon a failure.

After collection, logs can be storaged either in the local filesystem
(default) or in Swift.

If an error occurs when the logs are being collected, storaged or if the
ramdisk does not support the collect_system_logs command Ironic will log
an error message, but the deployment will proceed.

Documentation on how to enable and other configuration will be done on a
subsequent patch.

Partial-Bug: #1587143
Change-Id: I6da1110daa94ea25670f71f9862e51cc9bbc6f93
2016-08-05 14:39:31 +01:00
Dmitry Tantsur
8bdd538c0c Promote agent vendor passthru to core API
Introduces new /v1/lookup and /v1/heartbeat/<UUID> endpoints
(and associated controllers).

This change does not deprecate the old passthru endpoints, it should
be done after IPA switches to using the new ones.

Change-Id: I9080c07b03103cd7a323e2fc01be821733b07eea
Partial-Bug: #1570841
2016-08-05 12:31:32 +02:00
Sinval Vieira
4483de30ba Add Dynamic Allocation feature for the OneView drivers
This change is about adding the ability to the OneView drivers of
dynamically allocate OneView resources to Ironic. The current
version of the drivers consider what we call "pre-allocation" of
nodes, meaning that when a node is registered in Ironic, even if
it is not in use, this resource is still reserved in OneView.
This change will prevent such situations by allocating OneView
resources only at boot time, allowing both systems to really
share the same pool of hardware.

Change-Id: I43d1db490b4834080562946b8a6ca584ea36864d
Co-Authored-By: Lilia Sampaio <liliars@lsd.ufcg.edu.br>
Co-Authored-By: Xavier <marcusrafael@lsd.ufcg.edu.br>
Co-Authored-By: Hugo Nicodemos <nicodemos@lsd.ufcg.edu.br>
Co-Authored-By: Thiago Paiva Brito <thiagop@lsd.ufcg.edu.br>
Co-Authored-By: Caio Oliveira <caiobo@lsd.ufcg.edu.br>
Partial-Bug: #1541096
2016-08-04 13:10:02 -03:00
Devananda van der Veen
c7da7a6925 Add keystone policy support to Ironic
Implements more fine-grained policy support within our API service,
following the oslo policy-in-code spec, while maintaining compatibility
with the previous default policy.json file. An empty policy.json file is
included, along with a sample file listig all supported policy settings
and their default values.

A new tox target "genpolicy" has been added to ease automation of
sample policy file generation.

All calls to policy.enforce() have been replaced with with
policy.authorize() to avoid silent failures when a rule is undefined,
because enforce() does not raise() if the target rule does not exist.

  NOTE: policy.enforce() is not removed by this patch, but a deprecation
  warning will be logged if it this method is invoked.

Updates unit test coverage for the new authorize() method, as well as
more general unit test updates for some of the new rules.

Partial-bug: #1526752
Change-Id: Ie4398f840601d027e2fe209c17d854421687c7b7
2016-08-04 12:43:20 +00:00
Pavlo Shchelokovskyy
f9ea26ebf3 Migrate to using keystoneauth Sessions
We currently construct Keystone client objects directly, which
is no longer the preferred way.  Instead, we should be using Sessions
which allows use of different auth plugins.  This change attempts to
migrate our Keystone usage to this model.

Additionally, we currently rely on the imported keystonemiddleware
auth_token's configuration for all of the Keystone credentials used
by the Ironic service user.  This is bad, as that config is internal
to that library and may change at any time.  Also, the service user
may be using different credentials than the token validator.

This refactors the keystone module to use Sessions.
It attempts to provide some backward compat for users
who have not yet updated their config,
by falling back to the authtoken config section when required.

Operators impact:

- Authentification parameters for each service now should specified in
  the corresponding config section for this service ([glance], [neutron]
  [swift], [inspector]).
  This includes providing both Keystone session-related options
  (timeout, SSL-related ones) and authentification options
  (`auth_type`, `auth_url` and proper options for the auth plugin).

- New config section `service_catalog` for Ironic service user
  credentials, used to resolve Ironic API URL from Keystone catalog.

- If loading from the service config section fails, an attempt is made
  to use respective options from [keystone_authtoken] section as a
  fall-back for backward compatibility.

Implementation details:

- using keystoneauth1 library instead of keystoneclient

- For each service the keystone session is created only once and is
  reused further. This lowers the number of authentification requests
  made to Keystone but implies that only auth plugins that can
  re-authentificate themselves can be used (so no *Token plugins).

This patch does not update the DevStack plugin, in order to test
backwards compatibility with old config options.
DevStack plugin will be modified in a subsequent patch.

Change-Id: I166eebefc1e1335a1a7b632149cf6441512e9d5e
Closes-Bug: #1422632
Related-Bug: #1418341
Related-Bug: #1494776
Co-Authored-By: Adam Gandelman <adamg@ubuntu.com>
2016-08-03 11:24:21 -07:00
Jay Faulkner
84bf48431c Pass agent metrics config via conductor
This adds agent config options for metrics as described in the
spec, and allows those config options to be sent to IPA on
lookup. We're configuring heartbeat timeout this way, and this
change matches nicely with that style.

Additionally, this sets heartbeat_timeout under the new config
namespace for consistency, however, we'll allow the old way to
be deprecated when the vendor_passthru for agent lookups is
deprecated.

Change-Id: I94d81b95feabe46999dbbc02522508cd542a89f8
Co-Authored-By: Josh Gachnang <josh@pcsforeducation.com>
Partial-bug: #1526219
2016-08-02 17:56:43 +00:00
Jenkins
88303cc56c Merge "Add support for the audit middleware" 2016-08-02 15:16:27 +00:00
Jenkins
c6e40cf902 Merge "Support to validate iLO SSL certificate in iLO drivers" 2016-08-01 17:29:08 +00:00
Lokesh S
295b35c48f Add support for the audit middleware
This adds support for the audit middleware to Ironic, allowing
the middleware to send two notifications per API request,
one for the request and another for the response.
This adds an option to enable or disable audit middleware.
Also to properly audit API requests passing conf options
via audit map file.

AuditMiddleware docs:
   http://docs.openstack.org/developer/keystonemiddleware/audit.html

Co-Authored-By: Chris Krelle <nobodycam@gmail.com>

Closes-Bug: #1540232
Change-Id: I6de4751aa6b25e8457cae3eeab95a15f417662c5
2016-07-26 11:43:35 -07:00
Jenkins
79439274bb Merge "Centralize config options - [DEFAULT]" 2016-07-22 02:31:33 +00:00
Jenkins
d52d23222e Merge "Metric chassis, driver, node, and port API calls" 2016-07-18 17:34:25 +00:00
Shivanand Tendulker
d36bd6f74a Support to validate iLO SSL certificate in iLO drivers
iLO drivers do not validate iLO SSL certificate. This commit adds
support in iLO drivers to validate iLO SSL certificate.

Change-Id: Iff0d02799d3d9338b7dbdd77eab1f12f709a7765
Closes-Bug: #1599710
2016-07-18 10:00:16 -07:00
Ramamani Yeleswarapu
6f0aea966b Centralize config options - [DEFAULT]
Nova style refactor of config options in Ironic.

Change-Id: I6baebf1bbc829238441ddd1399f6487fad33a15e
Partial-Bug: #1561100
2016-07-15 14:05:09 -07:00
Jay Faulkner
15c366580a Metric chassis, driver, node, and port API calls
This change adds initial metrics for Ironic based on new support in
ironic-lib. Emits timing metrics for basic Ironic API calls.

Bumps ironic-lib to 2.0.0 in requirements to add metrics support, as
well as adding ironic_lib.metrics and ironic_lib.metrics_statds to
ironic-config-generator.conf to get them in the sample config, which
is also regenerated.

Change-Id: Ic35802e4cd11763ebbedb8ddc28f7e8dc535cc2f
Partial-bug: #1526219
2016-07-15 18:15:11 +00:00
Jenkins
cb5988350a Merge "Expose node's network_interface field in API" 2016-07-15 08:27:19 +00:00
Vasyl Saienko
c62e1bee29 Expose node's network_interface field in API
This patch exposes the node's network_interface field in the REST API.
It also adds restrictions on the node states in which network
interface change is possible and whether the requested network
interface is enabled.

As a temporary solution until the driver composition work is completed,
we have taken an approach that requires all API and Conductor nodes to
have the same setting for enabled_network_interfaces. There are inline
notes in the code indicating where we will address this in the future.

Partial-bug: #1526403
Co-Authored-By: Om Kumar <om.kumar@hp.com>
Co-Authored-By: Vasyl Saienko <vsaienko@mirantis.com>
Co-Authored-By: Sivaramakrishna Garimella <sivaramakrishna.garimella@hp.com>
Co-Authored-By: Vladyslav Drok <vdrok@mirantis.com>
Co-Authored-By: Zhenguo Niu <Niu.ZGlinux@gmail.com>
Change-Id: I67495196c3334f51ed034f4ca6e32a3e01a58f15
2016-07-15 00:08:01 +00:00
Jenkins
f3e2077e1e Merge "Deprecate [ilo]/clean_priority_erase_devices config" 2016-07-14 20:33:32 +00:00
Lucas Alvares Gomes
0fcf2e8b51 Deprecate [ilo]/clean_priority_erase_devices config
The [ilo]/clean_priority_erase_devices configuration option is
duplicated by [deploy]/erase_devices_priority, this patch is marking the
ilo configuration as deprecated.

The ironic.conf.sample was also updated to reflect the changes.

Closes-Bug: #1515871
Change-Id: I2bf18e35d97160d31a51c8447745bfd60c099af2
2016-07-14 12:22:34 +01:00
Dao Cong Tien
22a80f77c5 Nova-compatible serial console: socat console_utils
This adds console_utils functions for 'socat' console.
Implements:
- get_socat_console_url(): returns url for socat console
- start_socat_console(): uses (socat + console_cmd execution)
- stop_socat_console(): stops socat/console_cmd subprocess

Change-Id: I79ddd83d12cc8111e05b5107359d6db8a8881d61
Spec: https://review.openstack.org/#/c/319505/
Related-Bug: #1553083
2016-07-14 01:09:19 +00:00
Vasyl Saienko
ab97fa0f1f Add 'neutron' network interface
This patch adds a 'neutron' network interface. This interface
supports separate networks for provisioning and for cleaning of nodes.

Partial-bug: #1526403
Co-Authored-By: Vladyslav Drok <vdrok@mirantis.com>
Change-Id: Ia3442ab3536a1a8d8839b24dbfc640b818450350
2016-07-13 13:38:56 +03:00
Vasyl Saienko
cde11611d9 Add network interface to base driver class
This change also introduces two network interfaces:

* flat: Copies current neutron DHCP provider logic to work with
  cleaning ports;
* noop: noop interface.

The default value of the network_interface is None, meaning that the
node will be using the default network interface. The default network
interface is determined the following way:

* if [DEFAULT]default_network_interface configuration option is set
  (the default for it is None), the specified interface becomes the
  default for all nodes;

* if it is not set, 'flat' interface will be used if the deployment
  currently uses 'neutron' DHCP provider, otherwise 'noop' interface
  will be used.

create_cleaning_ports and delete_cleaning_ports methods of the DHCP
providers are still being called in case of out-of-tree DHCP
providers, but this possibility will be removed completely in the
next release. If the DHCP provider logic is rewritten into a custom
network interface, please remove those methods from the provider, so
that network interface is called instead.

Partial-bug: #1526403
Co-Authored-By: Om Kumar <om.kumar@hp.com>
Co-Authored-By: Vasyl Saienko <vsaienko@mirantis.com>
Co-Authored-By: Sivaramakrishna Garimella <sivaramakrishna.garimella@hp.com>
Co-Authored-By: Vladyslav Drok <vdrok@mirantis.com>
Co-Authored-By: Zhenguo Niu <Niu.ZGlinux@gmail.com>
Change-Id: I0c26582b6b6e9d32650ff3e2b9a3269c3c2d5454
2016-07-12 19:08:07 +03:00
Miles Gould
e5c23a2b9c Fix two types in ironic.conf.sample
I ran `tox -e genconfig` with a re-built virtualenv, and this was the
result.

Change-Id: I54b2376411524f5b9758a771b76fd735013f69f1
2016-07-07 13:02:09 +01:00
Vasyl Saienko
e6c1c16457 Create common neutron module
Move _build_client logic to ironic.common.neutron module.
In future module will contain common functions to Neutron.

Change-Id: I7b344d71d0f9ae34f7423099631bd25b5c5359bd
2016-06-23 11:47:50 +03:00
Ramamani Yeleswarapu
5f59a264c5 Centralize config options - [console]
Nova style refactor of config options in Ironic.

Partial-Bug: #1561100
Change-Id: Id3ed2021ec2f236eb501c3b2a3d4e1cf5b19062a
2016-06-16 16:44:56 -07:00
Julia Kreger
87e68256b6 Add config option for ATA erase fallback in agent
Operators should be able to choose if they wish to fallback when
a disk based secure erase operation fails.

Adds a configuration option to be passed to the agent during
cleaning operations in order to allow that decision to prevent
failed secure erase operations from causing the node to go into
CLEANFAIL state by enabling fallback logic.

Change-Id: I13c0fef3a6aa1903bfe1f54ba4fafbeadd673666
Closes-Bug: #1536695
2016-06-06 08:16:50 -04:00
Lin Tan
773aa20a4a Make use of oslo-config-generator
oslo_config provide a utility for generating sample config files,
which provide more detail about opts, like Minimum/Maximum value
and Allowed values.
So drop Ironic's "generate_sample.sh" which was copied from
oslo-incubator long time ago.

Add a new entry point "ironic" under oslo.config.opts namespace to
explore config options to oslo-config-generator.

After this patch, new config options of Ironic code should register
with ironic/conf/opts.py. New external libraries should
register with tools/config/ironic-config-generator.conf

There is a bug #1554657 with oslo-config about deprecated_group.
This bug have impact of some configs from keystonemiddleware
and oslo.messaging in ironic.conf.sample
So currently, deprecated option should always add the deprecated_group
even it didn't alter the group, otherwise the deprecated group value will
be 'DEFAULT'.

Update etc/ironic/ironic.conf.sample via running 'tox -egenconfig'.

Closes-Bug: #1564195
Change-Id: If7721e98e69b6f54f1ee04a07477396b86583371
2016-05-25 11:59:13 +08:00
Jim Rollenhagen
ca218a4ac5 Remove "periodic_interval" config option
This was deprecated February 24, 2016. It's time to remove it.

Change-Id: If82a6a2c94b22ddcd8707bc8bd7f73ecaa24e021
2016-05-17 11:45:45 +00:00
Jim Rollenhagen
759e91632b Remove [conductor]/clean_nodes config option
This was deprecated a while ago and was slated for removal during
Newton. Do it.

Change-Id: Iac94720c357350160521688adb68d8bef7c04aae
2016-05-16 20:53:18 +00:00