898 Commits

Author SHA1 Message Date
Julia Kreger
02aad838a5 Remove ip parameter from ipxe command line
Due to dracut changes, we can no longer use BOOTIF on the
same command line, and the lack of an ``autoconf`` parameter
results in DHCP being utilized, which is also incompatible with
the ``ip`` command on the kernel command line.

The history of the ip parameter is to allow the kernel to skip
executing DHCP again, but typially it is done anyway so it seemes
that it was redundant to begin with.

Change-Id: I1d2ebafea39d27941178f22b36dcc37a73848cf3
Story: #2001969
Task: #16141
2018-05-04 12:24:37 -07:00
Julia Kreger
a6ae98ff34 Deprecate Oneview
I have been attempting to engage contacts who were
involved in the OneView driver's development since
UFCG contributors entered IRC and indicated that
they had been directed to return the OneView hardware
that Third Party CI ran on. I recieved some neutral
replies, but no committment to re-establish third party
CI testing for the oneview driver.

I gave it a little time, and again followed up with
my contacts reminding them of the necessity of third
party CI for a driver to remain in ironic. No reply
or acknolwedgement was receieved. Nor has any activity
been observed upstream that could be attributed to
someone rebuilding third party CI for oneview.

As such, we have little choice but to proceed with
deprecating the oneview hardware type and drivers,
such that we remove them next cycle as we are unable
to maintain them without CI.

Story: #2001924
Task: #14451
Change-Id: Ic96f7f654ae5ecfc38a19c74a9ad8335629138f2
2018-04-30 08:27:46 -04:00
Zuul
ffefb805f3 Merge "Collect periodic tasks from all enabled hardware interfaces" 2018-04-25 12:52:45 +00:00
Zuul
64b42f1c31 Merge "Trivial: Update pypi url to new url" 2018-04-24 18:59:36 +00:00
Zuul
d917f32060 Merge "Implementation of inspect wait state" 2018-04-24 14:44:41 +00:00
Zuul
03cc1a65c7 Merge "Stop verifying updated driver in creating task" 2018-04-24 13:41:21 +00:00
Dmitry Tantsur
7ead2067fc Collect periodic tasks from all enabled hardware interfaces
Currently we only collect periodic tasks from interfaces used in enabled
classic drivers. Meaning, periodics are not collected from interfaces
that are only used in hardware types. This patch corrects it.

This patch does not enable collection of periodic tasks from hardware
types, since we did not collect them from classic drivers. I don't
remember the reason for that, and we may want to fix it later.

Change-Id: Ib1963f3f67a758a6b2405387bfe7b3e30cc31ed8
Story: #2001884
Task: #14357
2018-04-24 13:01:47 +02:00
Hironori Shiina
acdc372b5d Stop verifying updated driver in creating task
When a driver of a node is updated, the new driver is passed for
creating a task. If a new driver is a hardware type, the new hardware
type is validated with existing interfaces stored in database even
if requesting to update interfaces together. This causes an error if
the new hardware type doesn't support an existing interface.

Now that a hardware type and interfaces are validated before creating a
task for locking a node when the node is updated, it is not necessary
to verify an updated driver in the task creation.

Change-Id: I3445d6c33660be535babcf3e300ac4ba1b86ae4f
Story: #2001832
Task: #12595
2018-04-24 09:55:38 +00:00
melissaml
909c2678be Trivial: Update pypi url to new url
Pypi url changed from [1] to [2]

[1] https://pypi.python.org/pypi/<package>
[2] https://pypi.org/project/<package>

Change-Id: I43637859b8c183c8ca17200b337845385e546973
2018-04-21 04:02:09 +08:00
Zuul
b91cfa467f Merge "Fix `agent deploy interface to call boot.prepare_instance`" 2018-04-20 12:32:10 +00:00
Shivanand Tendulker
4fa1075b95 Fix `agent deploy interface to call boot.prepare_instance`
``agent`` deploy interface do not call ``boot.prepare_instance``
if image being provisioned is whole disk image. This commit fixes
that issue.
It also updates ``validate`` method of neutron network interface
module to validate if it can support boot options requested for
instance image.

