2263 Commits

Author SHA1 Message Date
Aija Jauntēva
73040c88d9 Fix redfish-virtual-media for newer iDRACs
The issue with standard Redfish virtual media boot has
been fixed now. Update to restrict use of redfish-virtual-media
based on iDRAC firmware version.

Change-Id: I8ead1d24a9bd502b64fe7dd058e77550fcee141c
2022-06-29 09:12:13 -04:00
Dmitry Tantsur
65583e6417 No deploy_kernel/ramdisk with the ramdisk deploy and no cleaning
Ramdisk deploys don't use IPA, no need to provide it. Cleaning may need
the agent, so only skip verification if cleaning is disabled.

Other boot interfaces may need fixing as well, I haven't checked them.

Change-Id: Ia2739311f065e19ba539fe3df7268075d6075787
2022-06-23 19:49:16 +02:00
LiZekun
0406fa7531 Remove unicode literal from code
All strings are considered as unicode literal string from Python 3.

This patch drops the explicit unicode literal (u'...')
appearances from the unicode strings.

Change-Id: I52ae9180344baf408e6e8a932e9d59dc45ece9de
2022-06-02 06:14:07 +00:00
Dmitry Tantsur
2d885126ec Don't use URLs as part of temporary file names (part 2)
First, it's leaking information. Second, the URLs can be really long and
cause "OSError: [Errno 36] File name too long".

The same issue has already been fixed in the image cache, this change
updates building ISO. Since the files are created in a temporary
location, just use constant names.

Change-Id: Ie5e0523bb4a8941bcb8dc87c4a0b29cb28ddfe40
2022-05-19 18:34:20 +02:00
Harald Jensås
4cf0147e86 Exclude current conductor from offline_conductors
In some cases the current conductor may have failed to updated
the heartbeat timestamp due to failure of resource starvation.
When this occurs the dbapi get_offline_conductors method will
include the current conductor in its return value.

In this scenario the conductor may end up forcefully remove
node reservations or allocations from itself, triggering takeover
which fail on-going operations.

This change adds a wrapper to exclude the current conductor.
The wrapper will log a warning to raise the issue.

Related-Bug: #1970484
Stroy: 2010016
Task: 45204
Change-Id: I6a8f38934b475f792433be6f0882540b82ca26c1
2022-04-28 10:28:26 +02:00
Zhou Hao
916b6d02c1 [iRMC] Change the way to get irmc-info in raid
When using the node managed by the `irmc` hardware type,
if the port number of the bmc address is manually specified,
the following error will occur when configuring raid:

```
%d format: a number is required, not str
```

Change raid to call parse_driver_info to get irmc_info,
so that irmc-port can be converted to int type to avoid this error.

Story: #2010009
Task: #45151

Signed-off-by: Zhou Hao <zhouhao@fujitsu.com>
Change-Id: I35e0aa2a5e612e6e45c9489153dbb3ff3e500a66
2022-04-24 14:04:15 +08:00
Dmitry Tantsur
5feb39844a Allow reusing defaults in per-node kernel_append_params
It may be convenient to use [pxe/redfish/...]kernel_append_params as
the universal defaults, while using {driver,instance}_info to only
append values. This change allows that by replacing %default% with
the value of the applicable configuration option.

An example use case: CoreOS requires an additional artifact (root
filesystem URL) when PXE booting.

While here, fix the PXE/iPXE interface documentation.

Change-Id: I829291ab5cc19ec2ca43bc45815d012697f0b408
2022-04-11 18:54:42 +02:00
Dmitry Tantsur
c5ef4b9203 Start API after conductor is started in the combined executable
Change-Id: Icaffb5d346001d62e5c9522708dd44f01faeb3a6
2022-03-24 18:07:51 +01:00
f60ec1969b Update master for stable/yoga
Add file to the reno documentation build to show release notes for
stable/yoga.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/yoga.

Sem-Ver: feature
Change-Id: I371614afe321758536d7840207c34329f9cba1c5
2022-03-24 07:49:57 +00:00
Iury Gregory Melo Ferreira
872ede25a0 Fix 20.1 prelude releasenote
Change-Id: I899e78da376c06d9f9d5bad95cdb0b494a3ca494
2022-03-23 14:42:14 -03:00
Iury Gregory Melo Ferreira
aefc623c99 Prepare Yoga release with 20.1
This is a pre-release commit for the Yoga release following our docs [1]

