138 Commits

Author SHA1 Message Date
Zuul
3c91e55886 Merge "Software RAID: Add IPA deploy support" 2019-06-05 19:40:09 +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
Kaifeng Wang
a9cac52190 Relax checksum fields validation
In stein, ironic added the new os_hash_algo and os_hash_value checksum
fields provided by glance, but the checksum field is still mandatory,
which is inconvenient for standalone use case.

We could relax the checksum checking and proceed as long as there is at
least one of checksum mechanism available.

Change-Id: Ia90197416f76ada0422681044a16f1c07d7049a1
Story: 2005773
Task: 33490
2019-05-28 09:38:36 +08:00
Derek Higgins
9c35f02792 Bind mount /run into chroot when installing grub
grub-mkconfig runs a lvs command that attempts to access /run/lvm
once for each block device, currently it times out after 10 seconds
for each device and moves on. Multiple 10 second delays become
a problem (causing IPA API timeouts) when multiple block devices
are present. Bind mounting in /run avoids the delay and the
timeouts.

Task: 30616
Story: 2005507

Change-Id: Iae8b7808a35bff121f64971aadd4bd36b5f5bb71
2019-04-25 23:53:19 +01:00
Dmitry Tantsur
f821db3a54 Allow image checksum to be a URL
We allow image_source to be a URL, let us also support URLs for checksums.
This change copies handling of multi-file checksum files from metalsmith.

Change-Id: Ie4d7e5c79b76bdd72d50eeb384cf10519278a80c
Story: #2005061
Task: #29605
2019-02-25 14:28:09 +01:00
Sam Betts
fc2dfcee60 Attempt to read the partition table after writing an image
This patch adds code that tries to read the partition table after we've
successfully written an image to make sure the image that we wrote has a
valid partition table so we can more easily guarantee that what we've
written is bootable and not just junk. Without a valid partition table
writing a config drive will fail for whole disk images.

Co-Authored-By: Dmitry Tantsur <dtantsur@redhat.com>
Change-Id: I5cfd8c433a4db3e0d2d5086250e629d16234b7a4
Story: 2001760
Task: 12159
2018-11-19 18:57:23 +01:00
Zuul
f63099ebb6 Merge "Allow streaming raw partition images" 2018-10-26 14:14:55 +00:00
Dmitry Tantsur
29136bf68d Allow streaming raw partition images
Currently we support streaming raw whole disk images, but not
partition ones. This change enables it.

Change-Id: Ie95102aa3f2054a6b429f3d3e0926e90923c5faf
Story: #2003809
Task: #26558
2018-10-17 11:16:04 +02:00
Kaifeng Wang
ec2bf8667d Enhanced checksum support
Adds enhanced checksum support to IPA, when os_hash_algo and os_hash_value
are passed in via image_info, it will be used to calculate image checksum
and verification.

In other cases, the old md5 checksum is used.

Change-Id: I1d2f33e7059910326b4ac3f7786543b333a93a5a
Story: 2003938
Task: 26846
2018-10-15 17:15:38 +08:00
Zuul
667589bb00 Merge "fall back to PARTUUID if UUID not found." 2018-08-03 15:40:51 +00:00
Matthew Thode
7e0bcbbeee fall back to PARTUUID if UUID not found.
Change-Id: Icbf1fd8179658bd8bcd15f99aaaee796288dbf6f
Story: 2002052
Task: 19714
2018-07-31 13:01:33 -07:00
Michael Turek
b32750f5c4 Install grub to PReP partition when prep_boot_part_uuid is provided
Installs the grub bootloader to the PreP Boot partition when the
prep_boot_partition_uuid is provided. This is required when
booting a partition image locally on ppc64* systems.

This change also passes the cpu_arch along to work_on_disk so
that the PReP partition is created when partitioning disks for
local boot on ppc64* systems,

Change-Id: I70667d43af962b357e6eeccba258f4fa5a91a09e
Depends-On: I2bc9f13ec605de7b7b96d96a1a4edebee0af76dc
Story: #1749057
Task: #22999
2018-07-20 16:07:16 +00:00
Julia Kreger
3164053f08 Fix gate and bump CoreOS version to latest stable.
Increases the amount of ram for CoreOS IPA to 2GB
as the base CoreOS image is now 310MB.

Bumped CPU count for CoreOS runs to 2 CPUs as the
concurrency helps boot times for the CoreOS ramdisk.

Adds netbase, udev, and open-iscsi to debian jessie container
as they are no longer present in the default container.

