diff options
author | Lucas Alvares Gomes <lucasagomes@gmail.com> | 2017-01-19 17:16:38 +0000 |
---|---|---|
committer | Mathieu Mitchell <mmitchell@iweb.com> | 2017-01-31 12:19:30 +0000 |
commit | 60cd324ecd43d6c59e84d1f6a8a7735bee62f0fb (patch) | |
tree | 3682409fc91924a7c14a9a8b56536290ecb6ac58 | |
parent | 695515ab6128c8e3c5578c7a584420f78f440a5b (diff) | |
download | ironic-python-agent-stable/mitaka.tar.gz |
Limit memory usage when running qemu-img convertmitaka-eolstable/mitaka
This patch is limiting the memory address space to 1 GiB when invoking
qemu-img convert. The qemu-img command can be exploited so we better
play on the safe side (See: bug #1449062).
Change-Id: I2088f74b32d1392310c569cfaa7fd368cb737421
Closes-Bug: #1657808
(cherry picked from commit 449cda4fed51250992446c83a4b50bc45fd10c6d)
-rwxr-xr-x | ironic_python_agent/shell/write_image.sh | 3 | ||||
-rw-r--r-- | releasenotes/notes/limit-qemu-img-ram-usage-d7b7a16ac5e9c917.yaml | 5 |
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. |