summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules/ipmitool.py
Commit message (Collapse)AuthorAgeFilesLines
* ipmitool: reboot: Don't power off node if already offJohn L. Villalovos2017-09-271-1/+5
| | | | | | | | | | | | | | | | | | | Commit ee5d4942a1c33736ffe05ec01619142be400c2f4 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
* Follow-up to fix for power action failureRuby Loo2017-07-131-2/+2
| | | | | | | | | | | | | This is a follow-up patch to the patch so that the power status is not retried if a power action fails: ee5d4942a1c33736ffe05ec01619142be400c2f4 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
* Don't retry power status if power action failsJulian Edwards2017-06-271-100/+40
| | | | | | | | | | | | | | 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
* Remove log translations from ironic/drivers Part-1Anup Navare2017-05-091-36/+34
| | | | | | | | 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
* Merge "Ipmitool management driver for Inject NMI"Jenkins2017-01-231-0/+21
|\
| * Ipmitool management driver for Inject NMINaohiro Tamura2017-01-201-0/+21
| | | | | | | | | | | | | | This patch enhances ipmitool management driver to support Inject NMI. Partial-Bug: #1526226 Change-Id: I6def498a6f242b34f647bb670d3fbfcb99fb667a
* | Ipmitool power driver for soft reboot and soft power offNaohiro Tamura2017-01-131-30/+99
|/ | | | | | | | This patch enhances ipmitool power driver to support SOFT_REBOOT and SOFT_POWER_OFF. Partial-Bug: #1526226 Change-Id: If01721625c22a578b4311b82104cd895139e3a01
* Update to hacking 0.12.0 and use new checksJohn L. Villalovos2016-11-081-2/+2
| | | | | | | | | | | | | | 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
* Merge "IPMI command should depend on console type"Jenkins2016-10-201-8/+30
|\
| * IPMI command should depend on console typeAndrey Shestakov2016-10-191-8/+30
| | | | | | | | | | | | | | | | | | 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
* | Merge "Trivial: fix typo in docstring"Jenkins2016-10-181-1/+1
|\ \
| * | Trivial: fix typo in docstringVasyl Saienko2016-10-181-1/+1
| |/ | | | | | | | | | | | | This patch adds missed space between words in docstring of _set_and_wait() in ironic/drivers/modules/ipmitool.py Change-Id: I89efe6007d060459021933c85ba18da08670bbbc
* | Add a missing error check in ipmitool driver's rebootNaohiro Tamura2016-10-181-2/+4
|/ | | | | | | | 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
* Merge "Add description for vendor passthru methods"Jenkins2016-10-121-2/+8
|\
| * Add description for vendor passthru methodsAnnie Lezil2016-10-041-2/+8
| | | | | | | | | | | | | | | | This adds descriptions to the vendor passthru methods. Previously the descriptions were not present. Change-Id: I1257b86a21987f44f36399b79eb22af0766db446 Closes-Bug: #1618179
* | Add a missing whitespace to an error messageHironori Shiina2016-09-301-1/+1
| | | | | | | | | | | | | | This patch adds a whitespace to an error message logged when ipmitool fails. Change-Id: If8902c03827e53b00fca56ee1d5df74b67a3c1a7
* | Refactor common checks when instantiating the ipmitool classesLucas Alvares Gomes2016-09-191-32/+16
|/ | | | | | | | | | | 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
* Merge "Centralize Config Options - patch merge, cleanup"Jenkins2016-08-251-9/+1
|\
| * Centralize Config Options - patch merge, cleanupRamamani Yeleswarapu2016-08-251-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge imports in codeNguyen Hung Phuong2016-08-241-4/+1
|/ | | | | | | | This patch merges all lines importing i18n into 1 line: http://docs.openstack.org/developer/hacking/#imports Change-Id: I828542a62cc577065f3bef9223d25cfe7a939785
* IPMITool: Check the boot mode when setting the boot deviceLucas Alvares Gomes2016-08-111-4/+39
| | | | | | | | | | | | | | | | | 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
* Fix typoGleb Stepanov2016-08-051-2/+2
| | | | | | Fix typo in word from deactive to deactivated. Change-Id: Ia682245445849ee8dffb2e2756b9503ca0f47f51
* Add metrics for the ipmitool driverAline Bousquet2016-08-031-0/+23
| | | | | | Add timing metrics for the methods in the ipmitool driver. Change-Id: I5f0c9421fc186f6ecc927f96abc5bed90b87dfc1
* Minor docstring and unittests fixes for IPMIConsoleDao Cong Tien2016-08-021-1/+1
| | | | | | | | | | | | | | | This is the follow-up patch of the commit 857372a2269cdd0f8a1ae5b9e9f6e0ee193f01be. 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
* IPMITool: add IPMISocatConsole and IPMIConsole classYuiko Takada Mori2016-07-251-10/+82
| | | | | | | | | | | | | | | | | | | 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
* FIX: IPMI bmc_reset() always executed as "warm"Lucas Alvares Gomes2016-04-221-0/+2
| | | | | | | | | | | | | 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 to send_raw() ipmitool functionYuriy Zveryanskyy2016-03-031-1/+4
| | | | | | | | | 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
* Add function for dump SDR to ipmitool driverYuriy Zveryanskyy2016-03-031-0/+28
| | | | | | | | | 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
* Log warning if ipmi_username/ipmi_password missingJohn L. Villalovos2016-02-041-0/+7
| | | | | | | | | | | | | | | 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
* Use ironic-lib's util methodsRuby Loo2016-01-041-2/+3
| | | | | | | | | 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
* Use node.uuid directly in stop_console()Zhenguo Niu2015-12-091-4/+2
| | | | | | | There's no need to call _parse_driver_info() to convert all parameters, we can directly use node.uuid. Change-Id: I88fb5901de91236c67cafb36030fe9bf46824067
* Add port option support for ipmitoolChris Krelle2015-12-081-0/+11
| | | | | | | | This adds support for ipmitools port (-p) option allowing operators to run ipmi on non-default ports. Change-Id: I9203c2db01cc46a183901c454e98426b4583ce08 closes-bug: #1523577
* Validate all tcp/udp port numbersZhenguo Niu2015-11-191-1/+1
| | | | | | | | We introduced a common port validation method validate_network_port, this patch try to validate all port parameters using it. Change-Id: I209b89d2a4c2bbc5619d058f78da2f5f76d1723c
* Validate console port number in a valid rangeZhenguo Niu2015-11-101-5/+1
| | | | | | | | | | Currently in console validate method, we only check whether port is an integer but not validate the port range, this will cause validate success but start console failed. so this patch add port number valid check. Closes-Bug: #1514653 Change-Id: Ibfedaf982511320eb08695ff1aa4b62c4346b1eb
* Fix a bug error by passwords only includes numbersShinn'ya Hoshino2015-10-081-1/+1
| | | | | | | | | | | When an IPMI password consists only of numbers, Ironic fails to create a password file. From the format point of view, these passwords are correct. These are that it is stored to the variable after being converted to an int type, cause errors in the subsequent processing to expect that it is a string type. Change-Id: I85ee2e904fdb0d538f69c7dbfab4c81bb080b8cf Closes-Bug: #1489234
* Allow empty password for ipmitool consoleYuriy Zveryanskyy2015-10-051-1/+1
| | | | | | | | Ipmitool driver allows to use empty password (this is suitable for testing environments for example). This patch fix ipmitool console with empty password. Change-Id: I6b39d067959da873f765a2729d6cee90fa6ac7de
* Merge "When boot option is not persisted, set boot on next power on"Jenkins2015-09-101-0/+31
|\
| * When boot option is not persisted, set boot on next power onZhenguo Niu2015-09-021-0/+31
| | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Try to standardize retrieval of an Exception's description"Jenkins2015-09-081-1/+2
|\ \
| * | Try to standardize retrieval of an Exception's descriptionClif Houck2015-09-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes the use of exc.args[0] and exc.format_message() to retrieve message strings from exceptions in favor of using six.text_type() to maintain compatibility between python 2 and 3. Or through normal type coercion. Adds a __unicode__ method to make things more consistent. Closes-Bug: #1493233 Change-Id: I033c00675a62c0ecaf3e3c2e0bed8b4f79a134e1
* | | Raise InvalidPrameterValue when ipmi_terminal_port is ''Zhenguo Niu2015-09-071-1/+1
|/ / | | | | | | | | | | | | | | | | when we set ipmi_terminal_port to '', there's no InvalidParameterValue exception raised when parsing driver info, as we only check if the port value is an integer type when it is not empty. Change-Id: I4c5b51f37bb5e9c2e013e96c652d5db461caceec Closes-Bug: #1492935
* | Merge "get_supported_boot_devices() returns static device list"Jenkins2015-08-121-2/+3
|\ \
| * | get_supported_boot_devices() returns static device listMatt Keeann2015-08-121-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Returning a static device list currently is only applicable to x86 based architectures. If a node references for instance sparc architecture, then "pxe" boot is not supported, however "wanboot" is. The driver referenced by the node should be able to return a custom boot device list dependent on the architecture of the node. However to achieve this the task needs to be passed as an argument in get_supported_boot_devices() Change-Id: I5ae70ee84309dffb7d7bca4ac5cba28b01b7c414 Closes-Bug: #1391598 Implements: blueprint supported-boot-device-list
* | | Save and re-raise exceptionRuby Loo2015-07-281-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an exception is raised, we do "some stuff" and re-raise that original exception. This uses oslo_util's excutils.save_and_reraise_exception to do this, to handle the case where "some stuff" causes the exception context to be cleared (which would have resulted in None being attempted to be re-raised). Change-Id: I4b92915ae77fab9cde1787053152a497512401e2
* | | Make use of tempdir configurationchenglch2015-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Some code around temp file does not honor the conf file setting for tempdir. This patch aims to make use of this setting. Change-Id: Ie4a0c2337be5811c06dd9aab45ff917b06669a7b Closes-bug: 1428763
* | | Merge "Validate IPMI protocol version for IPMIShellinaboxConsole"Jenkins2015-07-021-0/+6
|\ \ \
| * | | Validate IPMI protocol version for IPMIShellinaboxConsoleLucas Alvares Gomes2015-06-301-0/+6
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Serial over lan using ipmitool only works with IPMI protocol version 2.0 (-I lanplus). This patch is adding a check in the validate() to catch that. This patch also adds missing tests for the validate() method of that class. Related-Bug: #1468378 Change-Id: Ib4baa360adb45c6dd8b9c923cacadace6e693b91
* | | Mute ipmi debug log outputstephane2015-06-301-4/+13
|/ / | | | | | | | | | | | | | | | | | | | | We run ipmitool with the -h flag to confirm what command-line flags it has. Unfortunately, this creates output in the debug logs which can be confusing since it looks like something broke. Use subprocess.check_call to confirm we have the right options, and redirect the noisy, misleading output. Change-Id: I6561ec8523d9bcb647255417824ab70d4203e3d1 Closes-Bug: #1469235
* | Merge "Switch to oslo.service"Jenkins2015-06-291-1/+1
|\ \
| * | Switch to oslo.serviceSergey Vilgelm2015-06-291-1/+1
| |/ | | | | | | | | | | | | oslo.service has graduated, so ironic should consume it. Change-Id: Iaa1ca0d97b92b9a6858b2c2d50eb514cc2118762 Closes-Bug: #1466851