Commit Graph

61 Commits

Author SHA1 Message Date
Jacob Anders 70ccb6af11 Add states.SERVICING and SERVICEWAIT to need_prepare_ramdisk
Currently, service steps do not work with virtual media deployments
because states.SERVICING and states.SERVICEWAIT are missing from the whitelist
of valid provision_states. This change resolves this issue.

Change-Id: I5e3ec08d128b35385f2d90c9c852140b757b8dbf
2024-04-10 10:48:04 +10:00
Dmitry Tantsur 203660a0be
Fix *_by_arch documentation and un-deprecate the options without it
First, the *_by_arch options are not a replacement for plain options:
the cpu_arch property is neither required not standardized. This is why
older options with *_by_arch equivalents are not deprecated.

Second, the example in the documentation is wrong: oslo.config does not
use Python dictionaries. Which makes me suspect that the feature has
never been properly tested (indeed, it's not used in the devstack CI,
and Bifrost uses the older options).

Change-Id: If1e633930909ce9d80e14f3ec3daa0bf8d48b7f0
2023-11-27 18:12:58 +01:00
Zuul 1bbc67c1b6 Merge "Add inspection (processing) hooks" 2023-08-29 16:45:16 +00:00
Bifrost 3c5e05a8a4 Introduce default kernel/ramdisks by arch
Introduce config to allow setting default ramdisks per-architecture.
The hierarchy of the parameters is:
Node config > config by architecture > general config

Change-Id: I95dfece3e8f7bcd3121ac808985cb61997877a51
2023-08-28 17:25:37 +01:00
Mahnoor Asghar e6360bc84b Add inspection (processing) hooks
Adds inspection hooks in the agent inspect interface for processing
data received from the ramdisk at the /v1/continue_inspection
endpoint. The four default configuration hooks 'ramdisk-error',
'validate-interfaces', 'ports' and 'architecture' are added.
(The remaining inspection hooks will be added in further patches.)

Change-Id: I2cf1be465ba7a93fd66881b14972e960acd4dd4e
Story: #2010275
2023-08-25 09:38:39 -02:00
Dmitry Tantsur 5feb39844a Allow reusing defaults in per-node kernel_append_params
It may be convenient to use [pxe/redfish/...]kernel_append_params as
the universal defaults, while using {driver,instance}_info to only
append values. This change allows that by replacing %default% with
the value of the applicable configuration option.

An example use case: CoreOS requires an additional artifact (root
filesystem URL) when PXE booting.

While here, fix the PXE/iPXE interface documentation.

Change-Id: I829291ab5cc19ec2ca43bc45815d012697f0b408
2022-04-11 18:54:42 +02:00
Aija Jauntēva dd1cb46f2b Fix prepare ramdisk for 'wait' states
Node can be in CLEANWAIT or DEPLOYWAIT during async step
handling when it needs another reboot. Without this change
node fails to boot back to IPA.

This unifies all occurrences and create utility method for
reuse. All occurrences are aligned to have the same set of
states in case they are needed in future.

Change-Id: I685c5827a70df4abb358635d89b86894671ac493
2022-02-16 11:51:14 -05:00
Steve Baker 85c0dd4929 Use driver_internal_info methods for driver utils
This change switches driver utility and base classes to using
set_driver_internal_info, del_driver_internal_info,
timestamp_driver_internal_info node methods for modifying
driver_internal_info.

Specific drivers with switch over later in this series.

Change-Id: I4bdfe447cb4636f3f9efad3f2cb17ebddcacce4b
2022-01-05 16:05:34 +13:00
Dmitry Tantsur e84b6d1020 Rename ilo_boot_iso -> boot_iso
Change-Id: Ie758cccdf8a7bc30389cd5d4cd83ea80dbae040f
2021-06-14 16:54:08 +02:00
Dmitry Tantsur 349bf2d5bc Clean up vendor prefixes for iLO boot
Generic fields, such as deploy_{kernel,ramdisk,iso) and bootloader
should not have vendor prefixes. This patch removes them from
the iLO boot interfaces with deprecation.

Also clean up the code a bit for less repetition.

Change-Id: Ib23203fa01837ee96f8a38ab50fa8252334c8cb8
Story: #2008880
Task: #42430
2021-06-14 16:36:33 +02:00
Dmitry Tantsur 0a83738721 Rename redfish_deploy_iso -> deploy_iso
We should only use prefixed driver_info parameters when they are either
unique to the driver or have different meanings for different drivers.
This is not the case for deploy_iso, but we use vendor prefixes for
historical reasons.

