Commit Graph

19 Commits

Author SHA1 Message Date
Julia Kreger
2f7f72e147 Increase the ESP partition size to 550 MB
This change makes ironic-lib consistent with ironic-python-agent
and diskimage-builder's defaults for ESP partition sizes.

The following fedora change lays out why this is a necessary
change: https://fedoraproject.org/wiki/Changes/BiggerESP

In summary, additional space is needed if OS driven firmware
flashing is going to take place, and unikernels + next generation
bootloaders are going to consume more space than the existing
grub loader has.

Change-Id: I4fc63c02bf57a08e75121cfa1fd35a56c0427553
2023-11-07 07:12:24 -08:00
Julia Kreger
0a62259018 Add jsonrpc client port capability
Adds the capability for the topic to contain a port to which
the json rpc client will connect to. This allows for distinct
json-rpc targets to be configured in an environment.

Change-Id: I999316880639cd410543eb54475b0c647b35147b
2023-04-04 10:01:38 -07:00
Arne Wiebalck
ec6ba65392 Use direct writes when erasing the GPT
Use direct I/O when overwriting the partition table to expose device
failures (which would not be directly noticed otherwise).

Change-Id: Ib0790099d895410681e4a1679bedea62209ff277
2023-03-01 15:11:04 +01:00
Julia Kreger
71e06086b0 Provide an interface to store metrics
Internally, if we want to re-use ironic-prometheus-exporter
*and* get useful metrics data out through it for ironic itself,
we need we need someway to collect and return metrics data.

Turns out, we did most of this for statsd ages ago, and we can
just reuse the framework.

Change-Id: I6060da4ab80c2e6d19d78b808216ae262edcc84c
2023-01-06 08:48:35 -08:00
Takashi Kajinami
4ea8df8e21 Allow customizing roles to use JSON RPC
This change allows customizing the roles required for JSON RPC, to use
any roles different from the 'admin' role.

There is a plan, as part of SRBAC effort, to replace usage of the admin
role in each service by the new service role, which has more restricted
access, and we expect the ironic service user would require only
the service role once this work is done.

Change-Id: I143203be7827f73daba32e7c084c5807063ff91d
2022-01-26 21:29:35 +09:00
Riccardo Pittau
731e2f9c82 Restore blkid compatibility with Centos 7
The blkid version included in util-linux 2.23.2 does not allow long
options name for probe and match-tag.
Use the short single letter name to restore compatibility with Centos 7

Story: 2009328
Task: 43764

Change-Id: I10a52c16ebe4e519d0af63b36c3a89fd5d371319
2021-11-15 15:53:32 +01:00
Arne Wiebalck
9a60d3853f Handle EBRs and tiny partitions when removing metadata
Extended boot records (EBRs) are used in the MSDOS partitioning
scheme to manage extended partitions. EBRs are small partitions
themselves and Ironic will therefore treat them like any other
partition during cleaning. Since EBRs are smaller than a GPT
(33 sectors), dd'ing 33 sectors will fail. This patch proposes
a fix to handle EBRs (and other tiny paritions) by adjusting
the number of blocks writtent to be the partition size at max.

Story: #2008539
Task: #41628
Change-Id: Ie9809b3e4fe2bea6b66ee95c442111942e85d618
2021-01-25 18:58:56 +01:00
Julia Kreger
9be6afc751 Fix other out of memory error for qemu-img convert
qemu-img convert makes a number of allocation requests, and less
common than the "Resource temporarily unavailable" error is
"Cannot allocate memory". The first seems to be largely raised
upon a thread creation for the image conversion, where the first
appears to be on buffer setup on the original process.

Regardless, we should check for both and retry conversion
automatically.

rhbz# 1892773

Change-Id: If435ed0efe034d4bb99f0281ebc73840c0f38fb3
2020-12-08 14:02:04 -08:00
Steve Baker
a9abc5699f Implement Basic HTTP authentication middleware
This middleware is added to ironic-lib so that it can eventually be
used by ironic and ironic-inspector as an alternative to noauth in
standalone environments.

This middleware is passed a path to a file which supports the
Apache htpasswd syntax[1]. This file is read for every request, so no
service restart is required when changes are made.

The only password digest supported is bcrypt, and the ``bcrypt``
python library is used for password checks since it supports ``$2y$``
prefixed bcrypt passwords as generated by the Apache htpasswd utility.

