diff options
| author | Derek Higgins <derekh@redhat.com> | 2019-04-24 23:25:19 +0100 |
|---|---|---|
| committer | Derek Higgins <derekh@redhat.com> | 2019-05-08 19:25:56 +0100 |
| commit | 9caea595d2a2c8db60ef3e56312a3a5b7f3a6371 (patch) | |
| tree | c6c550bc8bd8e6544218fa7f3012cf9885009806 | |
| parent | 3afc25bb7b6d738dd324bbf067b42b6cbb64d402 (diff) | |
| download | ironic-python-agent-9caea595d2a2c8db60ef3e56312a3a5b7f3a6371.tar.gz | |
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
(cherry picked from commit 9c35f0279209ce233a7562f2d9310ded1e0edba5)
| -rw-r--r-- | ironic_python_agent/extensions/image.py | 2 | ||||
| -rw-r--r-- | ironic_python_agent/tests/unit/extensions/test_image.py | 10 | ||||
| -rw-r--r-- | releasenotes/notes/bindmount-run-4c6a31d3ee4e0ed6.yaml | 4 |
3 files changed, 15 insertions, 1 deletions
diff --git a/ironic_python_agent/extensions/image.py b/ironic_python_agent/extensions/image.py index 2ed2e9fc..0ef04608 100644 --- a/ironic_python_agent/extensions/image.py +++ b/ironic_python_agent/extensions/image.py @@ -30,7 +30,7 @@ from ironic_python_agent import utils LOG = log.getLogger(__name__) -BIND_MOUNTS = ('/dev', '/proc') +BIND_MOUNTS = ('/dev', '/proc', '/run') def _get_partition(device, uuid): diff --git a/ironic_python_agent/tests/unit/extensions/test_image.py b/ironic_python_agent/tests/unit/extensions/test_image.py index 047e97b1..232da0a8 100644 --- a/ironic_python_agent/tests/unit/extensions/test_image.py +++ b/ironic_python_agent/tests/unit/extensions/test_image.py @@ -84,6 +84,8 @@ class TestImageExtension(test_base.BaseTestCase): self.fake_dir + '/dev'), mock.call('mount', '-o', 'bind', '/proc', self.fake_dir + '/proc'), + mock.call('mount', '-o', 'bind', '/run', + self.fake_dir + '/run'), mock.call('mount', '-t', 'sysfs', 'none', self.fake_dir + '/sys'), mock.call(('chroot %s /bin/sh -c ' @@ -99,6 +101,8 @@ class TestImageExtension(test_base.BaseTestCase): attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir + '/proc', attempts=3, delay_on_retry=True), + mock.call('umount', self.fake_dir + '/run', + attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir + '/sys', attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir, attempts=3, @@ -127,6 +131,8 @@ class TestImageExtension(test_base.BaseTestCase): self.fake_dir + '/dev'), mock.call('mount', '-o', 'bind', '/proc', self.fake_dir + '/proc'), + mock.call('mount', '-o', 'bind', '/run', + self.fake_dir + '/run'), mock.call('mount', '-t', 'sysfs', 'none', self.fake_dir + '/sys'), mock.call('mount', self.fake_efi_system_part, @@ -150,6 +156,8 @@ class TestImageExtension(test_base.BaseTestCase): attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir + '/proc', attempts=3, delay_on_retry=True), + mock.call('umount', self.fake_dir + '/run', + attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir + '/sys', attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir, attempts=3, @@ -187,6 +195,8 @@ class TestImageExtension(test_base.BaseTestCase): self.fake_dir + '/dev'), mock.call('mount', '-o', 'bind', '/proc', self.fake_dir + '/proc'), + mock.call('mount', '-o', 'bind', '/run', + self.fake_dir + '/run'), mock.call('mount', '-t', 'sysfs', 'none', self.fake_dir + '/sys'), mock.call('mount', self.fake_efi_system_part, diff --git a/releasenotes/notes/bindmount-run-4c6a31d3ee4e0ed6.yaml b/releasenotes/notes/bindmount-run-4c6a31d3ee4e0ed6.yaml new file mode 100644 index 00000000..bdeb00db --- /dev/null +++ b/releasenotes/notes/bindmount-run-4c6a31d3ee4e0ed6.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Mounts /run into chroot when installing grub to prevent timeouts. |