This change migrates the redfish-virtual-media boot interface and
creates helpers to fascilitate migration of other boot interfaces.

Change-Id: I698d1c90592e8de2cb24d6e2cf819e7f6ac3911f
Story: #2008880
Task: #42425
2021-05-19 12:48:40 +02:00
Dmitry Tantsur 2a73f5a84e Clean up kernel_append_params for PXE/iPXE
Currently handling of kernel_append_params is very inconsistent. This
change applies a straightforward process:
1. instance_info[kernel_append_params]
2. driver_info[kernel_append_params]
3. [pxe]kernel_append_params (renamed from pxe_append_params).

Also adds a helper for subsequent fixes in other drivers.

Change-Id: I79bcf4d8ef1f0f55a82e0991dd5bb1685b3f7957
Story: #2008902
Task: #42469
2021-05-17 16:12:30 +02:00
Aija Jauntēva d913ef6396 Move configuration mold utilities
Utilities moved to ironic.common.molds.
New config section [molds] created and settings moved there.

Change-Id: I1177f7dd5d5157bb3a5c0bd09acd75c9a394ab47
2021-03-29 07:42:53 -04:00
Aija Jauntēva 15e20fe293 Add configuration mold storage
Support Swift and Web server via HTTP GET and PUT.

Story: 2003594
Task: 40621
Change-Id: I1d253650f6a3b98dbbe4e09c167c35526f5f940c
2021-03-26 05:40:09 -04:00
Dmitry Tantsur a5f7d75ba2 Apply force_persistent_boot_device to all boot interfaces
For some (likely historical) reasons we only use it for PXE and iPXE,
but the same logic applies to any boot interface (since it depends
on how the management interface and the BMC work, not on the boot
method). This change moves its handling to conductor utils.

Change-Id: I948beb4053034d3c1b4c5b7c64100e41f6022739
2021-02-01 13:37:20 +01:00
dujinxiu da4c583ea9 Add node name to ironic-conductor ramdisk log filename
Change-Id: Ide28c16806909f1bbf93bf7c72b5cec6f8ddc260
Story: #2008281
Task: #41155
2020-10-24 16:01:52 +08:00
Dmitry Tantsur d31e71a736 Collect ramdisk logs also during cleaning
Change-Id: Ia60996b4198e6fcfba6094af26498869589e175e
2020-05-14 18:38:31 +02:00
Riccardo Pittau 78c121a5d7 Stop using six library
Since we've dropped support for Python 2.7, it's time to look at
the bright future that Python 3.x will bring and stop forcing
compatibility with older versions.
This patch removes the six library from requirements, not
looking back.

Change-Id: Ib546f16965475c32b2f8caabd560e2c7d382ac5a
2019-12-23 09:38:25 +01:00
Tony Breeds 03375f003f Make ipmi_force_boot_device more user friendly
Look for boolean and string like booleans in driver_info['ipmi_force_boot_device']
to make setting the option more user friendly / less error prone.

Change-Id: I2917761055db5286183ce265089c19dea98947ad
Story: 2004444
2019-01-15 13:20:45 +11:00
Aparna c725f541de Support SUM based firmware update as clean step for iLO drivers
This commit adds support to perform Smart Update Manager (SUM)
based firmware update as an inband manual clean step
`update_firmware_sum` for iLO drivers.

Closes-Bug: #1648448
Change-Id: I581d5bc535420d4493394d16cf6cc2bb0ddeb8f7
2017-10-10 07:36:51 +00:00
wangkf 3b7e6abcbc Change ramdisk log filename template
ironic collects ramdisk logs from agent, and save it to
/var/log/ironic/deploy.

The time stamp part of log filename is formatted as '%Y-%m-%d-%H:%M:%S',
as an example:

    7b52d13a-9372-448d-9252-fffbaf2db942_1fb52a75-04b6-4c73-80c4-\
    8d49dc30f650_2017-07-06-09:03:18.tar.gz

The colon is not handled properly by tar, it fails to untar a file
with colon in file name.

This patch provides a workaround by changing colon with dash in time
stamp.

Closes-Bug: #1702672
Change-Id: I1d60939768ffa75de050aa309a3203de553ae877
2017-07-31 19:50:25 +08:00
Anup Navare 4c82308ebe Remove log translations from ironic/drivers Part-1
Log messages are no longer being translated. This removes the use of
_LE, _LI and _LW translation markers from ironic/drivers.