* No API additions during this cycle (no need to update
  doc/source/contributor/webapi-version-history.rst)
* Add prelude releasenote
* Fix highlight in one releasenote

[1] https://docs.openstack.org/ironic/latest/contributor/releasing.html

Change-Id: If26019c5abc0643051f4b11186d7eb819f9c407b
2022-03-22 21:41:34 -03:00
Zuul
01dd06a176 Merge "Fix rebuilds using anaconda deploy interface" 2022-03-12 04:06:41 +00:00
Zuul
1d1cfbc1af Merge "Support img_type Glance property" 2022-03-11 17:31:19 +00:00
Ruby Loo
ab68c9d88b Fix rebuilds using anaconda deploy interface
The anaconda deploy interface was saving internal information in
the node's instance_info, in the user-facing 'stage2' and
'ks_template' fields. This broke rebuilds using a different image
with different stage2 or template specified in the image properties.
This has been fixed by saving the information in the node's
driver_internal_info instead.

Addresses comments/nits from
https://review.opendev.org/c/openstack/ironic/+/827924.

Change-Id: Id9428518d21290fb38a0f7471a2cb69a6cb3ffb2
2022-03-04 15:31:43 +00:00
Ruby Loo
09d8a94d5a Anaconda deploy handles configdrive correctly
The anaconda deploy interface wasn't handling configdrive
correctly. This fixes:

- the code was incorrectly treating the config drive as a dict,
  whereas it could also be in iso6600 format,
  gzipped and base64-encoded. It is handled properly now.

- kickstart commands that deal with the config drive were added
  to the end of the kickstart file. Which means that they are
  executed after an ironic API request is sent to ironic to
  indicate that the node has been provisioned and is ready
  to be rebooted. Which means that there is a possible race
  condition wrt these commands being completed before the node
  is powered off. This has been fixed by putting the API request
  at the end of the kickstart file. Also, a sync was added to
  ensure that all modifications are written to disk.

- extra newlines ('\n') were incorrectly added to the user data content.
  This broke the content-type decoding and cloud-init was unable to
  proces them. The extra newlines have been removed.

Change-Id: If00342a1bfa3e87b2094061b0e2b0b69de3a8a4f
2022-03-03 15:28:09 +00:00
Zuul
4e6a3d52ed Merge "More fixes for anaconda deploy interface" 2022-03-03 12:39:40 +00:00
Zuul
4d1652e1fb Merge "Fix Redfish RAID for non-immediate controllers" 2022-03-02 23:24:44 +00:00
Zuul
172da53cf3 Merge "Add idrac-wsman clean steps to not require ramdisk" 2022-03-02 23:04:22 +00:00
Zuul
d704234a69 Merge "Add known issue for iDRAC Swift firmware update" 2022-03-01 15:10:28 +00:00
Zuul
e5bb7ec682 Merge "Add more sources to redfish firmware upgrade" 2022-03-01 15:10:19 +00:00
Ruby Loo
06cc5d47dc More fixes for anaconda deploy interface
The anaconda deploy interface has a few issues that are
addressed here:

- fixes logic in get_instance_image_info() for anaconda. If the
  ironic node's instance_info doesn't have both 'stage2' and
  'ks_template' specified, we weren't using any values from the
  instance_info. This has been fixed to use values from
  instance_info if specified. Otherwise, they are set as follows:
  The 'stage2' value is taken from the image properties.
  We use the value for 'ks_template' if it is specified in the
  image properties. If not (since it is optional), we use the
  config option's '[anaconda]default_ks_template' value.
  setting.
- For anaconda's stage2 directory, we were incorrectly creating a
  directory using the full path of the stage2 file. It now
  correctly creates the right directory.
- The anaconda deploy interface expects the node's instance_info
  to be populated with the 'image_url'; added code to do that in
  PXEAnacondaDeploy's prepare() method.
- When the deploy is finished and the bm node is being rebooted,
  we incorrectly set the node's provision state to 'active'
  instead of doing it via the provisioning state machine mechanism.
- The code that was doing the validation of the kickstart file was
  incorrect and resulted in errors; this has been addressed.
- The '%traceback' section in the packaged 'ks.cfg.template' file
  is deprecated and fails validation, so it has been removed.

