summaryrefslogtreecommitdiff
path: root/ironic_python_agent/cmd
Commit message (Collapse)AuthorAgeFilesLines
* Capture the early loggingJulia Kreger2021-04-011-1/+1
| | | | | | | | | | | _early_log prints to stdout, which is fine in some cases, however in other cases it gets lost in the shuffle of process launch by things like systemd. Lets try to save everything, and re-log it so it is easy to debug early issues. Change-Id: I334a9073d17cccec4c669fae82edc3e388debc5c
* Do not permit IPA standalone to be enabled by confJay Faulkner2021-03-251-1/+1
| | | | | | | | | | IPA standalone mode is a developer-only option, and if enabled accidentally on a production agent could cause undesired behavior. Developers who need this behavior should build a purpose-built agent, with standalone hardcoded to True in cmd/agent.py. Change-Id: Icc67dbe15acbbf6fee886f274d2169a0769a5053
* Copy any configuration from the virtual mediaDmitry Tantsur2020-11-231-0/+5
| | | | | | | | | | | | | | | For ramdisk TLS (and other potential future enhancements) we need to be able to inject configuration and certificates into the ramdisk. Since we cannot pass files through kernel parameters, we need to put them on the generated ISO or (in the future) config drive. This change detects IPA configuration and copies it into the ramdisk early enough for any configuration files to get picked. Changed /dev/disk/by-label to blkid since the former may not exist on all ramdisks (e.g. tinyIPA). Change-Id: Ic64d7842a59795bbf02f194221dedc07c6b56e8c
* Log configuration options on start-upDmitry Tantsur2020-11-111-0/+8
| | | | | | | | | This is very convenient for debugging and is something ironic and ironic-inspector already do. Register SSL options earlier so that they're accounted for. Change-Id: I56aca8eec1dfeb065ac657452a7076a9e3d17cc3
* Support changing the protocol part of callback_url to httpsDmitry Tantsur2020-08-061-1/+2
| | | | | | | | | Adds a new kernel parameter for manual configuration and also creates foundation for automatic TLS support later. Change-Id: If341c3a8a268fc8cab6bd6be04b12ca32b31c8d8 Story: #2007214 Task: #40619
* Agent token supportJulia Kreger2020-03-121-0/+1
| | | | | | | | | | | | Adds support to the agent to receive, store, and return that token to ironic's API, when supported. This feature allows ironic and ultimately the agent to authenticate interactions, when supported, to prevent malicious abuse of the API endpoint. Sem-Ver: feature Change-Id: I6db9117a38be946b785e6f5e75ada1bfdff560ba
* manual introspection trigger commandJulia Kreger2019-07-081-0/+30
| | | | | | Change-Id: I64e66682c1e54f6edc260a22f46f5f6df8e85af1 Story: 2005896 Task: 33756
* Remove old lookup/heartbeat from IPAPavlo Shchelokovskyy2016-11-091-1/+0
| | | | | | | | | | | Lookup/Heartbeat via vendor passthru was deprecated in Newton. This patch removes the corresponding functionality from IPA, and also removes handling of 'ipa-driver-name' kernel parameter, as it was only used in code related to old passthru. Change-Id: I2c7989063ab3e4c0bae33f05d6d2ed857a2d9944 Closes-Bug: #1640533
* Use namedtuple to improve code readabilityJohn L. Villalovos2016-08-301-2/+4
| | | | | | | | | | Use the namedtuple class to improve code readability by creating a Host class with namedtuple to store the 'hostname' and 'port' Replace foo[0] with foo.hostname, and foo[1] with foo.port to make code more readable. Change-Id: Ie2b5f9cf89e7ccbbcf0a2573dab6f6c5d14c018b
* Consolidate IPA configuration into a config moduleSam Betts2016-05-311-117/+2
| | | | | | | | This patch moves the IPA oslo configs out of the agent cmd into their own module so that it is safe to import them from other places in the application without causing circular imports. Change-Id: I100792bd0d1f369763afaa6f93e144e9967c3048
* Add a configurable sleep before IPA starts workingDmitry Tantsur2016-05-241-1/+7
| | | | | | | | | | | | | | | | | Some kernel modules take substantial time to initialize. For example, with mpt2sas RAID driver inspection and deployment randomly fail due to IPA starting before the driver finishes initialization. As much as I hate it, the only way to guarantee that the hardware is truely initalized is to wait for it. Apparently all hardware in Linux is treated as hotplugged, so there is no such thing as "hardware initialization is finished". Operators can add a sleep based on their knowledge of their hardware. The default behaviour remains the same. Change-Id: I0446ae81d760dacaf31eea6ad9f9eaa098cf5e93 Partial-Bug: #1582797
* [inspection] wait for the PXE DHCP by default and remove the carrier checkDmitry Tantsur2016-05-101-2/+10
| | | | | | | | | | | | | | | | | | | | | | | We hoped that checking /sys/class/net/XXX/carrier will allow us to not wait for interfaces that are not connected at all. In reality this field turned out to be unreliable. For example, it is also set to 0 when interface is down or is being configured. The bug https://bugzilla.redhat.com/show_bug.cgi?id=1327255 shows the case when carrier is 0 for all interfaces, including one that is used to post back data, which is obvious non-sense. This change removes check on carrier for the loop. To avoid 60 seconds wait for people with several NIC's, it's changed to only wait for the PXE booting NIC, which obviously must get an IP address. This makes IP addresses in the inspection data for other NIC's somewhat unreliable. A new option inspection_dhcp_all_interfaces is introduced to allow waiting for all NIC's to get IP addresses. This change should finally fix bug 1564954. Change-Id: I8b04bf726980fdcf6bd536c6bb28e30ac50658fb Related-Bug: #1564954
* Wait for the interfaces to get IP addresses before inspectionDmitry Tantsur2016-04-051-0/+7
| | | | | | | | | | | | | | | | | | | | | In the DIB build the DHCP code (provided by the dhcp-all-interfaces element) races with the service starting IPA. It does not matter for deployment itself, as we're waiting for the route to the Ironic API to appear. However, for inspection it may result in reporting back all NIC's without IP addresses. Inspection fails in this case. This change makes inspection wait for *all* NIC's to get their IP addresses up to a small timeout. The timeout is 60 seconds by default and can be changed via the new ipa-inspection-dhcp-wait-timeout kernel option (0 to not wait). After the wait inspection proceedes in any case, so the worst downside is making inspection 60 seconds longer. To avoid waiting for NIC's that are not even connected, this change extends the NetworkInterface class with 'has_carrier' field. Closes-Bug: #1564954 Change-Id: I5bf14de4c1c622f4bf6e3eadbe20c44759da5d66
* Allow enabling debug level via kernel cmdlineDmitry Tantsur2016-02-261-0/+6
| | | | | | | Adds a new kernel option "ipa-debug" which can be set to "1" or "true" to enable debug logging. Change-Id: Iafe9a9b8b718280920005726e0f7e69e3f0a320c
* Enforce all flake8 rules except E129John L. Villalovos2015-10-021-13/+13
| | | | | | | | | Bring ironic-python-agent in line with the other ironic projects. Stop ignoring all E12* errors except E129 Stop ignoring E711 Change-Id: Icb9bc198473d1b5e807c20869eb2af7f4d7ac360
* Fix default ironic api port numberNaohiro Tamura2015-09-231-1/+1
| | | | | | | | | | | | | This patch corrects the default ironic api port number to 6385 from 6835. The default value of 'ipa-api-url' is not used in production environment since conductor and bare metal node have its own IP address, but could be used in development environment. Therefor this patch fixes this trivial error. - default=APARAMS.get('ipa-api-url', 'http://127.0.0.1:6835'), + default=APARAMS.get('ipa-api-url', 'http://127.0.0.1:6385'), Change-Id: Idb85e95b354a68111f94e8cddd5c1b6227e676ef
* Add support for inspection using ironic-inspectorDmitry Tantsur2015-09-071-0/+14
| | | | | | | | | | | | | Adds a new module ironic_python_agent.inspector and new entry point for extensions, which will allow vendor-specific inspection. Inspection is run on service start up just before the lookup. Due to this early start, and due to the fact we don't even know MAC address of nodes on inspection (to say nothing about IP addresses), exception handling is a bit different from other agent features: we try hard not to error out until we send at least something to inspector. Change-Id: I00932463d41819fd0a050782e2c88eddf6fc08c6
* Add docstrings for cmd/agent and extensions/cleanJay Faulkner2015-09-031-0/+1
| | | | | | | | Adding documentation for methods in these files that were missing docstrings. Change-Id: I2ad9f85605720ab2295dec3d0436ff0af07847c2 Partial-bug: 1367915
* Enable --debug for debug loggingJosh Gachnang2015-08-281-1/+3
| | | | | | | | | | oslo_log wasn't getting the correct config values passed in, so adding '--debug' to the command line wouldn't enable debug logging. Added docs about --debug and --standalone (the only two flags I've seen used/supported). Change-Id: Ie1ba64992444a65a40f2d65933942153b93e70c1
* Use oslo_log libGhe Rivero2015-03-241-2/+3
| | | | | | | Module 'log' from oslo-incubator was removed after release of oslo_log library. Change-Id: Ia00e26071fc0cab4fd3f3334ca94860bc7b1c75c
* Move _get_agent_params() to a common placeLucas Alvares Gomes2015-03-101-104/+1
| | | | | | | | | The function _get_agent_params() parse the parameters passed to the agent via kernel cmdline or vmedia. Other parts of the code needs to access these parameters as well, so this patch is moving _get_agent_params() and the related functions to a common place (utils.py). Change-Id: I860f84d1d13511fff56d4aa56358ee597a9760d5
* Enable setting standalone mode via APARAMSJay Faulkner2015-02-271-1/+1
| | | | | | | | | | | All other IPA options are settable via APARAMS (kernel command line or the kernel commandline-like interface provided by virtualmedia). Being able to set this at PXE time allows for operators to boot and functionally test new agent images without having to recompile post testing (to change standalone setting). Change-Id: Ie796a98c995704db09945b6f890e9bf4d07eaa1a Closes-bug: 1426546
* use oslo_config replace oslo.configjiangfei2015-02-071-1/+1
| | | | | | | | | oslo.conifg 1.6.0 has moved its namespace from old oslo.config to oslo_config requirements has updated to oslo.conifg 1.6.0 Change-Id: I16b8dc680f8a7697b7fbbd888f5162d924b4c0fe
* Merge "Add standalone mode for IPA"Jenkins2015-01-061-5/+9
|\
| * Add standalone mode for IPAJosh Gachnang2014-12-161-5/+9
| | | | | | | | | | | | | | | | This allows a developer to run IPA without an Ironic API. This can be useful for testing (especially functional testing) or testing integration of things like hardware managers. Change-Id: I2dc49fbe306430bf5b05a36fe56de5275fc128b2
* | Merge "Use oslo.utils and oslo.concurrency"Jenkins2014-12-171-1/+1
|\ \ | |/ |/|
| * Use oslo.utils and oslo.concurrencyOleksii Chuprykov2014-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | Update openstack/common files and use oslo.utils, oslo.concurrency instead of modules from oslo-incubator. Additionally, sort and set requirements.txt to correct versions in openstack/requirements in order to ensure pep8 passes. Change-Id: I15f88a31a4c889bba27cd0cd1c7fc481c0c0b51e
* | Use LLDP to get switch port mappingJim Rollenhagen2014-12-091-1/+5
| | | | | | | | | | | | | | | | | | Provides a function to listen for LLDP packets on the network. Listens on one or all of the network interfaces, and then parses the found packets. Change-Id: I1545a41f46cd0916aab9c43ce036865454fa66e0 Co-Authored-By: Josh Gachnang <josh@pcsforeducation.com>
* | Fix badly named function _get_kernel_params()Clif Houck2014-12-051-14/+14
| | | | | | | | | | | | | | | | | | | | Renamed _get_kernel_params() to _get_agent_params() and appropriate module-level attribute KPARAMS to APARAMS. Updated agent tests to match new function name. Change-Id: I4cdf1defee7487785967a092c81c906d40bf3214 Closes-Bug: #1367917
* | Merge "Use _ instead of - for config options"Jenkins2014-12-031-11/+22
|\ \ | |/ |/|
| * Use _ instead of - for config optionsjiangfei2014-12-031-11/+22
| | | | | | | | | | | | | | | | | | | | Config options containing "-" don't work when reading configuration from a file; change these to "_". Leave the old options for backwards compatibility. Closes-Bug: #1386486 Change-Id: Ie10a548191effa2a505309d9d4ee32003f9676a2
* | Improve docstrings for cmd/agent.pyJay Faulkner2014-11-141-7/+21
|/ | | | | | | | Added missing docstrings and improved existing docstrings for every method in cmd/agent.py Change-Id: Ib8dbbf70bca139a43d75d59fb09dce899466e888 Partial-bug: 1367915
* Add vmedia boot support in IPARamakrishnan G2014-09-021-2/+78
| | | | | | | | | | This commit adds support for booting IPA from virtual media cdrom. When IPA is booted over virtual media cdrom, the parameters to the IPA are passed in a text file within the virtual media floppy. Change-Id: Ia04585416aada85022af73fb2b945bd3895606f0 Closes-Bug: #1358723
* Tries to advertise valid default IPEllen Hui2014-06-101-1/+19
| | | | | | | | | | | During the first heartbeat, the heartbeater asks the agent to check its advertised address; if the advertised IP is still the default (None), the agent tries to replace it with the IP of the first network interface it finds. If it fails to find either a network interface or an IP address, the agent raises an exception. Change-Id: I6d435d39e99ed0ff5c8b4883b6aa0b356f6cb4ae Closes-Bug: #1309110
* Switch to oslo.config for CLI parsingRussell Haering2014-05-281-73/+59
| | | | | | | | Use oslo.config instead of argparse for CLI parsing. As a side effect, a bunch of logging arguments including --debug become available with this change. Change-Id: Ia8c4e91448f2a8cb15eb570125ac9c236e13274c
* Accept new parameters for `prepare_image`Jim Rollenhagen2014-04-241-1/+2
| | | | | | | | | | | | | | | | | | The parameters sent to `prepare_image` changed in https://review.openstack.org/#/c/86490/ This patch brings `prepare_image` up to date with that change. It also changes the way configdrive is written to disk, to match that Ironic is now allowing Nova to build an ISO partition and send the raw image to the agent. This patch also swaps out subprocess.call for processutils.execute in the standby module, since the commands were being changed anyway. Lastly, this patch changes the expected `hashes` dict to be a string parameter called `checksum`, to match what glance returns. Change-Id: Id8af9be920ba51e7e1ce60f4ffd1477e413582c9
* Use configurable driver name in lookup URLJim Rollenhagen2014-04-141-1/+8
| | | | | | | | | Allow configuration via command line arguments or kernel parameters. Default to agent_ipmitool, the reference driver. Depends on https://review.openstack.org/#/c/84795/12 Change-Id: I55c4a8713308d038002a6567471cd862bf89ec76
* Kill the build_agent functionRussell Haering2014-04-141-7/+5
| | | | | | | This used to actually do things, now it just wraps the constructor. Lets kill it. Change-Id: I320684f8f52d032a1755460eacc70f5aeee92d7a
* Use # instead of """ for copyright blocksJim Rollenhagen2014-04-102-30/+13
| | | | | | | Reformats copyright messages to be comments rather than docstring-style blocks. Change-Id: I4d863f53b67bb49d03bda0952b9e6179b6d23c59
* Add kernel parameter supportJim Rollenhagen2014-04-011-10/+43
| | | | | | | Allow the agent to read arguments from the kernel command line. Priority is: agent command line, kernel command line, defaults. Change-Id: Idfd43a8b7fdf6c368cf55d45b32cb7bcfbb56212
* Adding DynamicLoopingCall around lookupJosh Gachnang2014-03-311-1/+16
| | | | | | | | | Currently, if a single lookup call to the Ironic API fails, the entire agent errors out and restarts. This allows the agent to retry for a set amount of time before throwing an uncaught exception forcing a restart. Change-Id: I39752fb3f42ad3e4f15a49194f1554e1d3463cf8 Closes-Bug: 1297019
* Replacing teeth/overlord with ipa/ironicJosh Gachnang2014-03-191-3/+3
|
* Renaming to IPAJosh Gachnang2014-03-192-0/+70