Explicitly set path variable for execution in the debian
container as udevadm is in /sbin, and we may not have
/sbin on the path that is passed through to the
chroot.

Also fixed new pep8 test failures.

Story: #1600228
Task: #16287
Change-Id: I488445dfd261b7bca322a0be7b4d8ca6105750a3
2018-05-10 15:50:05 -07:00
John L. Villalovos
8873f5eb91 Replace use of functools.wraps() with six.wraps()
In Python 2.7, functools.wraps() does not provide the '__wrapped__'
attribute. This attribute is used by
oslo_utils.reflection.get_signature() when getting the signature of a
function. If a function is decorated without the '__wrapped__'
attribute then the signature will be of the decorator rather than the
underlying function.

From the six documentation for six.wraps():
    This is exactly the functools.wraps() decorator, but it sets the
    __wrapped__ attribute on what it decorates as functools.wraps()
    does on Python versions after 3.2.

Change-Id: Ic0f7a6be9bc3e474a0229b264d1bfe6c8f7e6d85
2018-02-01 15:15:00 -08:00
Zuul
5ee16ee2e8 Merge "Do not try unmounting the EFI partition if it was not mounted" 2017-12-15 08:40:16 +00:00
Dmitry Tantsur
db4694de24 Do not try unmounting the EFI partition if it was not mounted
If mounting the root partition fails for some reason, we try to unmount
the EFI partition, which is not mounted at this point. This results in
a new exception hiding the real failure. This change fixes it.

Change-Id: I0ec636a361eda71b4149e4a7ba1538a9bbf6ec34
Closes-Bug: #1732932
2017-12-14 19:52:53 -05:00
Zuul
e789ec8898 Merge "Catch OSError thrown when hexdump is missing" 2017-12-12 21:08:13 +00:00
Julia Kreger
71fda732d2 Catch OSError thrown when hexdump is missing
Change c5bf7b088f1ec776b788a81f2775e1b2577720e8 introduced
a new requirement via a pre-existing ironic-lib method being
called that utilizes hexdump. Hexdump is not always present
and since we did not explicitly call it out as a new
requirement, we should at least somewhat gracefully handle
the exception.

Change-Id: Id0223ef1417f6e419770ceb56b2a3b80c6118a85
Closes-Bug: #1732470
2017-12-11 17:11:52 -05:00
Zuul
893c63f24a Merge "Rescue extension for CoreOS with DHCP tenant networks" 2017-12-11 21:14:09 +00:00
Mario Villaplana
a659306272 Rescue extension for CoreOS with DHCP tenant networks
This patch adds support for rescue mode with DHCP tenant networks in
CoreOS. Applying network config from a configdrive is not yet supported
but will be in a future patch.

Co-Authored-By: Jay Faulkner <jay@jvf.cc>
Co-Authored-By: Taku Izumi <izumi.taku@jp.fujitsu.com>
Co-Authored-By: Annie Lezil <annie.lezil@gmail.com>
Co-Authored-By: Aparna <aparnavtce@gmail.com>
Co-Authored-By: Shivanand Tendulker <stendulker@gmail.com>
Change-Id: I7898ff22800dedba73d7fbfb3801378867abe183
Partial-Bug: 1526449
2017-11-06 04:48:58 -05:00
John L. Villalovos
c3acbde396 Fix a mis-formatted log message
The log message was missing the type specifier.

Change-Id: Ia5ee5e79bc75c11541cbc328385b046d1e798ddd
2017-10-27 09:16:25 -07:00
Zuul
3e1724ca86 Merge "Fix to return 'root_uuid' as part of command status" 2017-10-25 23:06:17 +00:00
Shivanand Tendulker
c5bf7b088f Fix to return 'root_uuid' as part of command status
IPA does not return 'root_uuid' as part of command status when
provisioning of whole disk image is done using 'agent' deploy
interface from ironic. This commit fixes the issue.
Also updated Dockerfile to include package 'bsdmainutils' related
to 'hexdump' binary.

Change-Id: I89597fe4a704686fe31c064c3443fd8404a300e5
Partial-Bug: #1713916
2017-10-24 05:00:16 -04:00
Zuul
1c51e81ab7 Merge "Fix OSError catch" 2017-10-17 01:19:30 +00:00
Julia Kreger
308cddc1bb Fix OSError catch
The _execute helper was catching OSError, except it
was expecting the same attributes as ProcessExecutionError,
which is incorrect.

Added a separate catch and unit test to ensure that we
at least properly catch and convert the error instead of
raising an error about an attribute that does not exist.