Change-Id: Ie01c1a6a0e0232dce055767854a5d4385b392510
Partial-Bug: #1674374
2017-05-09 17:15:38 +00:00
Luong Anh Tuan 6fa142160e Fix setting persistent boot device does not work
- The old value 'is_next_boot_persistent'=False of "driver_internal_info"
is still in database, Because when persistent set is True we didn't set
'is_next_boot_persistent'=True. This will lead to get_boot_device work
wrong in response boot information.

https://github.com/openstack/ironic/blob/70b992c/ironic/drivers/modules/ipmitool.py#L975
or
https://github.com/openstack/ironic/blob/70b992c/ironic/drivers/modules/ipminative.py#L501

Thus we have to pop "is_next_boot_persistent" to fix the problem.

Co-Authored-By: Dmitry Tantsur <divius.inside@gmail.com>
Change-Id: I79efed519b2bacf178f078b338394ca0c4e87d4f
Closes-bug: #1626453
2017-01-11 10:31:36 +07:00
Luong Anh Tuan eb04079860 Use oslo_serialization.base64 to follow OpenStack Python3
This patch replaces python standard base64 library call to
oslo_serialization.base64 to follow OpenStack Python3 porting
standard [1], since the requirements.txt has already defined
oslo.serialization>=1.10.0.

[1] https://wiki.openstack.org/wiki/Python3

Change-Id: I148778ebcccecdb04824c6982b184400ec189084
2016-12-15 07:47:50 +00:00
Jenkins d0b2985bc5 Merge "Pass swiftclient header values as strings" 2016-08-25 23:23:42 +00:00
Nguyen Hung Phuong 7022b5fad5 Merge imports in code
This patch merges all lines importing i18n into 1 line:

http://docs.openstack.org/developer/hacking/#imports

Change-Id: I828542a62cc577065f3bef9223d25cfe7a939785
2016-08-24 01:34:03 +00:00
Tim Burke 4a1d1b0089 Pass swiftclient header values as strings
Swiftclient passes header values straight through to requests, which
recently started enforcing a long-documented requirement that headers
be byte- or unicode-strings. While the Swift community decides whether
and when to str() header values vs. raising an error [1], let's
explicitly cast what we know to be ints to strs as that should *always*
work.

[1] This is a bit more complicated than it seems at first glance;
    see the discussion around the requests change for details at
    https://github.com/kennethreitz/requests/pull/3366

Change-Id: Ic52a68365dc08db055f776ec8d48f7bf44d6b80d
Related-Bug: #1614932
2016-08-19 10:10:01 -07: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
vsaienko 78f3962b6c Move _normalize_mac to driver utils
This function is going to be used by out of tree drivers.
To avoid code duplication make it available from Ironic's tree

Change-Id: I12211db38a3fdb3b2d733e5769f2c052c32c4a75
2016-03-17 18:17:26 +02:00
Anton Arefiev 5d22ccf016 Replace deprecated LOG.warn with warning
LOG.warn is deprecated. It still used in a few places. This updates
those one to use the non-deprecated LOG.warning instead.

Closes-Bug: 1508442
Change-Id: Id947e4c8ae9894f480192a5ab034c24c25125788
2015-10-21 15:22:46 +03:00
Thiago Paiva 460b9f1f5f OneView Driver for Ironic
This driver that will promote integration between Ironic and the HP OneView
Management System. The driver will allow Ironic to borrow non-dedicated servers
from OneViews's inventory to provision baremetal instances with minimal common
pre-configuration, set through OneView's *Server Profile Templates*.

Co-Authored-By: Alberto Barros <albertoffb@lsd.ufcg.edu.br>
Co-Authored-By: André Aranha <afaranha@lsd.ufcg.edu.br>
Co-Authored-By: Caio Oliveira <caiobo@lsd.ufcg.edu.br>
Co-Authored-By: Diego Pereira <diegolp@lsd.ufcg.edu.br>
Co-Authored-By: Gabriel Bezerra <gabrielb@lsd.ufcg.edu.br>
Co-Authored-By: Lilia Sampaio <liliars@lsd.ufcg.edu.br>
Co-Authored-By: Sinval Vieira <sinval@lsd.ufcg.edu.br>