Change-Id: I953e948bcfa108d4c8e7b145da2f52b652e52a10
2022-02-28 16:36:29 +00:00
Zuul
1b3408e190 Merge "Support listening on a Unix socket" 2022-02-24 13:31:50 +00:00
Dmitry Tantsur
5a9dd8b092 Deprecate instance network boot
It's insecure and not very popular. See this post for details:
http://lists.openstack.org/pipermail/openstack-discuss/2021-December/026224.html

Change-Id: I9a2df47bb8c08cc991b3c615a9eb533aba3171f4
2022-02-23 12:15:33 +01:00
Aija Jauntēva
d7d8f8754b Fix Redfish RAID for non-immediate controllers
Fixes ``redfish`` RAID interface workflow to not create more than 1
logical disks per controller at the same time when controller does not
support 'Immediate' application time and system needs rebooting.

With this fix virtual disks are grouped by controller and executed
in batches when reboot is required.

This enables ``redfish`` RAID interface to be used with iDRAC systems
directly as although there are many controllers that support 'Immediate'
application time, they do it only when system has completed loading.
System intermittently completes loading after IPA starts executing
clean or deploy steps rendering controllers not supporting 'Immediate'
apply time and requiring reboot. This fix handles such scenario
instead of failing to create more than 1 virtual disk.

Story: 2009863
Task: 44529

Change-Id: Ia2ce34f09695731b0f48798f662006c4904e2223
2022-02-17 09:12:33 -05:00
Zuul
ff3d001c5a Merge "Set correct initrd_filename for iPXE when using Swift" 2022-02-15 12:00:02 +00:00
Iury Gregory Melo Ferreira
cfa47c54b9 Update some releasenotes for 19.1 release
Change-Id: I9fe5cd295df33dd3af9bcbdc3fc5f35bd0c6df1b
2022-02-14 10:55:21 -03:00
Dmitry Tantsur
c975eaa8c6 Set correct initrd_filename for iPXE when using Swift
iPXE derives its "file names" from the last component of the URL path.
In case of the conductor's local server it's {mode}_{component} where
mode = deploy/rescue and component = kernel/ramdisk. However, in case
of Swift/Ceph, the last component will be different. This patch accounts
for it.