Change-Id: Id47715a5657478e4d9dd10ea7f360b1ededa27de
Closes-Bug: #1715466
2017-10-12 14:32:50 +00:00
Vasyl Saienko
db5272cfea Remove hard-coded path to grub binaries
Use PATH variable to find grub binaries.

Closes-Bug: 1717255

Change-Id: Ic6a2bafdc87e33c4e1c4534fa355f995c824b945
2017-09-25 09:30:58 +03:00
ericxiett
50f914d088 Add missing description for params of 'start_iscsi_target'.
Change-Id: I3bbd092d0738110ad36f85f1d333273f46648d2b
Closes-Bug: #1691303
2017-05-18 07:57:36 +08:00
vmud213
85869a134b Remove unused function _configdrive_location
This function is never used and can be removed safely.

Change-Id: Ied7b4984185ea170d33cb57010de89edeaaaeec5
Closes-Bug: #1690135
2017-05-11 12:23:38 +00:00
John L. Villalovos
e9344077fc flake8: Specify 'ironic_python_agent' as name of app
Specify 'ironic_python_agent' as the name of the application for the
flake8-import-order plugin. That way it knows that imports of
ironic_python_agent should come after external libraries.

Change-Id: Id39d558a51aeb97d96633afea28676634547d0d7
2017-03-16 07:09:07 -07:00
Galyna Zholtkevych
9c2d0cdd85 Correct failure message output when downloading
This fixes unreadable output on download image failure.
Adding new instance variable to exception `ImageDownloadError` class
to avoid redundant logs.

Change-Id: I51782abd572588adfc62745eeab9c559eb8346dd
Closes-Bug: #1657691
2017-03-10 19:16:07 +00:00
John L. Villalovos
949f4f509e Use flake8-import-order
Use the flake8 plugin flake8-import-order to check import ordering. It
can do it automatically and don't need reviewers to check it.

Change-Id: I946457e9079ce0b54c7fe0ad554d024a1c61dce0
2017-02-16 09:46:21 -08:00
Jenkins
fd7f10b993 Merge "Configure and use SSL-related requests options" 2017-02-07 09:57:49 +00:00
Jenkins
465687940b Merge "Reboot and Poweroff fails with coreos IPA image" 2017-01-20 22:53:36 +00:00
Annie Lezil
20dc04e5e2 Reboot and Poweroff fails with coreos IPA image
The CoreOS IPA images do not support poweroff/reboot due to running in a
chroot. For this case, we fall back to forcing poweroff or reboot via
sysrq commands

Change-Id: I75d68b6308beba299d043e43a5fa1671b6ef3ada
Closes-Bug: #1628367
2017-01-20 12:55:12 -08:00
Jenkins
bbbea4601a Merge "iscsi: Listen for connections on both IPv4 and IPv6 ports" 2017-01-19 22:34:11 +00:00
Derek Higgins
1c493c470a iscsi: Listen for connections on both IPv4 and IPv6 ports
Allow connections if deploying over a IPv6 network.

Change-Id: Ib5b97e960fcb30b9a37c5971e88d5251905f8113
Closes-Bug: #1650540
2017-01-19 15:24:17 +00:00
Jenkins
7680625994 Merge "Use sh instead of bash when installing grub" 2017-01-18 10:27:56 +00:00
Pavlo Shchelokovskyy
a5370d52cd Use sh instead of bash when installing grub
there is no guarantee that 'bash' is present in a user's image,
while 'sh' as system shell must be there.
As we do not use any bash-specific syntax (just starting commands in a
subshell) when installing the bootloader from chroot-ed user image,
let's be more supportive and use 'sh' instead of 'bash' for that.

Change-Id: I1fb82068b9c55da35166d8d2ecf9f0ba41356adb
Closes-Bug: #1657096
2017-01-17 13:57:49 +02:00
Cao Xuan Hoang
6997907b07 Removes unnecessary utf-8 encoding
The following files added utf-8 encoding but never used. So we can
removes them at all.

ironic_python_agent/extensions/image.py
ironic_python_agent/extensions/iscsi.py
ironic_python_agent/tests/unit/extensions/test_image.py
ironic_python_agent/tests/unit/extensions/test_iscsi.py

Change-Id: Ifc98faf025ee81f885ea58d9203037c6357ea7f2
2017-01-16 08:25:10 +07:00
Pavlo Shchelokovskyy
fdd11b54a5 Configure and use SSL-related requests options
This patch adds standard SSL options to IPA config and makes use of them
when making HTTP requests.

For now, a single set of certificates is used when needed.
In the future configuration can be expanded to allow per-service
certificates.

