Commit Graph

7 Commits

Author SHA1 Message Date
Dmitry Tantsur 7644196e7d
Split common qemu-img functions from disk_utils
Adds a new module for two qemu-img wrappers that are used both by Ironic
and IPA. The remaining functions in disk_utils are only used by IPA and,
since most of them require root, can no longer be used in the
post-rootwrap Ironic any more. They should be moved to IPA eventually.

Change-Id: I3364a58b52a3e57c2f52356a6496865b749e74a8
2024-01-23 14:00:43 +01:00
Dmitry Tantsur ebdf6784cb Import mounted context manager from IPA
This pattern is used in a few places and is very helpful for
writing custom deploy steps.

Change-Id: Ib7518075f3140a8daf06db52317ff10f8572dcc8
2021-01-15 13:46:56 +01:00
Thomas Bechtold c4d1162f19 Move ironic-lib.filters to etc/ironic/rootwrap.d
This is the path where ironic searches for rootwrap filter files by
default.
This is important because ironic itself is going to remove [1] its
copy of the ironic-lib.filters file.

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

Change-Id: I2241bfd11c66fb84b8840ab76563af52fe93e5ad
2019-09-25 17:01:26 +02:00
Yolanda Robla Mota 2d8f1d91c7 Fix retrieval of config-2 existing partition
Previously it was checked using blkid -t LABEL=config-2, but
this was not finding the partition, causing that images with a
pre-existing config-drive partition had an extra one created
by ironic.

Switched to using the 'lsblk' command and parsing the output of that to
get the information on the partition.

Change-Id: Ic5228ce91d1a133fd846ceb7be547a227292dd38
Closes-Bug: #1654269
Depends-On: I3676cd8e5c5e61fe4e3f67ab9e121c4cd0cd599b
2017-01-11 14:55:40 -08:00
Shivanand Tendulker 7e926fd3fb Support configdrive in iscsi deploy for whole disk images
This will work for UEFI only or BIOS only images. It will not
work for hybrid images; which are capable of boot from BIOS
and UEFI boot mode.

Partial-Bug: #1493328
Change-Id: I4c517f63d620b5a9de31ecb2d7c209776d5ded48
2016-07-28 04:44:56 -07:00
Gonéri Le Bouder 042aa9ab5a use wipefs to erase FS meta information
destroy_disk_metadata should destroy a bit more data than expected if we
want to be sure grub won't conflict with remaining bits of filesystem.
grub probes the hard drive to find remaining partition or filesystem. If
it find something, it will refuse to install itself on the disk.

By using wipefs instead of dd, we not only erase the MBR and partition
table but also all trace of filesystem, raid or partition-table signatures
(magic strings). This without extra Python code.

wipefs is part of util-linux which is available on all the Linux
distribution.

References:
https://review.openstack.org/#/c/284347/
https://bugzilla.redhat.com/show_bug.cgi?id=1310883
Partial-Bug: 1550604

Change-Id: I39637e22c344703ad48fc271f6f866aa018bbdd1
2016-03-10 13:03:27 -05:00
Faizan Barmawer 6c273960d5 Replace rootwrap_config and rootwrap_helper_cmd with root_helper
ironic-lib will use the command set in the new 'root_helper' conf parameter to execute
commands as root user. If this configuration paramter is not specified,
ironic-lib will execute commands with run_as_root=False. This configuration
is not set by default.

'rootwrap_config' and 'rootwrap_helper_cmd' configs are deleted, since
they are replaced by the new 'root_helper' config.

This fix also delivers a sample ironic-lib.filters file, which should be used
with rootwrap command.

Change-Id: I61ef7c15237c995e9d4cc85095ac48a30a8f6c7d
Closes-bug: #1515943
2015-11-19 14:26:01 +00:00