Supermicro machines, when in UEFI mode, have a different
device number, in binary, to represent the hard disk from
other vendors such as Fujitsu which actually has somewhat
similar code in their driver.
This means we need to be somewhat cognizent of the vendor of
the BMC and possibly update the device mapping based upon that
vendor.
This may ultimately fix a number of IPMI related problems, because
there is a reliance upon the text output of ipmitool, which only
reads the bytes retured by the BMC, which may not be reality after
the next reset, espescialy if ipmitool doesn't know of the UEFI
operating difference.
NOTE: This had to be a direct cherry-pick from the original change
as the intermediate branch that we normally would have cherry-picked
from has had other changes made to it, which resulted in an unclean
backport, where as with the original change it was clean.
Change-Id: Ie19db9e0cf1eafdfc9bb46248f4d457337821f94
Story: 2008241
Task: 41085
(cherry picked from commit a7ac9ce8cd)
Negotiation fails for some hardware, let's allow an explicit setting.
Change-Id: I04a3391f85412dcabc6105bd91beb1da25bdfc19
(cherry picked from commit 2773c5fb25)
For certain BMCs the default of 1 second is too short for the ipmitool
minimum command interval (-N). The configured
``[ipmi]min_command_interval`` should be used.
Story: 2007914
Task: 40317
Change-Id: I07f17a7321582e9829ac422efb51b571a17c5ca8
(cherry picked from commit a7445d9f85)
Add a new ``[ipmi]use_ipmitool_retries`` option. When set to
``True`` and timing is supported by ipmitool, the number of
retries and command interval will be passed to ipmitool so
that ipmitool will do the retries. When set to ``False``,
ironic will do the retries.
The default is ``True``, so this will not change the current
behaviour which is to have ipmitool do the retries when
timing is supported.
Setting to ``False`` will help with certain BMCs which do
not support the Cipher Suites command. In this case ipmitool
can take up to 10 seconds for each retry which results in a
total time exceeding ``[ipmi]command_retry_timeout``.
Change-Id: I1d0194e7c7ae9fcdd4665e6115ee26d10b14e480
Story: 2007632
Task: 39676
(cherry picked from commit 6520b373f4)
Fixes W504 and E117, resulting in some indentation changes.
Also fixes code that exceeds the complexity requirement, that is bumped
to 20 (mostly to avoid refactoring the agent heartbeat call, resulting
in conflicts for the deploy steps work).
Change-Id: I8e49f2c039b0ddfca9138f8e148708b7e8b5df7e
The IPMI verbose output being turned on by the debug option
is confusing and misleading, and since many operators run
ironic in debug mode anyway, it doesn't make much sense
to spam logs with errors and information that can be
misleading to a less experienced operator.
Also... less logging output.
Change-Id: I0fae7bad5613865dfd4d1c663be08d40debe157a
Introduces [console]port_range configuration option and implements
the feature of automatic port allocation for IPMI based serial console.
The ipmi_terminal_port in driver_info takes precedance if specified,
otherwise ironic will allocate free port from configured port range
for underlying serial proxy tools.
The implementation deviation with the original proposal is this patch
doesn't validate whether user specified ipmi_terminal_port falls in the
range, based on following considerations:
a. ipmi_terminal_port is considered a resort for backwards compatibility,
we will remove this eventually.
b. different conductors may have different port range configured (rare,
but could happen).
c. force ipmi_terminal_port in the port range could raise the
possibility of conflicts with ports in the configured range, this is not
a desired result, so leave the choice to the end users.
Change-Id: If8722d09dc74878f4da2e4a7f059d9b079c3e472
Story: 2007099
Task: 38135
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
This change allows to configure more retriable errors for ipmitool
execution that are specific to the environment it is run in.
Task: 36296
Story: 2006410
Change-Id: I4bd06ad405f87f5fb974777fc3d84e4874b4f5bb
When the conductor has debugging enabled, that command is
passed to ipmitool to enable debugging of other commands.
However, this means tons of extra data is dumped as part of
the sensor data collection for ironic, which breaks string
parsing and ultimately metrics collection.
Since we can identify these lines, lets ignore them.
Change-Id: Ife77707210f8289d8f2e0223fb9ee1909d798546
Story: 2005332
Task: 30267
Support for the -y option of ipmitool
Quote from docs:
-y <hex key>
Use supplied Kg key for IPMIv2 authentication. The key is expected
in hexadecimal format and can be used to specify keys with non-printable
characters. E.g. '-k PASSWORD' and '-y 50415353574F5244' are equivalent.
The default is not to use any Kg key.
Change-Id: Ie6a9fc1a41d924e30eff526b3eae929ce6e085c6
Story: #2005158
Task: #29876
teach the ipmitool driver about _get_ipmitool_args and use that in all
cases that we want to build an ipmitool command line. this solves
the problem that the serial console drivers were failing to honor the
ipmi_port setting in driver_info, while it was being correctly used
for power state, etc.
Change-Id: Ifbf6a92c2305567985cfbc41dbf76a076ecb8a7b
Story: 2005138
Task: 29826
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
Some type of BMCs don't support an IPMI option that disable the
behavior of boot device timeout, which makes them never get booted
from PXE.
This patch extends the fix [1] by adding a configuration option,
which provides the default ipmi behavior.
[1] https://review.openstack.org/#/c/616053
Additionally revising the variable/setting names based upon review
feedback and discussion that took place during the 20181210 weekly
ironic team meeting.
Change-Id: Ie049bbaf45aeab54c1272d1d561c5a6ca00dc34a
Story: 2002977
Task: 22985
We can't trust ipmitool to terminate in time. We may have to kill
the process if it's running for longer than we asked it to.
On the other hand, abrupt IPMI exchange termination is said to be
dangerous to the state of the BMC being managed. Therefore this patch
only kills timed out IPMI "power status" call.
For the purpose of killing hung `ipmitool` we inject the time-capped
`popen.wait` call before the uncapped `popen.communicate` is called
internally. Then just kill stuck `ipmitool` process and go on.
Story: 2004449
Task: 28127
Change-Id: I7e1eafb334fe3a3337926aca27c14fe559ce0e39
The IPMI driver unconditionally instructed the BMC not automatically
clear boot flag valid bit if Chassis Control command not received within
60-second timeout (countdown restarts when a Chassis Control command is
received). Some BMCs do not support setting this. Sending the command
aborts the node boot.
A new driver option ``ipmi_disable_timeout`` is added to bypass
sending this command.
Change-Id: I1dda3cf3e4b7b888ed9d8931c8ede3a918dd01f4
Story: 2004266
A future release will change the default boot mode from legacy BIOS
to UEFI. The default boot mode can be set to
[deploy]/default_boot_mode option for hardware types which support
setting boot mode. Otherwise, the default boot mode is hard-coded as
legacy BIOS.
This patch recommends to set boot mode explicitly in a help message of
[deploy]/default_boot_mode option. A warning message is also logged
when a default hard-coded boot mode is used. This message is logged
once even if there are multiple nodes whose boot modes are configured
explicitly for not emitting too many messages.
Change-Id: Ib90ebf59ba72d49cb757e44f3741b5373a411ddf
Story: 2003936
Task: 27475
The option [ipmi]retry_timeout is deprecated at Pike, now it's time
to remove it from the tree.
Change-Id: I921661db2a6f0c85e717e1a80e5f0c8b6c91d369
Story: #2003028
Task: #23052
This change collects boot-relalated functions into
the `boot_mode_utils.py` module to improve code clarity.
Change-Id: I1a2225d503deb382ba6021a6073c81cd03ca3175
Story: 1734131
Task: 10640
This change extends the list of `ipmitool` errors that
ironic treats as retryable on failure.
Change-Id: I5fddc95404a1725f03bd26da51932c3ece5a5a35
Story: 2001989
Task: 19611
Also a few related errors based on some earlier investigation
may have been pulled in along the lines of E305.
Story: #2001985
Change-Id: Ifb2d3b481202fbd8cbb472e02de0f14f4d0809fd
Commit ee5d4942a1 changed the existing
behavior so that if an ipmitool command fails when attempting to set
the power state it causes a failure. The problem with that approach
is that on some systems if the system is already in the desired power
state, an error will be generated when ipmitool tries to change it to
the desired power state.
Now when doing a reboot command we check beforehand to see if the node
is already off, if so then don't attempt to power off the node again.
Also optimize ironic/conductor/utils.py node_power_action() so that it
only checks a node's power status if it might perform an action based
on the node's power status.
Change-Id: If838aae871753ebfbdf359e0bbe3afcc54c4b559
Closes-Bug: #1718794
This is a follow-up patch to the patch so that the power status
is not retried if a power action fails:
ee5d4942a1
It addresses the comments as well as adds more clarification
and updates the documentation to refer to the new
[ipmi]command_retry_timeout config option.
Change-Id: Ib21544da260565ae399e2d07b32af9bd8b810280
Related-Bug: #1692895
The old code blindly required power status even if the power action
failed. Now, it will retry the power action only when it detects a
retryable failure, and will only poll for power status if the power
action is successful. This patch also moves the logic for handling
waiting for power status into the conductor so that the logic is
standardised between drivers.
Change-Id: Ib48056e05d359848386ac057b58921f40b7bdd60
Co-Authored-By: Sam Betts <sam@code-smash.net>
Related-Bug: #1675529
Closes-Bug: #1692895
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
This patch enhances ipmitool power driver to support SOFT_REBOOT
and SOFT_POWER_OFF.
Partial-Bug: #1526226
Change-Id: If01721625c22a578b4311b82104cd895139e3a01
Use hacking 0.12.0
Use the new checks that are available:
[H106] Don’t put vim configuration in source files.
[H203] Use assertIs(Not)None to check for None.
[H904] Delay string interpolations at logging calls.
Fix code so tests pass.
Change-Id: I902e999687b066800e18fafd091571bf718b15f4
Depends-On: I2aa44b62f900d4dfd67701b01eadd0523fbfaf07
This change implements _get_impi_cmd method for
IPMI consoles. Depends on type of console,
ipmi command should contain different arguments.
Change-Id: I55e712a1a91aed3d533f636e519f0bae1f9be2d4
Closes-bug: #1611285
This patch adds missed space between words in docstring of
_set_and_wait() in ironic/drivers/modules/ipmitool.py
Change-Id: I89efe6007d060459021933c85ba18da08670bbbc
This patch adds a missing error check into ipmitool power driver's
reboot so that the reboot can fail properly if power off failed.
Change-Id: Icd061fe51555be3200b154c5e43e0f082864c93f
Closes-bug: #1633992
This adds descriptions to the vendor passthru methods. Previously the
descriptions were not present.
Change-Id: I1257b86a21987f44f36399b79eb22af0766db446
Closes-Bug: #1618179
The constructor for the ipmitool classes are the same but they are
duplicated all over this patch is refactoring that code into a common
function that can be called from the classes constructors.
The VendorPassthru class wasn't checking for the 'timing' option support
of the ipmitool command, it should, this patch is fixing that too.
Change-Id: I456dbb9ef11230d722ff1b1fe5aa142237e0d187
Nova style refactor of config options in Ironic.
- Merge cimc, cisco_ucs options into one file: conf/cisco_ucs.py
- Remove unnecessary import_opts
- Move [amt] group options to conf/amt.py
- Renamed conf/cisco_ucs.py as conf/cisco.py
- Removed netconf.py.
Change-Id: I3c3f5d21de26a9d23ce766c24674f09999f610f5
Closes-Bug: #1561100
This patch is fixing a problem where the ipmitool option "efiboot"
wasn't passed as part of the command to set the boot device for UEFI
nodes causing them to switch back to legacy BIOS.
A FIXME note was left in the code. It seems that ipmitool has a problem
setting the efiboot + persistent options at the same time
(see bug #1611306). It seems multiple options ought to be specified
together, and that works, except for efiboot. Therefore this patch is
using raw bytes to change the boot device when persistent and uefi are
specified, that way it will work for newer and older versions of the
ipmitool utility.
Closes-Bug: #1611306
Change-Id: I11456fb035fe41fe46f1ff04e4d56c9f85b9e19d
This is the follow-up patch of the commit
857372a226. This fix follows
some minor comments of Lucas and Ruby from patch set 29 at the
review: https://review.openstack.org/#/c/293873/. The changes are:
* Fix the docstring of the _start_console() in ipmitool.py to reflect
the real parameters being passed to the method.
* Fix few unittests to use self.assertFalse(<mock>.called) instead of
self.assertFalse(<mock>.call_count)
Change-Id: I25caa9202c8bc867973205d2bf9642064d3ba492
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
When the invoked via the CLI/API the bmc_reset() "warm" parameter will
receive a string, prior to this patch the string would be seem as True
(since the parameter was expecting a boolen) causing the driver to
always reset the BMC in "warm" mode.
This patch fixes the problem by converting the string passed to boolean
inside the method.
Change-Id: I052ef1ee911703c9b7316362aced17b6303b991d
Closes-Bug: #1573614
Add returns tuple with (stdout, stderr) to send_raw() function.
This changes intended for out of tree drivers which use ipmi and
should not double Ironic code base,
example: Iedbb3b906cef7bd5b2d768e926a59820ccd8c196
Change-Id: I4e60825f42ea2b22e13fca251f9918f484408f9a
New dump_sdr() function for dumping SDR data to a file added.
This changes intended for out of tree drivers which use ipmi and
should not double Ironic code base,
example: Iedbb3b906cef7bd5b2d768e926a59820ccd8c196
Change-Id: Ibe0efdbf5133356fc5e7d9129913f9dd0307e9af
Even though an empty ipmi_username and/or ipmi_password is valid, it is
often an error in configuration. Log a warning if either value is
missing.
Add unit tests showing that an unspecified username or an empty string
username are treated the same and will cause no user to be specified.
Add unit tests showing that an unspecified password or an empty string
password are treated the same and will cause a NULL (\0) password to be
used.
Change-Id: I384e210da3216fb9335c4c782d69e606026d4b97
ironic.common.utils.dd(), mkfs(), unlink_without_raise(),
and is_http_url() methods were moved to ironic-lib. This
removes the copies in ironic and updates the code to use
the methods in ironic-lib.
Change-Id: I09c0a037b7979079cbfe5e33cbfd157ea3f3f79d
There's no need to call _parse_driver_info() to convert all
parameters, we can directly use node.uuid.
Change-Id: I88fb5901de91236c67cafb36030fe9bf46824067
This adds support for ipmitools port (-p) option allowing operators
to run ipmi on non-default ports.
Change-Id: I9203c2db01cc46a183901c454e98426b4583ce08
closes-bug: #1523577