[1] https://httpd.apache.org/docs/current/misc/password_encryptions.html
Needed-By: https://review.opendev.org/727467
Needed-By: https://review.opendev.org/729463

Change-Id: I874783b8ece0eedf27a94dfed5163d0c82f8b9de
Story: 2007656
Task: 39740
2020-05-26 10:00:06 +12:00
Hang Yang
a24d703393 Convert str to bytes for py3 socket compatibility
socket.sendto() requires bytes and we need explicitly convert str to
bytes in py3.

Change-Id: Ib3f928963b11a2041caf1c3b15825125567ce360
Story: #2007537
Task: #39356
2020-04-10 10:41:06 -05:00
Riccardo Pittau
bf44ded88a Remove deprecated [disk_utils]iscsi_verify_attempts
The configuration option [disk_utils]iscsi_verify_attempts was
deprecated and marked for removal.

Change-Id: I8e67430ba6c53420b7ad38b21adcf776d0c77ad0
2020-01-08 17:29:43 +01:00
Iury Gregory Melo Ferreira
6bb4f81c46 Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in ussuri cycle.

ironic-lib is ready with python 3 and ok to drop the
python 2.7 support.

Complete discussion & schedule can be found in
- http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal - https://review.opendev.org/#/c/691178/

Change-Id: Idfa5afedb607c99c34ff4a07594f698c9bd3bed8
2019-11-22 14:10:45 +01:00
Zuul
18f775b7ab Merge "Rescan after making partition changes" 2019-08-21 15:16:23 +00:00
Julia Kreger
2a83c0add0 Rescan after making partition changes
Long story short, we need to rescan after making
partition changes.

Without forcing a filesystem sync and rescan operation,
we rely upon lazy write-out from buffers to the block
device when operating with a ramdisk.

This is because ramfs does NOT actually operate with fsync
where as GNU parted utilizes fsync on the device in an
attempt to force the write to disk to occur. This is fine
if your booted with devfs, or say even a physical block
device that backs /dev, just not ramfs.

Change-Id: I66481d5f3c17a489f7bdf0af82e31b9107605968
Story: 2006423
Task: 36316
2019-08-21 08:27:29 -04:00
Julia Kreger
28a2ed1a90 Erase expected GPT locations in metadata wipe
While `sgdisk -Z` is useful to wipe disk and partition
metadata, it will prevent execution and not do anything
if a CRC error is detected with the data already on disk.

We had previously run into this with IPA, however we never
addressed this with-in ironic-lib[0].

[0]: https://storyboard.openstack.org/#!/story/1737556
Story: 1737556
Task: 36305

Change-Id: I8fb390cb1daa481583ebcba6a010e9be3255b373
2019-08-20 10:46:07 -04:00
Will Szumski
cd51319528 Use last digit to determine paritition naming scheme
This matches the behaviour of the linux kernel, see:

d3511f53bb/block/partition-generic.c (L39)

Change-Id: Ic3963e5c4a1886aeabed6c5994599e72040a251e
Story: 2006154
Task: 35656
2019-07-04 14:19:51 +01:00
Uros Orozel
9a95e14512 Include partiton name and flags from parted output
Currently list_partitions method fails if partition
name is defined on any GPT partition, it also only
extract one partition flag.

Updated _PARTED_PRINT_RE is now set to capture
partition name/description and partition flags.

Change-Id: I40410622829453a485aa33047848922ab134d725
Task: 30250
Story: 2005322
2019-03-30 06:11:35 +00:00
Ruby Loo
3858f6005e Remove releasenotes/*
Reno is not being used to handle release notes for ironic-lib.
A release note was accidentally added; this removes it to
avoid confusion.

Reno is meant to be used for deploy-facing information, not
for libraries meant for developers:
https://specs.openstack.org/openstack/oslo-specs/specs/policy/release-note-management.html#proposed-policy

Change-Id: I843981bf7cc1a26351bb99466c4b83aa6a3f35a9
2016-06-29 17:06:56 -04:00
vmud213
c6d4f0f463 Add support for BIOS local boot for GPT label
Ironic doesn't support local booting of images in BIOS boot mode
when the disk_label is GPT. The current changes creates BIOS Boot
partition when the disk_label is chosen as gpt. The partition size
is a configurable parameter.

Change-Id: Iade60da0316b8f1c0bf8ce4c79931c1105d19cec
Closes-bug: #1563291
2016-05-23 06:14:49 +00:00