832 Commits

Author SHA1 Message Date
Ruby Loo
9a2ebde83f Remove validate_boot_option_for_trusted_boot metric
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
2018-02-08 18:04:43 -05:00
Zuul
c752f4928e Merge "correct grammar, duplicate the found" 2018-02-08 08:41:04 +00:00
Ruby Loo
b631c0f4ee [reno] timeout parameter worked
We thought that the 'timeout' parameter that was specified for a
node's power state transition wasn't working for ipmitool, irmc,
and oneview power interfaces, but it turns out that it was working.
This updates the release note to reflect that.

Change-Id: Icc439179a3790f109d42c5014b11defbfd6c2127
Related-Bug: #1746849
2018-02-07 20:09:17 -05:00
Zuul
9ab04d0962 Merge "Stop guessing mime types based on URLs" 2018-02-08 01:04:02 +00:00
Zuul
b73b8bc8fb Merge "Don't try to lock for vif detach" 2018-02-08 01:03:56 +00:00
Zuul
f37c8dd535 Merge "Clean up release notes before a release" 2018-02-07 23:09:08 +00:00
Dmitry Tantsur
cfc167eadf Stop guessing mime types based on URLs
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
2018-02-07 20:58:35 +00:00
Dmitry Tantsur
3aaf4922f1 Clean up release notes before a release
Also add a prelude for the whole Queens release.

Change-Id: I689e9f4f8d6a7c1877cf39ba0e6e232a20930e90
2018-02-07 20:19:02 +00:00
Zuul
f582f51686 Merge "Handle case when a glance image contains no data" 2018-02-07 19:40:20 +00:00
Julia Kreger
4f79cb3932 Don't try to lock for vif detach
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
2018-02-07 10:23:47 -08:00
Zuul
765a6ef4c4 Merge "Fix handling of 'timeout' parameter to power methods" 2018-02-07 16:14:19 +00:00
Zuul
273e2c2c74 Merge "Do not pass credentials to the ramdisk on cleaning" 2018-02-07 15:55:00 +00:00
Dmitry Tantsur
70039cbe60 Handle case when a glance image contains no data
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
2018-02-07 13:45:55 +01:00
Zuul
abb14290fb Merge "Only set default network interface flat if enabled in config" 2018-02-07 11:45:04 +00:00
Dmitry Tantsur
c2185469c4 Do not pass credentials to the ramdisk on cleaning
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
2018-02-07 12:22:26 +01:00
Zuul
ccf5e16773 Merge "correct grammar, duplicate the found" 2018-02-07 09:45:36 +00:00
wangdequn
e06e0c59b1 correct grammar, duplicate the found
Change-Id: Ie827e14ae25c7a211061444a81c00757d7cc4ac7
2018-02-07 17:42:40 +08:00
wangdequn
e62a94ef47 correct grammar, duplicate the found
Change-Id: If785e0e643263c7cbcf76a15f6f778013af42812
2018-02-07 11:21:19 +08:00
Sam Betts
aed4834121 Only set default network interface flat if enabled in config
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
2018-02-06 18:21:00 +00:00
Ruby Loo
9e87cebc12 Fix handling of 'timeout' parameter to power methods
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
2018-02-06 08:33:45 -05:00
Zuul
12d3157a96 Merge "Add validate_rescue() method to network interface" 2018-02-05 17:11:45 +00:00
Shivanand Tendulker
9a110e01bd Add validate_rescue() method to network interface
Adds validate_rescue() method to network interface to validate
rescuing network. This method is called by rescue.validate().

Change-Id: Iccac602047eec10f03ef6eaf2dbe716efd6e7f9a
Closes-Bug: #1747100
2018-02-05 03:00:12 -05:00
Zuul
e8cf57fa6a Merge "Remove sample policy and config files" 2018-02-03 16:35:38 +00:00
John Garbutt
d336978834 Remove sample policy and config files
Now we have docs, lets point people there rather than attempting to
maintain a copy in tree.

Also update the devstack plugin to know nothing about policy.json, as it
never allowed for customizing the location or the contents anyhow, and
to build ironic.conf from scratch rather than from the sample.

Change-Id: I10a4987204eb335f1fed29d4b1d7f3e075aa1792
2018-02-02 11:21:29 +00:00
Zuul
dce62691f7 Merge "Migrate the remaining classic drivers to hardware types" 2018-02-01 22:05:54 +00:00
Zuul
4d5ccb5b9d Merge "Follow-up for Switch OneView driver to hpOneView and ilorest libraries" 2018-02-01 17:49:19 +00:00
Dmitry Tantsur
d1062cfbdd Migrate the remaining classic drivers to hardware types
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
2018-02-01 18:38:24 +01:00
Zuul
d4e35611c4 Merge "Deprecate classic drivers" 2018-02-01 11:09:59 +00:00
Zuul
f1e5b92e44 Merge "Flat networks use node.uuid when binding ports." 2018-02-01 11:07:27 +00:00
Zuul
366b29b24f Merge "Add missing ilo vendor to the ilo hardware types" 2018-02-01 10:26:14 +00:00
Zuul
b8af1cd853 Merge "Soft power operations for OneView hardware type" 2018-01-31 19:54:28 +00:00
Zuul
eeeff800b3 Merge "Follow-up for Implementation for UEFI iSCSI boot for ILO" 2018-01-31 16:54:18 +00:00
Harald Jensas
cd7fd1feff Flat networks use node.uuid when binding ports.
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
2018-01-31 16:58:18 +01:00
Dmitry Tantsur
8f464b909a Add missing ilo vendor to the ilo hardware types
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
2018-01-31 16:49:56 +01:00
Hugo Nicodemos
c924a374c4 Follow-up for Switch OneView driver to hpOneView and ilorest libraries
This patch addresses comments for patchs related to
bug #1693788

