330 Commits

Author SHA1 Message Date
raphael.glon
316dd3f952 Revert "Software raid: mbr/gpt partition table alternative"
This reverts commit 258d963e406c512bb90295c700ee22e4609abcd0.

Remove the mbr/gpt choice from softraid features for now, as it cannot be
directly used without additional commits, to be pushed soon. Furthermore, it
could even lead to instance spawn misconfiguration, if the disk label
specified in instance_info cannot fit with the boot mode + partitioning layout
(example: you build softraid over gpt, then you lose the mbr gap. Thus you need
an additional bios boot partition, in BIOS boot mode, or an esp, in UEFI boot
mode, outside the raid, for grub to install itself inthere, to be able to
assemble raid and find root device correctly).

Change-Id: I3a0a704ea99a40eb3fc8e879270dfbd356951488
2019-09-23 12:26:37 +02:00
Raphael Glon
37385dd9dd Delete_configuration, consider removed raid members as well
Change-Id: Ie4f62d8855d3f30a55f7032918dfed1f1d8b5b31
Story: #2006535
Task: #36591
2019-09-16 11:27:27 +02:00
Zuul
6d3d1367a9 Merge "Handle floppy disk controllers" 2019-08-27 07:53:00 +00:00
Julia Kreger
b98bc678b9 Handle floppy disk controllers
Cleaning presently fails on floopy disk controllers.

While they may be uncommon in server hardware, they
can exist in virtual machines, and even as virtual
devices on some hardware chassises.

Change-Id: I8ba07bfd5ca1e503f46c1bac4fffb5f509186939
Story: 2006419
Task: 36309
2019-08-22 08:58:24 -04:00
Zuul
0eff77ac8d Merge "Softraid: partitioning fixes" 2019-08-21 11:58:22 +00:00
Zuul
187d5da057 Merge "Software RAID: Ignore missing component devices or holder disks" 2019-08-19 13:27:41 +00:00
Arne Wiebalck
9dca5d76b3 Software RAID: Ignore missing component devices or holder disks
With the addition of devices with type 'MD' during
list_all_block_devices (for "empty" devices), partitions on top
of md devices are now returned as well. These don't need deletion,
so skip these during software RAID cleanup.

Story: #2006355
Task: #36121

Change-Id: Idff9b9b0cbe42b57aa315ae07c0b51c35c9ade1e
2019-08-16 11:35:07 +02:00
Raphael Glon
8ad9267aa0 Softraid: partitioning fixes
Fixes:
- Softraid creation: size_gb unit conversion to default parted unit.
- Softraid creation issue when we specify several logical disks with
  more than one having its size specified (not 'MAX').
- Softraid creation issue when a logical disk with size_gb 'MAX' is
  not last in the list.

Change-Id: I13e087611354a35acc2925037f1b10047477d972
Story: 2006352
Task: 36118
2019-08-15 23:48:15 +02:00
Zuul
680143a4da Merge "Fixes get_holder disks with nvme drives" 2019-08-14 09:14:55 +00:00
Zuul
ac6542cab8 Merge "Software RAID: Handle empty target_raid_config" 2019-08-13 10:01:19 +00:00
Raphael Glon
c546749423 Fixes get_holder disks with nvme drives
Change-Id: I195ffdeeb3c13bdec5fc1735b82efa53c8d9d3de
2019-08-13 10:37:18 +02:00
Zuul
6b778e171b Merge "Fixes physical memory fetching for aarch64" 2019-08-12 16:02:44 +00:00
Arne Wiebalck
5dd548dc7b Software RAID: Handle empty target_raid_config
If the target_raid_config is empty, we should not try
to create software RAID devices.

Change-Id: I5a29dc34a07903be0cc1b19594f160ac63c6ed2d
2019-08-12 11:38:28 +02:00
Dmitry Tantsur
3d5fc82ece Ignore /dev/ramX devices for any purposes
While most modern Linux distributions do not create RAM disks, newer
TinyCoreLinux actually does. Ignore them since we don't want to deploy
to RAM.

Change-Id: Ia810c7fb47f7098b8173d765ff9c33b48a223ff1
2019-08-12 09:22:52 +02:00
Dmitry Tantsur
c7c307c497 Software RAID: try to assemble RAID on start-up
TinyIPA does not do it, which prevents deployment on RAID devices.

Story: #2004581
Task: #36196
Change-Id: I6c1d90b4669102ab59588ab15f7166626c4d72be
2019-08-09 13:28:25 +02:00
Raphael Glon
258d963e40 Software raid: mbr/gpt partition table alternative
GPT/MBR partition table type alternative on softraid creation.

Change-Id: Ib3d00034fe687328a1ea3e038f6f86d2746e63a0
2019-08-08 11:44:25 +02:00
Dmitry Tantsur
88796a8936 Do not try to use zRAM devices for anything
These devices are mapped into memory, but nonetheless can appear
in lsblk output. Ignore them explicitly.