Change-Id: Ibd49d65f4512f2fa417794b66f4007d82f02e2ac
Story: 1713916
Task: 9259
Story: 1750958
Task: 9288
2018-04-18 02:49:37 -04:00
Ruby Loo
05dd4050f7 Update wording used in removal of VIFs
Some minor updates were done to the wording used in the
removal-of-VIFs change.  This is a follow up to
3a4e259a3714cedcad567e229e983f1b559c2668.

Change-Id: I4a72535fed3650364aa53f1f22676599499a3d62
Story: #1743652
Task: #9275
2018-04-18 03:00:15 +00:00
Zuul
084c9161f1 Merge "Remove vifs upon teardown" 2018-04-17 04:19:38 +00:00
Julia Kreger
3a4e259a37 Remove vifs upon teardown
Since we removed the ability for nova to cleanly remove
the vif during teardown because that created a race condition,
the removal of all vif attachment records only seems to be the
right thing to do since we can't realistically change nova try
harder, and functionally we are otherwise looking at massive
locking changes.

Removing vif records is the lesser evil until we can reach
consensus on completely revamping locking to allow for greater
concurrency.

Change-Id: I8d683d2d506c97535b5a8f9a5de4c070c7e887df
Story: #1743652
Task: #9275
2018-04-12 08:18:44 -04:00
Zachary
804349e9be Check for PXE-enabled ports when creating neutron ports
The function "add_ports_to_network" will create neutron ports for each
PXE-enabled port on task.node to boot the ramdisk. But there is no
check to see if there are any PXE-enabled ports. If there aren't, no
neutron ports will be created and things will fail further down the
pipeline. To fail sooner with an appropriate message, we raise an
exception if there are no PXE-enabled ports for the node.

Story: 2001811
Task: 12546
Co-Authored-By: Ruby Loo <rloo@oath.com>
Change-Id: I96c21e7d842ad929161a0d298a342fdf4a1275e2
2018-04-10 11:32:10 -04:00
Kaifeng Wang
6df82ee2bc Implementation of inspect wait state
This patch provides implementations to feature of adding inspect wait state.

Changes covered in this patch:

* Added state and transitions, state diagram regenerated.
* inspector and oneview inspect interface now return INSPECTWAIT instead of
  INSPECTING. Move node to inspect wait if inspect interface returns
  INSPECTING or INSPECTWAIT.
* Add a timeout option to conductor, and a periodic task to check timeout
  in the inspect wait state.

Story: #1725211
Task: #10630

Partial-Bug: #1725211
Change-Id: Ie76bfdad5966014a4dae826919ff5705462c743b
2018-04-10 11:21:46 +08:00
Zuul
3697c6276c Merge "Copy port[group] VIF info from extra to internal_info" 2018-04-09 14:00:29 +00:00
Ruby Loo
3e92382d2e Clarify deprecation of "async" parameter
For vendor passthru decorators, the "async" parameter is deprecated.
This clarifies the messaging we emit (via logs and release notes), and
adds a TODO so we don't forget to delete the "async" parameter in
Stein cycle.

This is a follow up to Change-Id: I6299aafd30faae9a93df2cb901c1505df47e6b45.

Change-Id: I63ddf453584f4e7e8d2fa778ec50b8debcb86bf4
Task: 9289
Story: 1751306
2018-04-06 10:02:05 -04:00
Ruby Loo
37b85b6a39 Copy port[group] VIF info from extra to internal_info
For API versions >= 1.28, Port & portgroup's .extra['vif_port_id'] was
deprecated in Ocata. Before we can remove support for this, we need to
copy that information to the object's internal_info['tenant_vif_port_id'].

This copy/migration is done at the API layer when the user specifies the
.extra[] value, as well as when the 'ironic db-sync online_data-migrations'
is run.

In order to know whether the ports and port groups have been migrated,
their IronicObject versions are incremented.

