summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2021-12-09 11:00:50 +0000
committerGerrit Code Review <review@openstack.org>2021-12-09 11:00:50 +0000
commit60df149c8f56148d16317ac225fb8a44d2314858 (patch)
treec20f4e79c17a3099aff751973da5d4629ef646fb
parent8abc930d974e426025b97ffb35400f1b57511d25 (diff)
parent12f5f30e630b98c8b69d4aa201f5c23b2ca85824 (diff)
downloadironic-python-agent-60df149c8f56148d16317ac225fb8a44d2314858.tar.gz
Merge "Instruct qemu-img to write image zeros to disk."
-rw-r--r--ironic_python_agent/extensions/standby.py5
-rw-r--r--ironic_python_agent/tests/unit/extensions/test_standby.py3
-rw-r--r--lower-constraints.txt4
-rw-r--r--releasenotes/notes/qemu-write-zeros-2edbf3152c57e2b6.yaml6
-rw-r--r--requirements.txt4
5 files changed, 15 insertions, 7 deletions
diff --git a/ironic_python_agent/extensions/standby.py b/ironic_python_agent/extensions/standby.py
index 623423b9..1e7855c4 100644
--- a/ironic_python_agent/extensions/standby.py
+++ b/ironic_python_agent/extensions/standby.py
@@ -200,12 +200,13 @@ def _write_whole_disk_image(image, image_info, device):
disk_utils.udev_settle()
command = ['qemu-img', 'convert',
- '-t', 'directsync', '-O', 'host_device', '-W',
+ '-t', 'directsync', '-S', '0', '-O', 'host_device', '-W',
image, device]
LOG.info('Writing image with command: %s', ' '.join(command))
try:
disk_utils.convert_image(image, device, out_format='host_device',
- cache='directsync', out_of_order=True)
+ cache='directsync', out_of_order=True,
+ sparse_size='0')
except processutils.ProcessExecutionError as e:
raise errors.ImageWriteError(device, e.exit_code, e.stdout, e.stderr)
diff --git a/ironic_python_agent/tests/unit/extensions/test_standby.py b/ironic_python_agent/tests/unit/extensions/test_standby.py
index 559a15bb..bce88a00 100644
--- a/ironic_python_agent/tests/unit/extensions/test_standby.py
+++ b/ironic_python_agent/tests/unit/extensions/test_standby.py
@@ -182,7 +182,8 @@ class TestStandbyExtension(base.IronicAgentTest):
convert_mock.assert_called_once_with(location, device,
out_format='host_device',
cache='directsync',
- out_of_order=True)
+ out_of_order=True,
+ sparse_size='0')
wipe_mock.assert_called_once_with(device, '')
udev_mock.assert_called_once_with()
rescan_mock.assert_called_once_with(device)
diff --git a/lower-constraints.txt b/lower-constraints.txt
index 6e5fc9bc..8fbb7f13 100644
--- a/lower-constraints.txt
+++ b/lower-constraints.txt
@@ -6,7 +6,7 @@ cryptography==2.3
dogpile.cache==0.9.2
eventlet==0.18.2
importlib_metadata==1.7.0;python_version<'3.8'
-ironic-lib==4.7.1
+ironic-lib==5.1.0
netifaces==0.10.4
openstacksdk==0.49.0
oslo.concurrency==3.26.0
@@ -14,7 +14,7 @@ oslo.config==5.2.0
oslo.log==3.36.0
oslo.serialization==2.18.0
oslo.service==1.24.0
-oslo.utils==3.33.0
+oslo.utils==3.34.0
oslotest==3.2.0
pbr==2.0.0
psutil==3.2.2
diff --git a/releasenotes/notes/qemu-write-zeros-2edbf3152c57e2b6.yaml b/releasenotes/notes/qemu-write-zeros-2edbf3152c57e2b6.yaml
new file mode 100644
index 00000000..8b79dc23
--- /dev/null
+++ b/releasenotes/notes/qemu-write-zeros-2edbf3152c57e2b6.yaml
@@ -0,0 +1,6 @@
+---
+fixes:
+ - |
+ IPA instructs qemu-img to write image zeros to disk.
+ Doing this will cause it not to zero out the entire
+ block device which can be very costly on a slow HDD.
diff --git a/requirements.txt b/requirements.txt
index 69d886cd..cadb5c30 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -10,13 +10,13 @@ oslo.concurrency>=3.26.0 # Apache-2.0
oslo.log>=3.36.0 # Apache-2.0
oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0
oslo.service!=1.28.1,>=1.24.0 # Apache-2.0
-oslo.utils>=3.33.0 # Apache-2.0
+oslo.utils>=3.34.0 # Apache-2.0
Pint>=0.5 # BSD
psutil>=3.2.2 # BSD
pyudev>=0.18 # LGPLv2.1+
requests>=2.14.2 # Apache-2.0
stevedore>=1.20.0 # Apache-2.0
tenacity>=6.2.0 # Apache-2.0
-ironic-lib>=4.7.1 # Apache-2.0
+ironic-lib>=5.1.0 # Apache-2.0
Werkzeug>=1.0.1 # BSD License
cryptography>=2.3 # BSD/Apache-2.0