Change-Id: I7ba5545032069509a9c302abe1c21537ccb5ec8a
2022-02-10 18:51:30 +01:00
Zuul
afd3fcea23 Merge "Add idrac-redfish clean steps to not require ramdisk" 2022-02-10 12:03:54 +00:00
Dmitry Tantsur
358b6eac40 Support listening on a Unix socket
When using nginx to terminate TLS (like it's done in Bifrost), it's more
secure to use a Unix socket for communication, so that local users
cannot access plain text communication.

Copies Inspector change I37b762cca035b5855deb92635c29e8eb97a87c20.

Change-Id: If00e5a3537b8fbaae3fa01f71bd515399464da36
2022-02-09 11:32:44 +01:00
Zuul
a4a89d6b20 Merge "Explicit parameter to distinguish partition/whole-disk images" 2022-02-07 20:04:45 +00:00
Zuul
0e3c885a34 Merge "Wait for conductor start before notifying systemd" 2022-02-07 19:45:55 +00:00
Zuul
45325c21ec Merge "Return non-zero exit code on failures" 2022-02-07 19:45:52 +00:00
Zuul
e38ac57b3e Merge "Fix resource_url in the remaining resources" 2022-02-03 17:30:12 +00:00
Zuul
c019dc4429 Merge "Make account prefix of Swift confgurable" 2022-02-03 17:17:34 +00:00
Zuul
f20e3b7378 Merge "Fix redfish RAID failed tasks" 2022-02-03 15:34:36 +00:00
Dmitry Tantsur
c62c16bd22 Support img_type Glance property
Follow-up to change I4ce5f7a2317d952f976194d2022328f4afbb0258.

Change-Id: I36673c801d426ea9cb204ca52b6fb6f719eb396a
Depends-On: https://review.opendev.org/c/openstack/glance/+/826684
2022-01-28 19:14:09 +01:00
Dmitry Tantsur
a813c769e8 Explicit parameter to distinguish partition/whole-disk images
Using kernel/ramdisk makes no sense with local boot, we need a better
way. We already have an internal image_type instance parameter, let's
make it public.

Glance support will be added in the next patch.

Change-Id: I4ce5f7a2317d952f976194d2022328f4afbb0258
2022-01-28 19:13:13 +01:00
Dmitry Tantsur
2c58ab3703 Wait for conductor start before notifying systemd
Currently, the launcher first notifies systemd, then starts checking the
services (RPC and WSGI). So any failures will be reported, but only
after systemd declares the service ready.

This change adds a polling loop to make sure RpcService.start() finishes
successfully.

Change-Id: Ib460622d69a9cb1cb82e796a6ab294bbbb40c359
2022-01-26 15:18:40 +01:00
Dmitry Tantsur
e841fa0545 Return non-zero exit code on failures
Launcher.wait() does not raise, it returns an integer code. Propagate it
to sys.exit() so that failures are correctly recognized.

Change-Id: I38bf39e4e4845415640b3468e9fb3029f70dcded
2022-01-26 14:39:16 +01:00
Takashi Kajinami
cde42678b9 Make account prefix of Swift confgurable
Account prefix is configurable in Swift and can be different. This
change introduces a configuration parameter to customize the prefix
so that users can customize the prefix consistently.

To allow setting a consistent value in Ironic and Swift, the prefix
value is automatically suffixed by '_' like;
 - AUTH  => AUTH_
 - AUTH_ => AUTH_

Story: 2009778
Task: 44259
Change-Id: I4862efa3af452f89f1dc4e15d2c3cc43b857f86d
2022-01-26 19:28:23 +09:00
Dmitry Tantsur
55144d3bd2 Fix resource_url in the remaining resources
Node history was particularly affected: limit was not converted from
string to integer, so "next" link was never added.

Add some safeguards to the generic API code.

Change-Id: I1328e2f07621bf7e39b96eb4a7ddb66c9a2b65bb
2022-01-24 19:10:29 +01:00
Zuul
16dc23c3c5 Merge "Migrates docs from wiki" 2022-01-24 14:51:11 +00:00
Aija Jauntēva
bfea8f17b0 Add idrac-wsman clean steps to not require ramdisk
For BIOS factory_reset updated to use power interface
as direct REBOOT call fails when system is OFF that
can happen if running without ramdisk.

Change-Id: I9baf13e9a089bc692e8010dc7e291d7791d1f73c
2022-01-21 05:44:06 -05:00
Aija Jauntēva
69e6152ac3 Add idrac-redfish clean steps to not require ramdisk
Includes idrac-redfish RAID and management steps.

Update helper utility to not prepare agent on reboots
if cleaning without it.

Change-Id: I3c06e12f82908fba2b2587d0e3bec4b8bbdeba4b
2022-01-21 05:32:23 -05:00
Zuul
4a2d6098de Merge "ImageCache: respect Cache-Control: no-store" 2022-01-21 03:24:21 +00:00
Zuul
53a38f18d4 Merge "Fix Node Console Duplicate Sol Session" 2022-01-21 00:35:02 +00:00
Zuul
1a5b3eb310 Merge "Update idrac-redfish export configuration step" 2022-01-20 21:01:24 +00:00
taoruizhe
a2160f13af Fix Node Console Duplicate Sol Session
Restart node console may occasionally result in duplicated
sol session. Especially, when a cluster deployed with multi
ironic-conductor backends, stop_console action shutdown
only one console process while another sol session remains.

This patch adds "sol deactivate" action before start node
console. Make sure the current connection always a success.

Story: 2009762
Task: 44233
Change-Id: I5bc8666ff0b4ceab61ed6a8c794d6882783d6bce
2022-01-20 18:42:14 +00:00
Julia Kreger
ce6a28d0d2 Migrates docs from wiki
Moves legacy documentation from the wiki.

Please note, this has stripped out upgrade notes in some links in part
because links are broken, and those versions should have long ago exited
production, meaning this is largely for contextual information retention
by the project.

* https://wiki.openstack.org/wiki/ReleaseNotes/Kilo#OpenStack_Bare_Metal_service_.28Ironic.29
* https://wiki.openstack.org/wiki/Ironic/ReleaseNotes/Juno
* https://wiki.openstack.org/wiki/Ironic/ReleaseNotes/Icehouse

Change-Id: I62016bd6319a612bd0c59f496481cae88a182032
2022-01-20 18:18:24 +00:00
Zuul
c65cbb7aef Merge "Set resource_url when getting all nodes" 2022-01-18 10:46:18 +00:00