Change-Id: Ic2fb7860e6b4f5183b6525ff7709c7616350a96a
Implements: blueprint new-ironic-driver-for-oneview
Depends-on: I914596e592477e148e642f93cfbe114464c3fe38
2015-10-09 15:14:32 -03:00
Jenkins 16ff746af8 Merge "When boot option is not persisted, set boot on next power on" 2015-09-10 08:41:49 +00:00
Lin Tan dfd1d8492f Improve the ability to resolve capability value
Improve the ability to resolve capability value if user input
unexpected but correct value to become more robust.

Resolve the multiple values:
User might input multiple values like
'capabilities': 'cap1:value1, cap2:value2'
This is not subject to the format of "k1:v1,k2:v2" but should be
accepted.

Depends: Ibfee071e7cc3226440f2e860ddf7b759527657c9
Change-Id: Ie52291a260a5a04279c4f21e52961226282c450b
2015-09-08 14:45:08 +08:00
Zhenguo Niu cf9466d9ac When boot option is not persisted, set boot on next power on
If the server ipmi does not support the command 'chassis bootdev'
with 'persistent' option', the boot device cannot be set persistently
and will not be set for the 2nd boot.  This change proposes to add
a new parameter in node's driver_info to force set the boot device for
each power on.

Change-Id: I8d70c6292e3e013ccaf90f9ce4a616c8c916fe64
Closes-Bug: #1407820
2015-09-02 15:45:02 +08:00
Shivanand Tendulker 4103c0ffbb Validate capability in properties and instance_info
Validate the value of a capability in node/properties and
node/instance_info

Closes-Bug: 1441114

Change-Id: Ibc8acdc1fded2478f558a427fd76fc46fc06b92e
2015-06-15 03:13:21 -07:00
Sam Betts 8c07c4fda3 Enforce flake8 E123/6/7/8 in ironic
This patch enforces the rules E123, E126, E127, and E128 in the ironic
code base:

E123 - closing bracket does not match indentation of opening
bracket’s line
E126 - continuation line over-indented for hanging indent
E127 - continuation line over-indented for visual indent
E128 - continuation line under-indented for visual indent

This fixes any parts of the current code which fails these rules and
removes these rules from the tox.ini flake8 ignore list.

Change-Id: Ia96582b5e9abc088d6c1694afc93c59be4a4065c
Closes-Bug: 1421522
2015-06-04 12:56:51 +01:00
John L. Villalovos 5bbfe6bf6f Fix spelling error in docstring
Change 'raisee' to 'raises' in docstring

Change-Id: I5ea401a8f9a5bc6b8ab9cc58cb688511acedea47
2015-05-08 10:56:25 -07:00
Ghe Rivero aafeed2f85 Use oslo_log lib
Module 'log' from oslo-incubator was removed after release of oslo_log library.

Change-Id: I4261083dae076cea66c42ad16eb82a5faaeb1a65
2015-05-05 08:43:28 +02:00
Shivanand Tendulker 53df7893f0 boot_mode is overwritten in node properties
iLO drivers overwrite boot_mode in the node's properties/capabilities
when UEFI secure boot is requested.

Closes-Bug: 1436791

Change-Id: I9b6cf288b34707a8a1d5d99a95f2bc9f6bf380f1
2015-04-07 15:17:51 +00:00
Shivanand Tendulker d5bf6233f9 Ilo drivers sets capabilities:boot_mode in node
Ilo drivers sets capabilities:boot_mode in node properties
if there is none.
For a node capable of booting in both bios and uefi, setting
of this property by driver prevents it from getting selected for
future deploys requests for other boot mode.
It would be selected only for deploy requests where flavor
extra_specs specifies capabilities:boot_mode with a value
matching with one set by driver in the node properties.

Closes-Bug: 1418327

Change-Id: I90571487840c6a74699a8fbfbac8035c3efb5672
2015-03-23 03:42:43 -07:00
Shivanand Tendulker 2fc79a771a Common changes for secure boot support
This patch implements common code for secure boot support for iLO
drivers.

Implements: blueprint uefi-secure-boot
Change-Id: Iaaae1549f656f2abb9f8d80e1756d027893b6671
2015-03-18 00:49:30 -07:00
Lucas Alvares Gomes a4cf7149fb Add support for local boot
This patch implements the part that reads the specified boot_option in
the node.instance_info['capabilities'] that have been passed to Ironic by
the Nova Ironic Driver and pass that information to the deploy ramdisk
by adding it to the kernel cmdline in the PXE configuration file that
will be generated to that node.

This patch also makes sure that we clean the PXE configuration files for
the node marked to local boot after it's deployed, so that any attempt
to boot it from the network will not work.