Change-Id: I2bb595ef29abdc98bd887bdf41c3c7f64cc3a7e6
2019-08-07 16:10:51 +02:00
Raphael Glon
570584f9ab Adds software raid creation support on nvme drives.
Change-Id: Ia725fcaee6018255af3dd7ff0eb2fb1cfbd2b322
Story: #2006341
Task: #36091
2019-08-06 13:23:08 +02:00
liyingjun
cd50fd1151 Fixes physical memory fetching for aarch64
The output for aarch64[1] `lshw -quiet -json` is a bit different from
x86_64, this will lead to 0 physical memory calculated currently. This
patch aims to make it compatible for aarch64 when getting physical memory

[1]: http://paste.openstack.org/show/754789/

Change-Id: Ib7b4ee857d8550e3d75ac8a53c61f0ecab45feff
2019-07-30 15:51:17 +08:00
Zuul
6af02b25ea Merge "Trivial: Add missing quote when detecting raid devices" 2019-07-16 10:07:46 +00:00
Zuul
6bcd935092 Merge "Software RAID: Detect component & holder disks in broken RAIDs" 2019-07-16 10:07:42 +00:00
Arne Wiebalck
8e5430951a Trivial: Add missing quote when detecting raid devices
Change-Id: I26008295c62abaeb31a32682abd1de21c20d15a9
2019-07-16 08:59:43 +02:00
Zuul
21a742751a Merge "Include empty devices when listing block devices" 2019-07-15 17:18:20 +00:00
Arne Wiebalck
fbfdc49140 Include empty devices when listing block devices
When listing block devices, empty devices are not listed by
default. In order to clean up broken software RAID devices,
however, we need to list these as well. This patch adds the
corresponding option to 'lsblk', makes sure the device type
filtering handles the additional device type ('md' instead
of 'raid*' when an md device has only spares), and takes
care of lsblk reporting size '' for empty devices.

Story: #2006215
Task: #35807
Change-Id: I523e2ed90f3a477b5f5f27054b65fcfd26239ba2
2019-07-15 12:23:42 +02:00
Arne Wiebalck
6d2f9b986c Software RAID: Detect component & holder disks in broken RAIDs
This patch amends the component and holder disk detection code
to be able to also extract information from inactive/broken md
devices. This may be required in case of broken RAID-0 (which
will show up as an empty inactive device after a reboot which
none the less keeps its spare devices 'in-use' and prevents
RAID re-creation).

Story: #2006215
Task: #35808
Change-Id: I4ce41b335843e18c67668192d2fccff1c6cdfb92
2019-07-12 18:03:53 +02:00
Riccardo Pittau
8c9fd6dffc Using from_device_file from Devices
The from_device_file method in pyudev.Device is deprecated since
version 0.18
Using the same method from pyudev.Devices is now recommended.

Increasing minimum version of pyudev to 0.18 and correctly handling
exception raised by from_device_file.

Change-Id: I0637585241c81a36f69aef8017f1134f5c526eb1
2019-07-09 13:59:32 +02:00
Dmitry Tantsur
69064a8610 Correct formatting of a warning when lshw cannot be run
Change-Id: I7c55aee4b3b52cb414a595cf548e1f22e954f619
2019-06-26 11:37:07 +02:00
Dmitry Tantsur
94048fe97e Stop logging lshw output, collect it with other logs instead
The lshw output is huge even on virtual machines, and it pollutes
the debug logging. This change silences it. Instead, the lshw output
is collected as part of the ramdisk logs.

Depends-On: https://review.opendev.org/#/c/665635/
Change-Id: I6a3015b2d8d09f6f48b5cbd39dc84bd75b72f909
2019-06-17 14:00:26 +02:00
Zuul
b1e5c4b645 Merge "Software RAID: Protect RAID metadata upon cleaning" 2019-06-13 10:40:42 +00:00
Zuul
6e0749a1ec Merge "Get the hostname of the introspected host" 2019-06-12 15:57:22 +00:00
Arne Wiebalck
48f9914ee7 Software RAID: Protect RAID metadata upon cleaning
During automatic cleaning, the generic hardware manager erases the
data and the metadata on all block devices. If this is done on RAID
members, the RAID device is destroyed. This patch proposes to exclude
RAID members from (meta)data cleaning.

Change-Id: I9ec7674925d981062c311cf34eadfe4cb891f077
Story: #2004581
Task: #33640
2019-06-12 15:47:39 +02:00
Brad P. Crochet
7b3469ee0f Get the hostname of the introspected host
This will retrieve the hostname of the host being introspected, and
return it as part of the introspection data.

Change-Id: I54084251e1b0f3a40fe5ac760b2a7e45199c9fdb
Story: #2005867
Task: #33674
2019-06-12 13:00:21 +00:00
Arne Wiebalck
5140c3bda2 Software RAID: Don't preformat log strings
Remove the preformatting of log messages to avoid any formatting
is done when the corresponding log level not enabled.

