200 Commits

Author SHA1 Message Date
Dmitry Tantsur
8c842ec505 Deprecate putting periodic tasks on a driver object
This approach will no longer make sense when the driver composition is in effect.
Anyway usually a better place to put a task is an interface.

Change-Id: I7096e428ce9774d89ac624c2d38bb23984a4b842
Related-Bug: #1524745
2016-08-09 13:59:50 +02:00
Jim Rollenhagen
f16c6570bf Add node.resource_class field
This adds the "resource_class" field to the node table, object, and API,
as well as a database migration to go with it.

Change-Id: I936f2e7b2f4d26e01354e826e5595ff021c3a55c
Partial-Bug: #1604916
2016-07-28 11:49:27 +00:00
Jenkins
636f26ad1a Merge "IPMITool: add IPMISocatConsole and IPMIConsole class" 2016-07-26 00:05:22 +00:00
Jenkins
cd146248d9 Merge "Bug fixes and doc updates for adoption" 2016-07-25 17:05:58 +00:00
Yuiko Takada Mori
857372a226 IPMITool: add IPMISocatConsole and IPMIConsole class
IPMISocatConsole is a new console interface class using ipmitool and
socat. It has the same APIs of IPMIShellinaboxConsole class and
provides TCP4/TCP6 connection service to connect serial-on-LAN of
nodes.
IPMIConsole is a new console interface class using ipmitool and used
as parent class of IPMIShellinaboxConsole and IPMISocatConsol class.

This patch set implements new console driver interfaces
IPMISocatConsole.

To use PXE + IPMItool + socat, specify pxe_ipmitool_socat.
To use IPA + IPMItool + socat, specify agent_ipmitool_socat.

Spec: https://review.openstack.org/#/c/319505/
Partial-Bug: #1553083
Change-Id: I35a7dcb7e89baf16d096501fd44dbc12adc8c61e
2016-07-25 16:42:31 +09:00
Julia Kreger
f95be90248 Bug fixes and doc updates for adoption
During the creation of a tempest test for the adoption feature,
some minor issues were identified with the adoption functionality.

Namely, the default logic was to create ramdisks, however that logic
path is more intended for deployment ramdisks. Logic was switched
to the instance preparation logic which is the default for nodes in
active state, which is realistically exactly what is desired.

Validation behavior ultimately remains unchanged and tests were
added to validate that the expected methods are called.

Additionally, it was identified that it would be ideal to
encourage the user to set the node to local boot, and as
such the documentation was updated as part of this change,
coupled with a note mentioning changes in API version 1.20
that a user may wish to leverage.

Change-Id: Id6053e0fa68deb431f4543005421982c795401f2
Closes-Bug: #1605239
2016-07-21 08:52:21 -04:00
Jenkins
e0a979982e Merge "Add and document the "rotational" root device hint" 2016-07-20 12:08:49 +00:00
Jenkins
d52d23222e Merge "Metric chassis, driver, node, and port API calls" 2016-07-18 17:34:25 +00: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
Devananda van der Veen
47985ea077 Follow-up to 317392
Fixing two nits on the last review of 317392.

Change-Id: Ib6e7a696b6ae2b4a5197d20009ee21f06ebba811
2016-07-15 11:50:35 +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
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
Devananda van der Veen
6d846590bc Follow-up fixes to 206244
This commit is a collection of follow-up fixes to the nits/comments on
https://review.openstack.org/#/c/206244/116

Change-Id: I5631f5df3c0b6a3baa386da8b93b1e888c1f8d3c
2016-07-13 18:12:35 -07:00
Laura Moore
0a5549680d Add multitenancy-related fields to port API object
This commit adds new fields to port object:
- port.pxe_enabled: indicates whether pxe is enabled or disabled
      for this port
- port.local_link_connection: contains the port binding profile.