This patch only apply to the pxe_* drivers, because the blueprint is
about adding local boot support for deployments that uses partition
images. The agent driver right now supports full disk images only.

Implements: blueprint local-boot-support-with-partition-images
Change-Id: Ide08e2b41dcf74c69dfbce242112da701fa15187
2015-02-09 16:46:35 +00:00
Tan Lin 9650c88d97 Make 'method' explicit for VendorInterface.validate()
Method should be more explicit than only having it via kwargs.

Closes-Bug: #1394470
Change-Id: I6a55e1be013629e22c384b968699980e83ae0cd3
2015-01-14 20:55:41 +08:00
Lucas Alvares Gomes b5a531aa4d Add a mechanism to route vendor methods
Each vendor class had to implement a custom method
to invoke their own vendor functionalities, the commit
e129faef17 added a decorator @passthru()
to decorate those vendor methods and guarantee that the errors and
exceptions are being handled accordingly. This patch is extending that
decorator to add some metadata to each vendor method and from that be
able to generically build a way to invoke those without requiring vendor
drivers to implement a custom method for that.

The vendor_passthru() and driver_vendor_passthru() methods were removed
from the VendorInterface base class. Now vendors that wants to implement
a vendor method should now only care about implementing the method itself
and decorating them with the @passthru() or @driver_passthru decorator.

This patch also adds a backward compatibility layer for existing drivers
out of the tree that may be using the old [driver_]vendor_passthru()
methods. If the vendor class contains those methods we are going to
call them just like before, otherwise we are going to use the new
mechanism. All drivers in tree have been ported to the new mechanism.

Implements: blueprint extended-vendor-passthru
Partial-Bug: #1382457
Change-Id: I7770ccd9668d9c03e02f769aff7c54b33734a770
2014-11-11 11:41:23 +00:00
David Shrewsbury f3ef289360 Enable H405 PEP8 check
Fixes files with the PEP8 error:

    H405  multi line docstring summary not separated with an empty line

and enables the PEP8 check in tox.ini.

Change-Id: I632c89e2a1783be8305a8a8cea7ae9d3bb55b62c
2014-10-10 16:18:14 -04:00
Mark Atwood 56fed1198f Cleans up some Sphinx rST warnings in Ironic
The names of parameters in docstrings should not have leading astrisk
characters, because it confuses the rST parser.

Change-Id: I8c3574b03903a23c10ef2afcb793c6766a486007
Partial-Bug: 1277282
2014-10-07 01:28:24 +00:00
Lucas Alvares Gomes b55f6e5148 Do not use the context parameter on refresh()
Now all RPC objects already have a context embedded within them so we
can ignore the context parameter on the refresh() method (it was the
last method using this parameter). This patch also:

* Update the Docstrings from the @remotable methods to let the user know
  that the context parameter is not being used. The @remotable decorator
  still requires that the method it's decorating have a context as it's
  first argument, but that's going to change in the future.

* All code and tests were updated to not pass the context to refresh(),
  save() and destroy() methods.

Closes-Bug: #1314732
Change-Id: Ibb338b909d99862ae048d605e66b8831d8c2128d
2014-09-23 13:58:52 +01:00
Faizan Barmawer 43ff80b63f add_node_capability and rm_node_capability unable to save changes to db
Changes to elements in existing node.properties dictionary will not get
saved to database by node.save(context) method. The properties dictionary
needs to be replaced by a new one to get the changes to be saved in the db.

Change-Id: I3bb65d00e141aedcb1278c1a700d12c9b29f7232
Closes-bug:#1371816
2014-09-20 10:13:12 +05:30
Faizan Barmawer d9cff4a2d8 Add uefi boot mode support in IloVirtualMediaIscsiDeploy
The following functionality need to be added in iLO driver:
  - Add set_boot_mode function to iLO driver to switch between
    bios and uefi boot modes.
  - Validate boot_mode for IloVirtualMediaIscsiDeploy driver.

Change-Id: Ic8496a2d97aab6634b573c85d379b446c49e04b9
Implements: blueprint uefi-boot-for-ironic
2014-09-12 16:49:43 +05:30
Vladyslav Drok 39a5a507bf Remove gettextutils _ injection
Now that ironic supports oslo.i18n, using the install function to
inject _ into the builtin has been deprecated. New i18n common module
used instead. In one module _ was imported from gettextutils, now
also changed to i18n import.

Closes-bug: #1346406
Change-Id: I672a975d479991982c24031e834a26e2c2811890
2014-08-29 15:36:28 -07:00