Besides, the 'insecure' option (defaults to False) can be overridden
through kernel command line parameter 'ipa-insecure'.
This will allow running IPA in CI-like environments with self-signed SSL
certificates.

Change-Id: I259d9b3caa9ba1dc3d7382f375b8e086a5348d80
Closes-Bug: #1642515
2017-01-13 11:33:44 +02:00
Bharath kumar
9948349b10 Moving Reboot bashscript to python
Currently a reboot bash script file is used to call reboot and
poweroff operation. Deleting this file and moving the code to
python file using utils.execute()

Partial-Bug: #1557542

Change-Id: Iad9cd9d15417e9a954d108d2759e6303452fca27
Author: Bharath kumar <shettybharath4@gmail.com>
Co-Authored-By: Annie Lezil <annie.lezil@gmail.com>
2016-12-15 00:05:03 +00:00
John L. Villalovos
0b8763e332 Update to hacking 0.12.0 and use new checks
Use hacking 0.12.0

Use the new checks that are available:
    [H106] Don’t put vim configuration in source files.
    [H203] Use assertIs(Not)None to check for None.
    [H904] Delay string interpolations at logging calls.

Fix code so tests pass.

Change-Id: If22ad272c332f30624ce10861408d377908b152b
Depends-On: I2aa44b62f900d4dfd67701b01eadd0523fbfaf07
2016-11-08 11:31:18 -08:00
Luong Anh Tuan
ef6c1cb9ce Replaces uuid.uuid4 with uuidutils.generate_uuid()
Openstack common has a wrapper for generating uuids.We should
use that function when generating uuids for consistency.

Change-Id: Ifb7b15fc8634338fc535de8043053e41aa93968a
Closes-Bug: #1082248
2016-11-08 09:06:45 +00:00
Shivanand Tendulker
7471d4004e Remove duplicated logging in configdrive creation
Ironic-lib logs a message when configdrive is created
successfully. Remove duplicate message from IPA.

Change-Id: I2af81cdfda4cfc004288f44d14a5c127639cc1f1
2016-10-26 02:47:53 -07:00
Jenkins
0727443b1a Merge "Use ironic-lib to create configdrive" 2016-10-21 15:42:59 +00:00
Shivanand Tendulker
3665306dfb Use ironic-lib to create configdrive
Shell script to create config drive being replaced with python
code in ironic-lib.

Closes-Bug: #1493328

Change-Id: I31108f1173db3fb585386b2949ec880a95305fb6
2016-10-21 03:39:06 +00:00
Derek Higgins
cc5556d06b Install grub in the EFI "Fallback path"
In systems where the nvram may have been reset, add
\EFI\BOOT\BOOTx64.EFI to the EFI system partition so that
the image continues to boot. This will be particularly useful
if the NVRAM wasn't written correctly or if the baremetal
server is be simulated on virt and the NVRAM was been reset
on start (as is the case in libvirt).

Change-Id: I5005ae02c283cdc01540ea46c341a7b0bf9d4c42
Closes-Bug: #1632637
2016-10-20 13:50:02 +00:00
John L. Villalovos
20d960ff98 Remove Python 2.6 format style
In Python 2.6 it was required to use {0}, {1}...{n} when using the
string format function. In Python 2.7 and Python 3 it it not required.

Change {N} to {} in code.

This brings the code in style alignment with other projects like
ironic and ironic-lib.

Change-Id: I81c4bb67b0974f73905f14b589b3dd0a7131650d
Depends-On: I8f0e5405f3e2d6e35418c73f610ac6b779dd75e5
2016-10-06 09:05:26 -07:00
Galyna Zholtkevych
993149cfb4 Improve error message while download image
Collecting warning logs in the case of download failure
and write them to error logs in the end. This will help
a user to diagnose a problem when warning log was not
enabled.

Change-Id: I4198d7be08fc11b616b3f95c595ff53794436e24
Partial-Bug: 1512186
2016-09-21 10:02:22 -04:00
Josh Gachnang
fd874652e3 Add metrics support to IPA
This utilizes the new metrics support in ironic-lib to allow the agent to
report timing metrics for agent API methods as configured in ironic-lib.

Additionally, this adds developer docs on how to use metrics in IPA,
including some caveats specific to ironic-lib.metrics use in IPA.

Co-Authored-By: Jay Faulkner <jay@jvf.cc>
Co-Authored-By: Alex Weeks <alex.weeks@gmail.com>
Change-Id: Ic08d4ff78b6fb614b474b956a32eac352a14262a
Partial-bug: #1526219
2016-08-03 11:24:54 -07:00