Additional nits addressed:
- make the supported RAID levels a top-level frozenset
- remove unused return value from validate_configuration

Follow-up to Id20302537f7994982c7584af546a7e7520e9612b

Change-Id: If6484847a16f938c80523f0b7ec6ae52ea9cf598
2019-06-07 14:53:47 +02:00
Zuul
9bf743a768 Merge "Software RAID: Fix shell commands" 2019-06-07 02:31:46 +00:00
Arne Wiebalck
4535305c1d Software RAID: Fix shell commands
Pass an array to utils.execute() or enforce string usage
via 'shell=True', but don't mix.

Follow-up to Id20302537f7994982c7584af546a7e7520e9612b

Change-Id: I2e6c628360aecf81039089af78b19fe6a956e564
2019-06-06 13:59:10 +02:00
Zuul
3c91e55886 Merge "Software RAID: Add IPA deploy support" 2019-06-05 19:40:09 +00:00
Zuul
09d2db7c39 Merge "Software RAID: Create/delete configurations" 2019-06-05 07:34:01 +00:00
Arne Wiebalck
8fe390ecdd Software RAID: Add IPA deploy support
This patch proposes to extend the IPA to be able to deploy on
software RAID devices. The IPA needs to be able to detect an
md device, find the underlying holder disks and configure grub
on them.

Change-Id: Ieb2c95ff130b5cc1e643fcde500066d9458ddbec
Story: #2004581
Task: #29102
2019-06-04 12:43:09 +02:00
Arne Wiebalck
2db123d318 Software RAID: Create/delete configurations
This patch proposes to extend the IPA to be able to configure software
RAID devices. For this, the {create,delete}_configuration methods of
the GenericHardwareManager are implemented.

Change-Id: Id20302537f7994982c7584af546a7e7520e9612b
Story: #2004581
Task: #29101
2019-06-04 12:33:40 +02:00
Dongcan Ye
eb875cc9a2 Add more channel number for detecting BMC IPv6 address
This is a missing fix for patch.[1]

[1] https://review.opendev.org/#/c/656275/

Change-Id: I8443ae0c08487afea383e111b6c2b6d5941d4024
Task: 30654
Story: 2005528
2019-05-20 11:08:31 +00:00
Dongcan Ye
66d3c8e453 Add more channel number for detecting BMC IP address
IPMI SPEC[1] assignment channel number 1-11 for vendors
implementation(We an search "Channel Numbers" in section 6.3).
We met an baremetal product, like H3C, use number 8 as LAN channel.

Current code limit channel number to 1~7,
I think this can increase to 1~11.

[1] https://www.intel.com/content/dam/www/public/us/en/documents/product-briefs/ipmi-second-gen-interface-spec-v2-rev1-1.pdf

Change-Id: I63a6ff91d702b990ef09da13e6e2e269e7274cce
Task: 30654
Story: 2005528
2019-05-05 10:29:58 +00:00
Zuul
e6eb4133b6 Merge "Ironic python agent does not extract correct available memory" 2019-04-16 15:16:05 +00:00
Uros Orozel
d8018b9f35 Ironic python agent does not extract correct available memory
This patch fixes parsing of memory class output of lshw output.
Task: 30201
Story: 2005308

Change-Id: I0e7ff9f86a266d2f798457136fed0100c78569e2
2019-04-15 10:59:42 +00:00
Zuul
55e3266c89 Merge "Discover IPv6 BMC address" 2019-04-10 03:49:03 +00:00
Kaifeng Wang
4cb2ac4ae4 Fix docs job failure due to malformated docstring
Change-Id: Ic3532e51481fd07e2f816aeacb07ded2d56791ee
2019-04-09 10:24:17 +08:00
Nikolay Fedotov
518c338ca3 Discover IPv6 BMC address
Change-Id: Ia7f24c1df782de4809a5195876bbf0309b481fd7
Story: #2005133
Task: #29817
2019-04-08 15:58:33 +03:00
Mark Goddard
b81b7c1c87 Add 'interface' to get_clean_steps docstring
Change-Id: Ice547f5eec849650828e1bd1aac48e7f041eeb34
2019-03-21 17:26:24 +00:00
Corey Wright
96961070ee Allow erasing metadata from disk partitions
Modify the metadata erasing call chain to retrieve a list of devices
that includes partitions in addition to disks so it can erase metadata
from all of them, otherwise incidentally recreating disk partitions
causes the Linux kernel to discover and automatically recreate some
types of storage entities (eg LVM PVs, VGs, & LVs, RAID members &
devices).

Change-Id: If8f47a083966051856439e3291a6872929b93e3b
Story: #2003673
Task: #26192
2018-11-13 00:36:18 -06:00
Zuul
3176ea483c Merge "Fix multi-device behavior" 2018-11-12 13:56:57 +00:00
Zuul
67a516bdcf Merge "Parallel erase disk devices" 2018-10-22 20:31:34 +00:00