diff --git a/ironic_python_agent/shell/write_image.sh b/ironic_python_agent/shell/write_image.sh index 3f07e07aa..c8fa0cefa 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 000000000..56fff0b4f --- /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.