Change-Id: I1fbab4674050bfbd94882c65686881867b100191
Related-Bug: 1693788
2018-01-31 12:02:19 -03:00
Stenio Araujo
24df981b58 Soft power operations for OneView hardware type
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
2018-01-31 14:41:53 +00:00
Dmitry Tantsur
02378fdcde Deprecate classic drivers
Also address small issues in the release note for the migration
to hardware types.

Change-Id: I32998c5508e01882714a76751482a916d066f938
Partial-Bug: #1690185
2018-01-31 13:26:53 +01:00
paresh-sao
bf304a62e3 Follow-up for Implementation for UEFI iSCSI boot for ILO
This patch addresses outstanding comments for commit
87636372559fa6d83bb51eaaae075ac5e5575c17

Change-Id: I106f36cc3e9be2dee862e13d8e6621328e4f7959
2018-01-30 07:11:03 +00:00
Jim Rollenhagen
3b8c3879a5 Explicitly mark earliest-version for release notes
This uses reno's `earliest-version` directive to explicitly point out
where the release notes for a given branch should begin. There is a bug
in reno when dealing with stable branches, where it does not always find
the correct version to begin with.

It also updates our release docs to indicate we should continue marking
this. This step can be removed when the reno bug is fixed, though it
doesn't hurt to continue marking this explicitly.

Change-Id: I6502ff95a52c2c855356e9875291f27ec44e7ffa
Related-Bug: #1746076
2018-01-29 14:15:01 -05:00
Zuul
ab9b7afe7d Merge "Add rescue interface field to node-related notifications" 2018-01-28 05:23:02 +00:00
Zuul
91561c8835 Merge "Add a timeout for powering on/off a node on oneview" 2018-01-27 10:58:41 +00:00
Zuul
2f85ad321d Merge "Fix persistent information when getting boot device" 2018-01-27 10:43:59 +00:00
Zuul
0a5de20c2a Merge "Remove python-oneviewclient from oneview hardware type." 2018-01-27 10:43:55 +00:00
Shivanand Tendulker
7394dbbacb Add rescue interface field to node-related notifications
This patch adds rescue_interface field to node-related notification
objects.

Co-Authored-By: Jay Faulkner <jay@jvf.cc>
Co-Authored-By: Josh Gachnang <josh@pcsforeducation.com>
Co-Authored-By: Jesse J. Cook <jesse.j.cook@member.fsf.org>
Co-Authored-By: Mario Villaplana <mario.villaplana@gmail.com>
Co-Authored-By: Aparna <aparnavtce@gmail.com>
Co-Authored-By: Shivanand Tendulker <stendulker@gmail.com>

Change-Id: I8aa4c3c4701eae5f7838192bdbcf46a069370643
Partial-bug: #1526449
2018-01-27 09:19:47 +00:00
Zuul
9e29d77988 Merge "Automatically migrate nodes to hardware types" 2018-01-27 01:12:28 +00:00
Dmitry Tantsur
cc6f7bc73e Automatically migrate nodes to hardware types
This change adds a new data migration: migrate_to_hardware_types.
It works by walking through known classic drivers, detecting matching
hardware types and interfaces and updates nodes accordingly.

Nodes that cannot be updated (e.g. matching hardware type is not
enabled) are skipped. A new migration option reset_unsupported_interfaces
can be set to True to allow resetting optional interfaces to their
no-op versions.

The example implementation are provided for the community supported
IPMI and SNMP drivers, as well as for fake drivers based on them.

Change-Id: I732b44f2ab1ef73f56b352415ffd9cdd8a0e232b
Partial-Bug: #1690185
2018-01-26 21:17:26 +00:00
Jay Faulkner
49fabe6d7b Add API methods for [un]rescue
Adds API methods to support rescue and unrescue.

After rescuing a node, it will be left running a rescue ramdisk,
configured with the rescue_password, and listening with ssh on the
specified network interfaces.

Unrescuing a node will return the node to Active.

Change-Id: I3953ff0b1ca000f8ae83fb7b3c663f848a149345
Partial-bug: #1526449
Co-Authored-By: Jay Faulkner <jay@jvf.cc>
Co-Authored-By: Josh Gachnang <josh@pcsforeducation.com>
Co-Authored-By: Jesse J. Cook <jesse.j.cook@member.fsf.org>
Co-Authored-By: Mario Villaplana <mario.villaplana@gmail.com>
Co-Authored-By: Aparna <aparnavtce@gmail.com>
Co-Authored-By: Shivanand Tendulker <stendulker@gmail.com>
2018-01-26 18:27:10 +00:00
Zuul
7371477064 Merge "Implementation for UEFI iSCSI boot for ILO" 2018-01-25 23:06:36 +00:00
Zuul
f5654bfd00 Merge "Allow setting {provisioning,cleaning,rescuing}_network in driver_info" 2018-01-25 11:54:26 +00:00
kesper
8763637255 Implementation for UEFI iSCSI boot for ILO
This change adds new methods in management interface and enhance
boot interface of 'ilo' hardware type to support boot from iSCSI
volume in UEFI boot mode.

Change-Id: I585e0ef90f4397af1f09920c3a1bc47ddbcb1a97
Related-Bug: #1526861
2018-01-25 06:33:21 +00:00