Debugging the agent is a huge pain point. Tracebacks are rarely logged,
error messages are often only returned via the API, and lack of
info logging makes it hard to determine where some failures occur.
Some errors only return a 500 with no error message or logs.
Change-Id: I0a127de6e4abf62e20d5c5ad583ba46738604d2d
This patch add Python 3 support for IPA. We still need to enable it on
gate to avoid code breaking the support from sneaking in.
Partial-Bug: #1474896
Depends-On: I5a774eaa8d978f4d50faca4dc1b03a87fb194ce2
Change-Id: If47c0797b63d2914b3c47aba62ec5201301b6c33
Was running into 'expected string, int found' when calling
shred with an Int for iterations.
Change-Id: Iffce247caba5b0d62ac89b6411402c8d975cfd2f
Closes-Bug: #1469838
When writing to a host device, possibly one that does not support holes,
it is preferable to use host_device instead of the raw mode. Not doing so
means holes are simply skipped and the deployed image is invalid.
Change-Id: I24f8b4daf099af8bb03c3a4f6417b6c87bd49021
Closes-Bug: #1466632
Today, there is no option to configure number of iterations to be
done for shred block device erasing and defaults it to 1. This patch
adds a configuration option to change the number of passes to be done
to erase a block device.
Change-Id: I1921d33a6b364c4682b6c9baaf61ac092cfa11d7
Partial-Bug:#1465130
This commit adds a new command power_off to
standby extension which runs shutdown -h now
on the system. This commit also adds mappings
for /proc and /sys in cloud-config.yml for the
agent service spawned.
Partial-Bug: #1451310
Change-Id: I2a5f984af26bbbe03002bb8c367c8c6af8d91434
This does a few things:
* Update hacking to the version in global-requirements. Old hacking was
installing a version of pbr that was breaking other packages.
* Fix all the hacking/pep8 rules that updating hacking raised.
* Do some general docstring cleanup, while already in there cleaning up
a bunch of docstrings due to H405 violations.
Change-Id: I1fc1e59d4c3d7b14631f8b576e3f3854bc452188
Closes-Bug: #1461717
This commit echoes '1' to >/proc/sys/kernel/sysrq to
make sure that sysrq functions are enabled before
invoking them.
Change-Id: I88697efbc1bd0dec5ed4cbcd8d89b0b5d0734bdd
in-band disk erase using shred fails with error "'module' object has no
attribute 'ProcessExecutionError'". This commit is to fix the issue.
Change-Id: Ia0c426074b2f0e9d534ed96a3e213933160edc61
Closes-Bug:#144799
In-band disk erase using shred fails for agent_ilo driver as it tries to
erase the virtual floppy device attached.This fix is to skip the virtual
media devices and continue with other disks.
Change-Id: I26745985382d440f7d4b3fbfffb14545067fcca6
Closes-Bug:#1450298
When using virtual media, restarting ironic-python-agent
leads to errors like 'File exists'. This is because
we use static directory (/vmedia_mnt) as mount path
and we don't remove it. It's better to use mkdtemp to create
a temporary directory for mounting virtual media
device.
Change-Id: Ibb4c3d3a2024cf51ef198bd396fb9e86ad72a320
The docstrings here were all giving WARNINGs or ERRORs during the docs
build, and were generally making unappealing looking developer
documentation. I corrected the syntax and did what was neccessary to
make the build come out clean.
Change-Id: I74b00a7f125770b0468cff3bdf26d0d52cd054d7
(cherry picked from commit c0921cdff372ce1fd6df1c4ab4eb5463e2cba0e4)
This adds and configures a sphinx doc builder. This is based on the code
in Ironic to build documentation.
The goal is for this to contain development documentation relevant to
hacking on the agent, including how to make custom HardwareManagers.
Change-Id: Ib6cecb9959f4ad5c71440fb37827b996582a9545
This commit adds running 'udevadm settle' after
running partx so that the partition table is re-read
properly by lsblk which follows it.
Closes-bug: 1432918
Change-Id: I1c7dddd3ed8cab175e608e09ecc4ae7f289cfc31
partx -u $DEVICE doesn't work in some cases, but partprobe $DEVICE fails
in virtual environments (like devstack). For now, run both commands and
ignore partprobe failures.
Moving forward, this shell should be factored into python and share code
with the other partition-modifying code added this cycle.
Change-Id: I7e4c010e260be2a23dcc894bc0c1b30aea949084
Partial-bug: 1433812
This prevents devices from failing cleaning if they don't support ATA
security erase. Instead, the device will be erased by overwriting using
GNU shred.
Change-Id: Ie4f88b97c8c34efe2397538662622abd0b963aea
This will add support for in band cleaning operations to IPA and
replace the decom API that was unused.
Adds API support for get_clean_steps, which returns a list of
supported clean steps for the node, execute_clean_step, to execute
one of the steps returned by get_clean_steps.
Adds versioning and naming for hardware managers, so if a new hardware
manager version is deployed in the middle of cleaning/zapping, the
cleaning/zapping will be restarted to avoid incompatabilities.
blueprint implement-cleaning-states
blueprint inband-raid-configuration
blueprint implement-zaping-states
Depends-On: Ia2500ed5afb72058b4c5e8f41307169381cbce48
Change-Id: I750b80b9bf98b3ddc5643bb4c14a67d2052239af
This commit adds support for uefi systems in the image
extension so that grub can be installed onto efi system
partition for uefi machines.
Implements: blueprint local-boot-support-with-partition-images
Change-Id: I8fbb4b2ebdff991d41c7b618a4d654af26311a56
Address a nit in previous review: test_get_agent_params_from_cache
should assert that _set_cached_params is never called.
Change-Id: I4724bd15ee923a9272aa872641430f3dfbef3fec
When parameters are passed to agent through virtual
media, the device might be connected only for a short
while (dur to swift temp-url expiration, ironic removing
the floppy image, etc). This change will enable agent
to cache the parameters and use it for any time later on.
After caching, the agent parameters need not be re-read
from /proc/cmdline or from the virtual media device.
Implements: blueprint ipa-as-default-ramdisk
Change-Id: Ia8c7020c91c987ec884c5640421f0583dbf1c3d9
This patch add support for root device hints on IPA. Instead of picking
the first disk >= 4G, if the hints are specified IPA will look at it
to decide which device it should pick for the deployment. The initial
patch supports the following hints: Size, model, WWN, serial, vendor.
Implements: blueprint ipa-as-default-ramdisk
Implements: blueprint root-device-hints
Change-Id: I2b00b3fb3b61001033750dd8951f9353d6f2e361
This allows the agent to call a method on all hardware managers
that support the hardware and return a list of their responses. This
will be useful for implementing get_clean_steps() in cleaning.
Also fixes a leaky test in dispatch_to_managers. The function
wrapper was holding global state, which leaked into other tests
if a function was called again later, messing up the call count.
Implements blueprint implement-cleaning-states
Change-Id: I76bf8ec18df1dc16c4b9d942800b8a1efcde9e65
This commit changes agent deploy ramdisk to find out
the virtual media device by using labels instead of
looking at the model of block device. This helps in
finding out the device irrespective of the hardware.
Corresponding Ironic change is
If5b78d9af7048f2631d050ee5ce01ab7a67e2354.
Closes-Bug: 1429340
Change-Id: Ib6cc226dc4fb341d913f707737493c31a3f77152
This commit mocks os.path.exists in the test case
test_start_iscsi_target_fail_wait_daemon in
extensions.iscsi.TestISCSIExtension. If this isn't
mocked, the file can coincidentally exist on the
environment and can cause failure.
Change-Id: Ibaa8fcae51faaaefc2764411d02621f347d99c03
This commit changes ExecuteCommandMixin to store the
actual exception in SyncCommandResult instead of just
the message in the exception. This is required in the
API side where the result.command_error is trasformed
to base.ExceptionType.
Closes-bug: 1430896
Change-Id: I222bfc11868e73c7da03c84723f1450e38aa1a2f
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
Initially this extension supports installing a bootloader so the user
image can boot from the local disk.
Change-Id: Ia588aafc240b55119c02f1254addc0cf796f88c5
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
Some of the extensions in IPA currently do not return any values
from their respective command methods. This results in a lack of a
paper trail of the command_result value to the point where it is
not possible to know more information than a boolean result of if
a command succeeded or failed.
This change adds more logging to the extensions and provides return
values which are used in the command_result property on
(Async|Sync)CommandResult instances to provide useful debug info.
While creating this patch several unit tests for *CommandResult objects
were found to be using invalid data that would not pass validation
if returned in API results. Those have been corrected in this patch.
Change-Id: I23bae25a83881e7013c93d73f858c622ea941253
Closes-Bug: 1408080
Currently, we only log the image ID and attempted URL. Now, we log the
status code recieved and detailed information about how and when things
failed.
Change-Id: I718c7facbe1500d98be78b7b6137e92fdfb2fdf1
Closes-bug: 1420981
Depends-On: I69f6f6eef4ad573f406d64d579a9811c70ac5d28