The log message had the wrong variable name. Update the variable name
to match the dictionary supplied.
This was detected with my patch which detects mis-formatted log
messages.
Change-Id: Ic352ce13550f811f7d6e2f3dddd54714ea8b2d9b
This removes the timing metric "validate_boot_option_for_trusted_boot"
because the validate_boot_parameters_for_trusted_boot() function is
an internal function that is called by PXEBoot.validate() -- which
is handled by the "PXEBoot.validate" metric. We shouldn't be emitting
metrics for such short-lived, internal functions.
Change-Id: Iaaa573fc4f128d6c3e20faf9c94259b352874eb8
Currently we have a pecan feature enabled that strips extensions
from the end of the URL and treat it like requested content type.
E.g. /v1/nodes.json is treated as /v1/nodes with requested content
type Application/Json. However, this prevents certain node names:
e.g. /v1/nodes/small.1 is treated like /v1/nodes/small with content
type of a man page. It does not make any sense for ironic API,
as we only support Application/Json content type (and .json suffix).
This change disabled this pecan feature. To keep backward compability
a new middleware stips the .json prefix and saves a flag in the
environment about its presence. API accepting names try to find
their resource first without, then with .json suffix.
The following endpoints are special-cased to support names with .json:
* Node GET, PATCH and DELETE
* Ramdisk heartbeat
* Port group GET, PATCH and DELETE
VIF API is not updated, so VIF IDs still cannot have .json suffix.
Change-Id: I789ecfeac9b64a9c4105a20619f7bf5dfc133189
Closes-Bug: #1643995
Historically, we did not have a prohibition upon removing
a VIF entry stored in the extra field, however the VIF
attachment/detachment feature resulted in a task being
created which by default attempts to pull a reservation
lock unless explicitly shared.
This is problematic as part of the process of undeploying
a node as exclusive locks are generated.
Presently, if any of those locked tasks run long, such as
a new image being required or for some crazy reason,
the BMC power request hangs for a few minutes, the VIF
record may be orphaned and never removed, as the
expectation is that nova deletes the VIF record from ironic.
This allows the VIF record to be removed when a node is
no longer in active use and possibly subject to a lock being
held for a long period of time, such as when setting up
for CLEANING.
Additionally, this patch moves the actual VIF record
deletion until after the detachment action in the
event that it fails. This allows for the state in
ironic to be consistent instead of the record
being removed before the detachment occurs.
Change-Id: Ib7544e43a2b26441d4f562b584bbc7fee6a11fea
Closes-Bug: #1743652
In my experience, it happens when Swift storage backing Glance was
purged, but it can probably also happen if an image never had data
at all. This patch raises a correct exception instead of TypeError.
Switch relevant unit tests to Glance V2, as V1 is long deprecated.
Change-Id: I75e5ae7f46ce3a1506ed6108ff05df3083fd5084
Closes-Bug: #1741223
Also remove mentioning of the example configuration file from the
releasing docs, as we've removed it.
Change-Id: I8e2a2adcac7de69c3a03ddd560de96b0972b99e1
Currently the driver_info is passed as is to the ramdisk when calling
get_clean_steps or execute_clean_step. This may lead to their exposure,
as ironic<->ramdisk communication is currently not secure.
This change applies the same logic we use in the API to filter
the fields.
Change-Id: I4fd44786fea6c7092d2b0029cea6d680d31babde
Closes-Bug: #1744836
This patch updates the driver factory logic which sets a default for the
network interface when there is not one set in the config file. Before
this patch the logic forces "flat" as the default network interface for
all hardware types and classic drivers even if flat isn't enabled in the
config file, resulting in a misleading error.
This patch changes the code to only set "flat" as the default for
classic drivers if its enabled in the enabled_network_interfaces
configuration option in the config file, and to not override a default
for hardware types at all because the default for hardware types should
either come from the config file or from the hardware type's
supported_network_interfaces list.
Change-Id: Ia8676d3483ddc78df8766dc1baaf2db6b5686050
Closes-Bug: #1744332
The PowerInterface methods set_power_state() and reboot() were enhanced
to take a 'timeout' parameter [1]. To handle Interfaces that didn't
support timeout, conductor.utils.node_power_action() used
reflection.get_signature() to determine whether or not the node's
PowerInterface's methods could handle a timeout parameter.
It turns out that there was a bug with the
ironic_lib.metrics.timer decorator [2], such that
reflection.get_signature() did not return the method parameters. This
means that for PowerInterfaces that had this decorator, the conductor
would incorrectly think that 'timeout' was not supported, even if it
were supported.
Instead of trying to decide whether a PowerInterface supports 'timeout',
the conductor now assumes that it does. This patch changes all in-tree
PowerInterfaces so that they accept a 'timeout' parameter for reboot()
and set_power_state().
For any out-of-tree implementations that don't accept a 'timeout'
parameter, a TypeError exception will be raised.
[1] f15d5b9a37260b3876f9dadeb030412e6e1053b2
[2] https://bugs.launchpad.net/ironic/+bug/1746730
Closes-Bug: #1746849
Change-Id: Iae28e94c34d4d69593644d0e5f4542558db9bb79
Adds validate_rescue() method to network interface to validate
rescuing network. This method is called by rescue.validate().
Change-Id: Iccac602047eec10f03ef6eaf2dbe716efd6e7f9a
Closes-Bug: #1747100
I've tried my best to provide a correct matching for these, but
there are two exceptions:
* fake_drac uses iscsi deploy with None boot, which cannot work,
so changing both to fake
* some fake drivers are migrated to the 'fake' power interface,
which is changed to include soft power as well.
The latter means that all fake classic drivers now support fake
soft power actions, while previously only fake_soft_power did.
Now fake_soft_power is identical to fake and is left for backward
compatibility
Also wrote more tests to check correctness of this migration.
Change-Id: I00c9c6ed698b10f035e65428e1a20d733c7e544a
Partial-Bug: #1690185
Ideally, the boot interface shouldn't care if it's booting an image for
deploy or rescue. The first step to unwinding this is not passing the
mode argument into the boot interface - for now, we infer it from the
state. Also stop validating whether the boot interface methods have a
mode argument, as this is totally broken anyway (due to the decorator on
the method). The rest of the boot interface's knowledge about deploy vs
rescue can be eliminated in the future, as we shouldn't rework too much
of that during feature freeze.
We fix the bug in validation this way for now, for two reasons:
* This argument really doesn't belong, and it's only been on master for
six days. Get it out before people use it.
* Library updates are currently frozen; fixing the decorator isn't an
option right now.
Change-Id: Icdeb870e9fd9cf836ff7ab97624189c8436adaba
Closes-Bug: #1746730
a piece of code in node object was relying on result of 'assert'
to block negative values of properties.
When running Python in optimized mode (-OO) this assert will be
swallowed and negative values may slip through.
Replace this line with proper if-block.
Change-Id: Iec1edc55219cfd6c54afa52c1ecd0cf76340bddf
The flat driver will use the ironic node uuid as
binding:host_id when ports are bound. Also the
binding:vnic_type will be baremetal so that the mechanism
driver in networking-baremetal can bind the port.
Related-Bug: 1658964
Depends-On: I952c7afbef5e80e3fd2a7f32f11bdc522e1ea397
Change-Id: I7841d59c3590106dd8ac7e625a9db7b47674fe29
I'm not sure why it was missed initially. But if we don't have it,
the automatic migration to hardware types will reset the vendor
interface to no-vendor, which may look like a regression to users.
Change-Id: I6da6aa8138d7f0cbf225c15c4137edeec2c33d49
Related-Bug: #1690185
Oneview hardware type currently performs power operations
using OneView "Press and Hold" mode. There is a
"Momentary Press" and a reboot mode that could be directly
mapped to the different options supported by Ironic.
Closes-Bug: 1722374
Change-Id: I5df8a814384f140b5e5c768c78c57cab7fbdaaa2
Also address small issues in the release note for the migration
to hardware types.
Change-Id: I32998c5508e01882714a76751482a916d066f938
Partial-Bug: #1690185
some tests set a fake tmpdir in config and it may fail during impitool
interface init when creating a task object while checking that this
dir actually exists.
Change-Id: I0d04ca944fe0daf9cc9a8e0ba0fded71733a32be
Includes:
* Return a location in HTTP response header for PUT
/nodes/<node>/traits/<trait>.
* Correct order of arguments to assertEqual() in conductor manager unit
tests for traits.
* Use () rather than \ for multiline formatting.
* Set tags and traits fields on NodeModel to default of [] in DB node
create after DB insert.
Change-Id: Ia88f7ca69b777b82caca2871e44edab39f2a8310
Partial-Bug: #1722194