Partial-bug: #1526403
Co-Authored-By: Jenny Moorehead <jenny.moorehead@sap.com>
Co-Authored-By: Will Stevenson <will.stevenson@sap.com>
Co-Authored-By: Vasyl Saienko <vsaienko@mirantis.com>
Co-Authored-By: Vladyslav Drok <vdrok@mirantis.com>
Co-Authored-By: Zhenguo Niu <Niu.ZGlinux@gmail.com>

Change-Id: Ie655fd59b06de7b84fba3b438d5e4c2ecd8075c3
2016-07-13 13:39:56 +03: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
Lucas Alvares Gomes
170ba4f295 Add and document the "rotational" root device hint
This patch is adding a new root device hint called "rotational". This
hint is used to identify whether a device is rotational or not making it
easy to distinguish HDDs and SSDs when choosing which disk Ironic
should deploy the image onto.

Closes-Bug: #1599517
Depends-On: I270fe57df825929bdef7911b3a6757cf7163a5f1
Change-Id: Id630a0b9d02ed8e1bd674c32bef0d489849c3f29
2016-07-12 17:14:34 +01: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
Vladyslav Drok
0a5bb693ef Add internal_info field to ports and portgroups
In case of ports, it is also added to the API, as a readonly field.
It will be used for any port-specific internal information ironic
needs to store inside the port object. In this change we start using
it to store UUIDs of the cleaning ports that ironic creates, instead
of fiddling with port.extra['vif_port_id'], as extra is intended for
operator use only.

Partial-bug: #1526403

Change-Id: Ib62c3e32305619d0c55f8ec7e45b067f0f0b32d4
2016-07-07 19:56:13 +03:00
John L. Villalovos
41a489d674 Fix releasenotes formatting error
Commit b12d184b73f6decb20f733ae642a54ae49e90b88 has release notes that
are badly formatted. Fix the issue.

Change-Id: If82d73bea1f45843dfdfd7304a18d2dc7c9044bd
2016-06-27 16:26:11 -07:00
Jenkins
953f06aefd Merge "Clear target_power_state on conductor startup" 2016-06-27 15:37:20 +00:00
Jenkins
9d830e0ef6 Merge "Add validation of 'ilo_deploy_iso' in deploy.validate()" 2016-06-27 15:35:24 +00:00
Jenkins
50cc15eabd Merge "Deployment vmedia operations to run when cleaning" 2016-06-23 16:16:09 +00:00
Jenkins
d0382c9c71 Merge "Properly set ephemeral size in agent drivers" 2016-06-22 18:53:26 +00:00
Vladyslav Drok
2e0716720a Properly set ephemeral size in agent drivers
This commit ensures that ephemeral_mb will be passed to an IPA
ramdisk, as it is what is expected by both IPA and ironic-lib.

This change also deduplicates some of the logic between
iscsi_deploy.build_instance_info_for_deploy and
deploy_utils.parse_instance_info methods.

Closes-bug: #1592895
Change-Id: I0c0ea7a887f9aeb9fc4280aa86098d59ee8cad20
2016-06-22 09:53:40 +00:00
Shivanand Tendulker
2eab1ee09a Add validation of 'ilo_deploy_iso' in deploy.validate()
iLO virtual media based drivers use ISO image supplied as
'ilo_deploy_iso' in node's 'driver_info' to boot node during
provisioning process. This parameter was not getting validated
during deploy.validate() call.

This change fixes the issue.

Change-Id: I8fc4a89621e09281349f88c32ed77d24aa11355b
Closes-Bug: #1592335
2016-06-21 21:39:10 -07:00
Devananda van der Veen
426a306fb5 Mask password on agent lookup according to policy
We currently mask passwords in driver_info for all API responses,
except for agent lookups. This is because driver_vendor_passthru
just expects a dict to return as JSON in the response, and doesn't
modify it at all.

Change lookup to follow the defined policy when returning the node
object in the response, the same way we do for other API responses.

Co-authored-by: Jim Rollenhagen <jim@jimrollenhagen.com>

