summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xironic_python_agent/shell/write_image.sh3
-rw-r--r--releasenotes/notes/limit-qemu-img-ram-usage-d7b7a16ac5e9c917.yaml5
2 files changed, 8 insertions, 0 deletions
diff --git a/ironic_python_agent/shell/write_image.sh b/ironic_python_agent/shell/write_image.sh
index 3f07e07a..c8fa0cef 100755
--- a/ironic_python_agent/shell/write_image.sh
+++ b/ironic_python_agent/shell/write_image.sh
@@ -39,6 +39,9 @@ log "Erasing existing GPT and MBR data structures from ${DEVICE}"
sgdisk -Z $DEVICE
log "Imaging $IMAGEFILE to $DEVICE"
+
+# limit the memory usage for qemu-img to 1 GiB
+ulimit -v 1048576
qemu-img convert -t directsync -O host_device $IMAGEFILE $DEVICE
sync
diff --git a/releasenotes/notes/limit-qemu-img-ram-usage-d7b7a16ac5e9c917.yaml b/releasenotes/notes/limit-qemu-img-ram-usage-d7b7a16ac5e9c917.yaml
new file mode 100644
index 00000000..56fff0b4
--- /dev/null
+++ b/releasenotes/notes/limit-qemu-img-ram-usage-d7b7a16ac5e9c917.yaml
@@ -0,0 +1,5 @@
+---
+fixes:
+ - |
+ Limits the memory usage of ``qemu-img convert`` command to 1 GiB to
+ avoid it from causing the host machine to fail due not enough ram.