This change adds proxies parameter to requests.get method when
downloading images, and also sets no_proxy environment variable,
as requests does not support such parameter directly.
Implements: blueprint agent-image-proxy
Change-Id: I000ff9d0d4f5bde4766d085dc5a1c6cea1949bc5
This patch is extending the root device hints to also look at
ID_WWN_WITH_EXTENSION and ID_WWN_VENDOR_EXTENSION from udev.
Prior to this patch the IPA ramdisk only cared about ID_WWN but in some
systems in some platforms with a RAID controller, this ID can be same
even if they are different disks (see bug 1516641).
Closes-Bug: #1516641
Change-Id: Ic3e9a1111dfcc99702190c173562a0dccf5f94c4
We are using oslo.log now, but some of the modules still use logging.
We should use oslo.log to keep consistency, besides, oslo.log can
provide fine wrapper for OpenStack projects.
Change-Id: Ibe57e503b88b39e284a9e4b11a1886cd4e8d4ccf
The ISCSIError class defines a class-level message attribute with
value: "Error starting iSCSI target". This attribute is further
processed in RESTError.__init__ method, the ISCSIError super-class, to
create an Exception message concatenating self.message with provided
details argument. However, the ISCISError.__init__ method provides a
details attribute prefixed with the same text to the super(ISCSIError,
self).__init__ method. As a result, the text appears twice:
"ISCSIError: Error starting iSCSI target: Error starting iSCSI target:
ISCSI daemon didn't initialize. Failed with exit code 107. stdout: .
stderr: tgtadm: failed to send request hdr to tgt daemon, Transport
endpoint is not connected"
The patch purpose is to remove the details prefix to avoid duplicate
text in the exception text while honouring ISCSIError.message.
Change-Id: I9e1434ae17da5112527a841ac069ed2285566cca
The intention of the iscsi extension _wait_for_iscsi_daemon function
is to wait till the tgtd process boots completely before running any
iscsi commands through the tgtadm command line utility. The tgtd
process utilises a unix socket for communication with the user and the
_wait_for_iscsi_daemon function asserts the tgtd process status based
on the socket presence. The socket name/path to use is not specified
by iscsi extension configuration but rather falls-back to a
(system-wide) default value[1]. Since tgtd version 1.0.60, this path
changed from /var/run/tgtd.ipc_abstract_namespace to
/var/run/tgtd/socket[2] and now causes a false-negative while waiting
for the tgtd process to boot[3].
This patch follows implementation suggestion from the bug report[3] to
avoid relying on the socket presence but rather to check the tgtd
status by trying to communicate through the tgtadm tool.
[1] https://github.com/openstack/ironic-python-agent/blob/
5bbb9ded082f2cfde5e8877e9f33294eb93a5fb7/
ironic_python_agent/extensions/iscsi.py#L47 [2]
https://github.com/fujita/tgt/commit/
d1aa4dcfd691c9409dbad5db49ce6754ce9c1b5a
[3] https://bugs.launchpad.net/ironic-python-agent/+bug/1505923
Closes-Bug: #1505923
Change-Id: If3284e0b441fe6c2da507640c08a4bbefd9dad2b
This patch adds a missing param docstring into the normalize function
in util.py.
Change-Id: I91ecc0970fc386163657ab521d8cdd898694a426
Partial-bug: 1367915
Previous some of these methods were not well documented. Hopefully they
now are.
Change-Id: If73987a2dd234b71a1c2af9b764becc34aee4496
Partial-bug: 1367915
This is a follow-up patch for commit
3af9ab36bfae3a369fdb3d2b6d02ac803c39ee17
The review requested that a LOG.debug() message be added.
Change-Id: I36fbd4269c948812f4bee66d0130150afd0c0279
This patch updates the _install_grub2 function in image.py
so that we use 'mount -t sysfs' instead of bind mounting
the hosts /sys into the chroot.
This resolves issues which can occur with unmounting
the chroot mounts where 'target is busy' errors
may occur when you are debugging things with a serial
console.
Change-Id: I5c9a6546d048cbf54695329d9744fda55127bd30
Closes-bug: #1503385
This fixes a ValueError exception that would occur if
log debug was enabled in IPA.
Change-Id: Id95f291dd77d69e7d4dd4f945c6c151db7a0646b
Closes-bug: #1503354
This adds additional functional tests for the commands API.
It also restructures the current functional test to run in
sequence as a monolithic test to preserve IPA state and test
order between test runs. The time to wait for IPA to start
was increased due to an intermittent race condition that
occurs with the larger test suite.
Partial-Bug: 1492036
Change-Id: Iff9b41fb531d34225d702b9bfd39826e3c7195ad
Bring ironic-python-agent in line with the other ironic projects.
Stop ignoring all E12* errors except E129
Stop ignoring E711
Change-Id: Icb9bc198473d1b5e807c20869eb2af7f4d7ac360
This is a port of downstream inspector ramdisk plugins we found helpful.
* logs - sends journald logs with inspection data.
* extra-hardware - uses hardware-detect utility to collect bigger
hardware inventory and to run benchmarks.
Change-Id: If05402606c45185d618279eef46e68c51209f82b
This patches updates the get_clean_steps() method to make the
erase_devices step abortable. Erasing devices is something that can be
cancelled without damaging the machine.
When a clean step is aborted the provision state of the Ironic node
will go to CLEANFAIL state. The operator can then do what is needed to
fix the problem (i.e network booting issues) and restart the cleaning
later on.
Partial-Bug: #1455825
Change-Id: Ic181ac3712810c6f6925e8b627ee79e77ecf4d83
Put the columns to retrieve from lsblk into a list so that future
modifications to columns will require fewer code changes.
Also add a 'block_type' parameter which defaults to 'disk'. To make the
function more flexible if callers wanted a different block type.
Update and add unit tests
Change-Id: If06460e13a5b56dc8d6efca9ff5b58ac6ba1f357
This fix enables creation of config drive for UEFI only whole disk
images.
It will not work with the hybrid images that support booting in BIOS
and UEFI boot mode.
Change-Id: Ib4dd8c082a50e1dbaf0df91477b062716cb780ff
Closes-Bug: #1486887
Depends-On: I81400305f166d62aa4612aab54602abb8178b64c
This patch corrects the default ironic api port number to 6385 from
6835. The default value of 'ipa-api-url' is not used in production
environment since conductor and bare metal node have its own IP
address, but could be used in development environment.
Therefor this patch fixes this trivial error.
- default=APARAMS.get('ipa-api-url', 'http://127.0.0.1:6835'),
+ default=APARAMS.get('ipa-api-url', 'http://127.0.0.1:6385'),
Change-Id: Idb85e95b354a68111f94e8cddd5c1b6227e676ef
If an image cannot be downloaded for some reason, it is helpful for
operators to have the image path, checksum, and calculated checksums
available easily from the API.
Change-Id: I6a2fb46726245cebd730b5c51d4f25f8465f1658
Currently we only use these disk properties for root device hints.
However, they'll be really useful for inspector, especially for also
implementing root device hints.
Change-Id: I48aa6b6d2d198d16f2f8e387970f7230066cf8a2
1. cleanly separate deprecated and non-deprecated properties
2. add root disk to inspection data, so that we can have a proper
fallback when root device hints are not given.
Change-Id: Ie19b82ff2a914873ff4b2395b02643e086b934b1
A GET to /v1 in the API returns a link to a URL for a repository that is no
longer maintained. This commit changes the link to point to the correct
documentation.
Change-Id: I8779cd1840627ff8759527b7514306293682aaae
One of the bandit checks is to attempt to use the system random
library (which is better at producing randomness) vs using the
default random class, this change uses the system random where
applicable.
See: https://wiki.openstack.org/wiki/Security/Projects/Bandit
Change-Id: I15ae3c99267b2dd9dc9ceccd427f6c0aef6ae8da
This codebase can now be updated to use the refactored
base class to avoid duplicating alot of the same code.
Eventually we should also just move this to oslo if
when/this review is accepted since that seems like a better
home for this code in general.
Change-Id: I387d60667f427824a64d52544638792429887ebf
Create a SerializableComparable class derived from the Serializable
class.
Added the following functions to the SerializableComparable class:
'__eq__'
'__ne__'
Disable the '__hash__' function in the SerializableComparable class as
some derived classes are mutable.
Use the SerializableComparable class in hardware.py and
extensions/base.py
This should make unit testing users of the class easier when doing a
self.assertEqual() or self.assertNotEqual()
Added some initial unit testing for encoding.py
Change-Id: If0f14b3bfe7f1391f65dd730a16a534afed0da82
If a clean step returns a tuple (like the output of
processutils.execute), WSME raises an error about the type. Casting
the result as a list seems to make it work. This is almost certainly
a bug in WSME, but after digging a bit I couldn't find one.
Change-Id: I91cb7a989ab56c0942469e03937945d4a590ad95
Partial-bug: #1493554
Adds a new module ironic_python_agent.inspector and new entry point
for extensions, which will allow vendor-specific inspection.
Inspection is run on service start up just before the lookup.
Due to this early start, and due to the fact we don't even know
MAC address of nodes on inspection (to say nothing about IP addresses),
exception handling is a bit different from other agent features:
we try hard not to error out until we send at least something to inspector.
Change-Id: I00932463d41819fd0a050782e2c88eddf6fc08c6