Change-Id: Ib19d2f86d3527333e905fdbf1f09fc3dc8b8c5a7
Closes-Bug: #1572796
2016-06-21 08:26:23 -07:00
Zhenguo Niu
d52077f4fe Clear target_power_state on conductor startup
During clearing locks, also clear target_power_state. As nodes
may locked in powering process, sync_power_state task will sync
the power_state field, but nobody handles target_power_state.

Change-Id: I2293e03c05e13c716f78533680d128ba45ccda02
Closes-Bug: #1567255
2016-06-21 15:22:37 +00:00
Jenkins
f4c299350a Merge "Follow-up to Active Node Creation" 2016-06-17 18:10:57 +00:00
Julia Kreger
8ae7bf27dd Follow-up to Active Node Creation
Follow-up change to the Active Node Creation revision in order
to address some requested documentation and test changes for the
original revision Ib3eadf4172e93add9a9855582f56cbb3707f3d39.

Change-Id: I962b3d9e4b40acd92446813792c9d968fac3a170
Partial-Bug: #1526315
2016-06-17 09:25:23 -04:00
Jenkins
ba49f8c77e Merge "Remove workaround for nova removing instance_uuid during cleaning" 2016-06-17 09:22:59 +00:00
Jenkins
53062caa7c Merge "Active Node Creation via adopt state" 2016-06-17 03:40:59 +00:00
Jenkins
021408417b Merge "Add cleanwait timeout cleanup process" 2016-06-14 15:28:03 +00:00
Dmitry Tantsur
5203bf05d0 Remove workaround for nova removing instance_uuid during cleaning
Was supposed to be removed back in Mitaka, according to the comments.

Change-Id: I1974b3694ed8d43a22f1f211e3f665adcf04fec6
2016-06-14 17:21:13 +02:00
Julia Kreger
42e2685395 Add cleanwait timeout cleanup process
Previously, if a node in a cleaning state timed out, the timeout
process would not purge certain items from the node's configuration
which resulted in a short circuiting of the logic cleaning being
retried. This was a result of the node clean_step configuration
not being purged upon a timeout occuring.

This change adds a wrapper method around the cleaning failure
error handler to allow the _fail_if_in_state method to call
the error handler, since error handler syntax is not uniform
and the _fail_if_in_state cannot pass arguments.

It also changes the cleaning error handler to permit the error
handler to delete the node clean_step, and cleaning related
driver_internal_info configuration from a node in the event
the node in in CLEANFAIL state.

Change-Id: I9ee5c0b385648c9b7e1d330d5d1af9b2c486a436
Closes-Bug: #1590146
2016-06-13 17:17:14 -04:00
Jenkins
b3ed7eeea2 Merge "Remove support for the old ramdisk (DIB deploy-ironic element)" 2016-06-10 21:17:54 +00:00
Jenkins
24652497b3 Merge "Add config option for ATA erase fallback in agent" 2016-06-09 16:08:21 +00:00
Dmitry Tantsur
259a492243 Remove support for the old ramdisk (DIB deploy-ironic element)
To be specific, removed in this patch are:
* vendor passthru for the old ramdisk
* support for deploy_key
* various helper functions (like notify)
* devstack plugin support for the old ramdisk

Fixed:
* vendor passthru for drivers (add support for IPA to seamicro one)
* documentation for iSCSI-based deployment

Change-Id: I0fc25c64339bc4c1f03ccb35cbc4efad4a7ad966
2016-06-09 13:43:21 +02:00
Jenkins
a155f30c88 Merge "Gracefully degrade start_iscsi_target for Mitaka ramdisk" 2016-06-08 15:12:09 +00:00
Vladyslav Drok
ba83fb1bb4 Gracefully degrade start_iscsi_target for Mitaka ramdisk
Currently calling this code blows up if using an older ramdisk. If
default values for 'portal_port' or 'wipe_disk_metadata' parameters
are set, do not pass it to IPA to workaround this problem. If
start_iscsi_target fails and wipe_disk_metadata is True, try to
start iSCSI without it, if custom portal_port is requested, tell the
user that either ramdisk should be updated or default port should be
used.