This also fixes it so that for API versions < 1.28, the deprecation
warning is not shown, since we still need to support extra['vif_port_id']
in this case.

When a port or portgroup's .extra['vif_port_id'] is removed via a
PATCH API request, that VIF is removed from that object's internal_info.

Change-Id: I69468c935e68dd9d37a474c318c3ceb9cdfc5868
Partial-Bug: 1722850
2018-04-02 17:56:47 +00:00
Zuul
537ae811d1 Merge "Validate instance_info.traits against node traits" 2018-03-29 19:20:07 +00:00
Oleksiy Petrenko
0267c271d0 Do not use async parameter
We have method passthru that is accepting parameter async,
but since python 3.7 use async as reserved word,
the async parameter is deprecated,
async_call should be used instead.
async parameter will be removed in the next cycle.

Change-Id: I6299aafd30faae9a93df2cb901c1505df47e6b45
Task: 9289
Story: 1751306
2018-03-28 12:00:55 +03:00
Zuul
c1504da6c4 Merge "Fix nits in the XClarity Driver codebase." 2018-03-22 22:47:57 +00:00
Rushil Chugh
4f08f726be Fix nits in the XClarity Driver codebase.
Follow up to commit 346a9a3bfc5312deb78bda8a82ae238e031413bd

 * Move exception XClarityError to common/exceptions.py
 * Update language of the release note.
 * Specify the kind of power operation being performed.

Change-Id: I1dbc49d7d6185ce3c5f37f518bbecd11571a74fb
2018-03-22 14:14:45 -04:00
Zuul
981e55e5dc Merge "Prevent overwriting of last_error on cleaning failures" 2018-03-21 22:24:50 +00:00
Mark Goddard
d1cd215c66 Validate instance_info.traits against node traits
The ironic node traits spec calls out that traits added to
instance_info.traits should be validated against the node's traits.  All
traits in instance_info.traits should exist in the node's traits.  This
protects us against race conditions between traits being removed from a
node in ironic, and the node's resource provider's traits being updated
in placement.

This change adds validation to do_node_deploy() and
validate_driver_interfaces() in the conductor manager, ensuring that all
instance traits are also node traits.

Change-Id: I956f8285fe428b2bdf8822e4a308f5c2a1675836
Closes-Bug: #1755146
Related-Bug: #1722194
2018-03-21 10:38:03 +00:00
Dmitry Tantsur
b93e5b05c4 Prevent overwriting of last_error on cleaning failures
This changes moves the call to tear_down_cleaning to before we set
the last_error and maintenance_reason fields. Thus we avoid
overwriting last_error by e.g. power actions.

Related-Bug: #1588901
Change-Id: Ia448431a2922ea6f7adc27065dbcab1ba8358daa
2018-03-20 19:04:55 +01:00
Zuul
a8584477e4 Merge "Rework logic handling reserved orphaned nodes in the conductor" 2018-03-16 20:46:45 +00:00
Zuul
677d9f6e5f Merge "Add optional healthcheck middleware" 2018-03-16 20:46:35 +00:00
Zuul
d13713acf5 Merge "Implements validate_rescue() for IRMCVirtualMediaBoot" 2018-03-13 14:20:18 +00:00
Dao Cong Tien
f7da3f6ec2 Implements validate_rescue() for IRMCVirtualMediaBoot
This commit implements validate_rescue() for 'irmc-virtual-media'
boot interface of 'irmc' hardware type.

With this it enables 'agent' rescue interface for 'irmc' hardware
type when corresponding boot interface being used is
'irmc-virtual-media'. Support already exists for the 'agent'
rescue interface with 'irmc-pxe' boot interface.

Also fix a bug in _remove_share_file() causing files
not to be removed correctly.

Change-Id: Ib602b2705b8fa4f7161b9f97857ec6546f5e9b19
Closes-Bug: #1747842
2018-03-13 09:45:42 +00:00
Zuul
fe6112103f Merge "Updates boot mode on the baremetal as per boot_mode" 2018-03-09 22:29:18 +00:00
Zuul
f3a846d2b6 Merge "Don't validate local_link_connection when port has client-id" 2018-03-07 16:30:58 +00:00
Moshe Levi
dcebb77d9d Don't validate local_link_connection when port has client-id
Infiniband ports do not require the local_link_connection field to be
populated as the network topology is discoverable by the Infiniband
Subnet Manager.

