Expose an async decom.erase_hardware command in the API. Executing
this command simply calls erase_devices on the loaded HardwareManager
implementation.
Change-Id: I238264a4d5903200ad6a30d82b61804c1e3f5916
Add erase_devices method to the HardwareManager class. By default this
method iterates block devices, and calls a new abstract
erase_block_device method for each device. This patch includes a
simple implementation of erase_block_device on the
GenericHardwareManager which attempts to issue an ATA secure erase on
supported devices.
Change-Id: I81da065395b8785f636f1b0a0d60c9f1c045441e
The HardwareManager class was missing a few abstract method
declarations which it is expected to have. Add those.
Change-Id: I1d07b7f08a4fc23929bc09f65b897fdfa0da1770
This adds support for copying configdrives to disks that already have
partitions enabled and labeled for configdrives. This is neccessary for
supporting configdrives on partitioning schemes we don't support yet
(like GPT) or for some future agent iteration where we create partitions
separately.
Change-Id: Iee5b87d82be08febc495aaef3272ced4f2f32235
The readme, leftover from when this was teeth-agent, was still pointing
at the travis-ci build. I removed that build status and added a link to
Openstack How to Contribute wiki page, so people visiting the mirror on
Github know not to create pull requests.
Change-Id: I8a82eb0e04cc35425f7856b16568f191c4c54770
Removed creating separate extension manager for flow extension.
Instead, have made flow extension using the same extension manager
instance which is initialized in agent. It fixes circular
extension loading in stevedore.
Closes-Bug: #1316145
Change-Id: Id339f1876168a41ca43ba7473f3ff6949a233ef3
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
As soon as the agent sends its first heartbeat, it may begin receiving
API calls. As such, we should wait until the server is actually
listening before starting the heartbeater.
Change-Id: Id2984f3f0f50cdb725b10913d38b990f99c48b0a
Introduce `serializable_fields` to express which class attributes
to be serialized.
Get rid of OrderedDict. Just replacing it with regular dict.
Change-Id: I3f7639dab171d3d62e92d0d1bb6d7b071cf963ad
- Apt lists were not getting cleaned out, adding almost 100M of unneeded
stuff to the final image.
- Also removed some unneeded post-build deps
Change-Id: I716aba65ae0e9153a64a359f431d6d8a6adfb4da
This was broken when extensions/ subdirectory was created.
Also add test to ensure this doesn't break again.
Change-Id: I12524a927397c3d2a90d00198873e2e1b4786171
Changing to precise means we don't have both python 3 and 2 installed in
the image, only python 2. Also do some cleanup at the end of the build
since we are exporting the final filesystem, and don't care about the
size of the intermediate layers.
Change-Id: Iac61d4a882aee19214de5dd74bbbaacc8b0f3414
Using systemd-nspawn gives us more flexibility in what hardware the
agent can see. With this setup, the network is not virtualized, and the
/dev inside the container looks nearly identical to the one in the host.
Also added RestartSec=30s to the unit file because without this, systemd
will respawn the agent every 100ms if it dies (say, because DHCP hasn't
completed yet). Since it retries a max of 5 times per 60s, unless the restart value is
set higher it will be marked 'failed' forever and not retry. Adding this prevents that.
Change-Id: Ic64ab4b0824595683e5428464512594dd90eed83
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
This reverts commit 7b8b06c71401b5ce13fc73ed13b0e49e648cba8b.
The wrong function was fixed - it was the heartbeat, not the lookup,
that was checking for the wrong status code.
Change-Id: I35f49ca4fa1295d266f68b72b6ecdd5184181bd5
In the original implementation of this, the latest running container
containing "PICKME" was selected for the container to export. This
creates a race condition.
Instead we now identify the image by a UUID created each run, so that
they will not overlap if multiple builds happen simultaneously.
Change-Id: Iaaf5683435f424517774067a1d95732ad096c988
The existing coreos image required 20G+ of RAM, which isn't reasonable.
Also there was no documentation about how to get the image running, so a
sample configuration with iPXE was added. These changes are required to
help folks who want to use the agent now.
Change-Id: I845bebf17c62653521282863d596ac512dd6b82e
Using docker export gives us only the top filesystem layer and not all
the layers used to build. Resulting image is about 20% smaller. Further
optimizations will be made in future commits via removing build time
deps and temporary files in the Dockerfile.
Change-Id: I0f7ad6d00c6f47836dcd71b05907076701bb2789
(cherry picked from commit 99dba22eaa3961234abde1294e55026fd2cc9d4d)
Prior to the (sync|async)_command decorators, extension methods had to
construct command results themselves, which required that they have
the name of the command being executed.
When the async_command decorator was introduced, we wanted to maintain
the current command interface, so that a command could be made
asynchronous simply by adding the decorator.
The introduction of the sync_command decorator allows us to satisfy
this objective, without requiring decorated methods to accept a
command_name. This patch modifies both decorators to no longer pass
the command_name argument, and modifies existing command methods not
to expect one.
Closes-Bug: #1308021
Change-Id: I1b33bb7519588cdcb79c6f4d2b10c1e5e8c0cca3
Added metaclass statement in base
HardwareManager class. It is necessary
in order to make it really abstract.
Change-Id: I2fa68f8cb11920d85989ba3589b4a394f17d42ae
Instead of special-casing syncronous commands, add a decorator similar
to @async_command(), which can be used to decorate extension methods
for execution as a synchronous command.
Change-Id: I1b27f179f667cb065bcffd71ae0f303b05d33b82
Move extensions under an ironic_python_agent.extensions module. This
change also moves the @async_command() decorator into the base
extension module.
Change-Id: I4021fcc33a30f3460a31bca44a4bf776cd53d488
- Correct directory to match the relative path correctly
- Include additional requirements.txt for coreos image injector
Change-Id: Ie68f86220f2db786e3e97e72fed288b92704d028
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