Closes-Bug: #1584005
Co-Authored-By: Vladyslav Drok <vdrok@mirantis.com>
Change-Id: I319fb18bb8ff58970c219cc4f4dba7b54e239bd4
2016-06-08 12:55:05 +03:00
Julia Kreger
832826f640 Active Node Creation via adopt state
At present the ironic API explicitly sets the new state for
nodes to the beginning step in the ironic workflow.

As part of hardware fleet lifecycle management, an operator
expects to be able to migrate inventory and control systems
for their hardware fleet utilizing their existing inventory
data and allocation records. Ultimately this means that
an imported host MAY already be allocated and unavailable
for immediate allocation.

As such, a mechanism is required to permit users to put nodes
into an ACTIVE state without performing a deployment operation.

This adds a new API provision_state verb to allow users to move
nodes from MANAGEABLE state to ACTIVE state.

Partial-Bug: #1526315
Change-Id: Ib3eadf4172e93add9a9855582f56cbb3707f3d39
Depends-On: Ie114bfaab249d73ea3ca7c0edc314ca1ed0448eb
2016-06-07 09:13:22 -04: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
Ruby Loo
4405e6d412 NOTIFICATION_TRANSPORT should be global
This is a followup to "Use messaging notifications transport
instead of default" (Ic72fd658fe9b35d39cc3d7da2e4b9fe3454edfba).

The use of NOTIFICATION_TRANSPORT should be global. A unit
test is added; it fails if the variable isn't global.

A typo was addressed in the release notes.

Change-Id: Ie303d79aba893b36a7aecb29c0ff2703f742146e
2016-06-01 10:25:05 -04:00
Jenkins
fb4e545e21 Merge "Use messaging notifications transport instead of default" 2016-05-31 09:49:39 +00:00
Jenkins
4f4e398b9c Merge "Remove support for 'hexraw' iPXE type" 2016-05-31 08:58:26 +00:00
Vladyslav Drok
cc54cea060 Use correct iscsi portal port in continue_deploy
We should set it to CONF.iscsi.portal_port by default.

Closes-Bug: #1585731

Change-Id: I34e1f2ff842b323fb390f16cca32309fb64cfea3
2016-05-30 20:24:50 +03:00
Ruby Loo
981223fcf1 Fix formatting of a release note
This fixes the formatting of the release note for
adopt-oslo-config-generator-15afd2e7c2f008b4.yaml.
Without a hyphen preceding the change, each
character is displayed in a separate bullet!

Change-Id: I1681d98871d8c51c6e8515d13a9cba348457cda1
2016-05-30 11:42:03 -04:00
Ruby Loo
cdd8d938f8 Remove support for 'hexraw' iPXE type
This removes support for "hexraw" type in the iPXE script
(boot.ipxe) since "hexraw" is not supported in older
versions of iPXE. "hexhyp" replaced "hexraw" and has been
used since kilo.

Also addresses a nit in the original patch
(https://review.openstack.org/#/c/171759/). For
_get_pxe_mac_path(),  changed the assigned value of
'delimiter' argument from None to '-' (because it
was coded to be '-' as the default).

Change-Id: Ide05ff7c4689cd696e2fe76be98ff99c0be24236
2016-05-30 11:04:23 -04:00
Juan Antonio Osorio Robles
5d349c69a0 Use messaging notifications transport instead of default
The usage of oslo_messaging.get_transport is not meant for
notifications; And oslo_messaging.get_notification_transport is
favored for those means. So this change introduces the usage of that
function.

If the settings for the notifications are not set with the
configuration that's under the oslo_messaging_notifications group,
this will fall back to the old settings which are under the DEFAULT
group; just like this used to work.

Change-Id: Ic72fd658fe9b35d39cc3d7da2e4b9fe3454edfba
2016-05-30 14:42:45 +03:00
Jenkins
51bb801820 Merge "Follow-up patch of 8e5e69869df476788b3ccf7e5ba6c2210a98fc8a" 2016-05-26 10:15:14 +00:00