This change removes the requirement for local_link_connection for
Infiniband ports. Infiniband ports have a client-id in their extra
field.

Closes-Bug: #1753222
Change-Id: I2bfac4ccaf825bd9aa8ea0d2b447fcd7767acbc5
2018-03-06 15:37:39 +00:00
Ruby Loo
398462021b reloads mutable config values on SIGHUP
This changes the ironic (ironic-api and ironic-conductor)
services so that when a SIGHUP signal is issued, the
service reloads (and uses) the values of mutable configuration
options.

The mutable configuration options (set by oslo.config Opts' mutable=True)
are:
- [DEFAULT]/pin_release_version
- [DEFAULT]/debug
- [DEFAULT]/log_config_append
and are indicated as such in ironic's sample config
(https://docs.openstack.org/ironic/latest/configuration/sample-config.html)
by "# Note: This option can be changed without restarting.".

Configuration options are mutable if their oslo.config Opt's mutable=True
is set. This mutable setting is respected when the oslo method
mutate_config_files is called instead of reload_config_files.
Icec3e664f3fe72614e373b2938e8dee53cf8bc5e allows services to tell
oslo.service they want mutate_config_files to be called by specifying the
'restart_method=mutate' parameter, which this patch does.

Change-Id: I0df46bb21dda035b25daad17737dbfedb861e868
Closes-Bug: #1585595
2018-02-28 23:46:30 +00:00
Zuul
e68d1a71b1 Merge "Set 'initrd' to 'rescue_ramdisk' for rescue with iPXE" 2018-02-22 11:48:46 +00:00
mallikarjuna.kolagatla
216ad852fa Updates boot mode on the baremetal as per boot_mode
This patch modifies the ilo drivers to use the
`boot_mode` capability for cleaning and update the
same on the baremetal.

Change-Id: I5b095cac47890e117866f0569f69148deff173b7
Closes-Bug: #1559835
2018-02-22 04:58:10 +00:00
Zuul
a935a3ec56 Merge "Support nested objects and object lists in as_dict" 2018-02-22 04:13:23 +00:00
Mark Goddard
c66679f14b Support nested objects and object lists in as_dict
The value returned by ironic.objects.IronicObject.as_dict() should be a
plain object, in order for it to be serialised to JSON. Currently,
nested object fields and object list fields are not converted to dict
format. This caused problems during cleaning, when the node object's
as_dict representation is JSON encoded and sent to IPA.

This change adds support for calling as_dict() on nested objects and
list objects, to ensure these are also returned in dict form.

We also change the method used in as_dict() for checking whether an
object has an attribute. The hasattr() function used previously has
problems when used with properties in python 2 [1], in that any
exceptions raised in the property getter result in hasattr() returning
False. Instead we use obj_attr_is_set() to determine whether the object
has a particular attribute.

[1] https://hynek.me/articles/hasattr/

Change-Id: Ib2166040508827db28d6f6e2d9a3e655c16f2993
Closes-Bug: #1750027
2018-02-22 00:29:58 +00:00
Dmitry Tantsur
08ed859ce2 Revert "Don't try to lock for vif detach"
This is causing more serious issues, as there is a race
between tenant VIF removal and cleaning VIF adding.

This reverts commit 4f79cb3932f2518ab3f06b86ceea065cbb399e8c.

The release note is not deleted from it, because the change has
already been released. A new one is added instead.

Change-Id: I922f24293645ff6bb79ad753f49dc9548b9f2485
Closes-Bug: #1750785
2018-02-21 18:33:35 +01:00
Dmitry Tantsur
5694b98fc8 Rework logic handling reserved orphaned nodes in the conductor
If a conductor dies while holding a reservation, the node can get
stuck in its current state. Currently the conductor that takes
over the node only cleans it up if it's in the DEPLOYING state.

This change applies the same logic for all nodes:

1. Reservation is cleared by the conductor that took over the node
   no matter what provision state.

2. CLEANING is also aborted, nodes are moved to CLEAN FAIL with
   maintenance on.

3. Target power state is cleared as well.

The reservation is cleared even for nodes in maintenance mode,
otherwise it's impossible to move them out of maintenance.

Change-Id: I379c1335692046ca9423fda5ea68d2f10c065cb5
Closes-Bug: #1588901
2018-02-21 15:20:57 +01:00
Hironori Shiina
8f2e487b2b Set 'initrd' to 'rescue_ramdisk' for rescue with iPXE
The kernel paramter 'initrd' is hard-coded as 'deploy_ramdisk' in iPXE
config template. A rescue ramdisk may fail to boot due to this wrong
paramter. This patch sets this 'initrd' paramter properly to
'deploy_ramdisk' or 'rescue_ramdisk' by adding a new pxe option.

Change-Id: I8ad1223dc289bbe915ee4ca8db66c8f80bf08f15
Closes-Bug: 1749860
2018-02-21 17:39:12 +09:00
Zuul
a97fa8e3ce Merge "Increase the instance_info column size to LONGTEXT on MySQL/MariaDB" 2018-02-20 22:19:54 +00:00
David Edery
8fdf752ae9 Increase the instance_info column size to LONGTEXT on MySQL/MariaDB
In MySQL, the maximum size of TEXT is 64KiB. The instance_info column
is defined as TEXT and can potentially hold big amount of data
(partly affected by cloud-init scripts for the node).

This patch-set resizes nodes.instance_info to LONGTEXT which allows up
to 4GiB of data to be stored in the column. This change is relevant only
to MySQL and does not affect PostgreSQL or any other DB flavor. The fix
also addresses the upgrade process of the column.

Change-Id: Ifb9a49d4258a559cf2175d902e9424a3f98065c5
Closes-Bug: #1596421
2018-02-20 09:22:30 -08:00
Zuul
f00503c1f2 Merge "Implements validate_rescue() for IloVirtualMediaBoot" 2018-02-20 15:57:43 +00:00
Zuul
7ebcb667d9 Merge "Build instance PXE options for unrescue" 2018-02-20 01:11:30 +00:00
Zuul
b0a25516da Merge "Fix rare HTTP 400 from port list API" 2018-02-19 17:17:59 +00:00
Zuul
bc5e21a3ec Merge "Clean nodes stuck in CLEANING state when ir-cond restarts" 2018-02-19 17:17:50 +00:00
Hironori Shiina
4df93fc474 Build instance PXE options for unrescue
This patch always builds PXE options for booting a user image even if
the provision state is related to rescue mode. When the state is
unrescuing, these options are necessary to boot a user image. When the
provision state is rescuing, these options are just ignored because
the PXE configuration is used at deployment mode.

Change-Id: I1ff51cab120e6612c71e5d9c45cf28797bc16e76
Closes-Bug: 1749433
2018-02-19 12:05:15 +00:00
Zuul
5ae619605c Merge "Allow sqalchemy filtering by id and uuid" 2018-02-19 05:23:58 +00:00
Ryan Bridges
366a44a1bb Allow sqalchemy filtering by id and uuid
These additions will allow us to filter nodes
by node uuid and id. This filter API is used
in many places throughout the code base. It is
natural to expect that this API would allow us to
filter by node id and uuid in addtion to the other
supported parameters. This also fixes a 3 year old bug.

This change from lucasagomes has a bug:
https://review.openstack.org/#/c/197141/

In conductor/manager.py, he calls _fail_if_in_state()
and uses the node_id as a filter. However this filter
effectively does nothing because sqalchemy does not
know how to filter by node id on the backend. My changes
fix this problem and make the API more intuitive

Closes-Bug: #1749755

Change-Id: I4efc0d5cd5d5d6108a334f954e1718203b47da0a
2018-02-16 17:53:58 +00:00